1 7ontheline May 12, 2008 21:51
3 7ontheline May 12, 2008 22:11
I am not sure if I can call a specific main template inside a skin using a stub file.
Basically I created an About page using the "www.blogname.com/blog.php?disp=about" method.
When I pull that page up it uses the index.main.php template. I want it to use the posts.main.php template.
I feel like there is a small bit of php that I can add to the top of my about page to make it do this, but I am not sure.
4 tilqicom May 12, 2008 22:19
7ontheline wrote:
I am not sure if I can call a specific main template inside a skin using a stub file.
Basically I created an About page using the "www.blogname.com/blog.php?disp=about" method.
When I pull that page up it uses the index.main.php template. I want it to use the posts.main.php template.
I feel like there is a small bit of php that I can add to the top of my about page to make it do this, but I am not sure.
firstly, do use a stub file :) , then open your stub file and change 'require $inc_path.'_blog_main.inc.php';
' duplicate the blog_main.inc and change that line adressing to the new one..
then open the new blog_main.inc.duplicate.php and you will see;
$disp_handlers = array(
'arcdir' => 'arcdir.main.php',
'catdir' => 'catdir.main.php',
'comments' => 'comments.main.php',
'feedback-popup' => 'feedback_popup.main.php',
'mediaidx' => 'mediaidx.main.php',
'msgform' => 'msgform.main.php',
'page' => 'page.main.php',
'posts' => 'posts.main.php',
'profile' => 'profile.main.php',
'single' => 'single.main.php',
'subs' => 'subs.main.php',
you can change the dips handlers however you like in here..
btw, you can directly do these changes ofc, but duplicating is a kind of backup : P
5 7ontheline May 12, 2008 22:38
I decided to just add a line to the _blog_main.inc.php file in the $disp_handlers array
'about' => 'posts.main.php',
I now get the right main template to display however nothing from my _about.disp.php file shows up.
Any ideas?
6 7ontheline May 12, 2008 22:46
I figured it out. After adding the above code I needed to add the following into my posts.main.php for it to know what page to display.
<?php
skin_include( '$disp$', array(
'disp_about' => '_about.disp.php',
) );
?>
Thank you for all the help.
7 sam2kb May 12, 2008 22:49
8 7ontheline May 12, 2008 22:54
Right, I used the link above to create the About page however I needed to add the line of code to the "_blog_main.inc.php" in order to get the correct main template to display.
9 sam2kb May 12, 2008 23:09
You don't have to change _blog_main.inc.php if you did step 1 from that FAQ
10 esanchez May 13, 2008 00:52
Is there a way to display a specific article post such as this:
http://yoursite.com/index.php?disp=135
where 135 is my article # 135?
UPDATE: Sorry guys, as soon as I asked this I realize what I really want is just a direct link to article #135... Duh!
In my case, I'm building a spanish version of my site and I want a menu item that says "En Español"... when people click there, I was thinking of putting a disp=espanol, but - all i need is a direct link to that given welcome page... which happens to be an article #.
11 sam2kb May 13, 2008 00:55
12 tilqicom May 13, 2008 08:40
sam2kb wrote:
haha i ve clicked it and that link actually loads lol :D
13 edb May 13, 2008 17:01
Hi 7ontheline. Just wanted to say it *was* using the correct file to display a single page. "posts.main.php" is for multiple posts. A custom disp is not multiple posts, so of course it should not use that template for those pages.
Seems you've found a way to your own personal happiness, but I figured I would chime in on a minor detail anyway. Cheers!
use a stub file ;), you can easily change the display handlers in the core files, dont know what you d like to do exactly, but try finding an alternative way rather than core changing