PDA

View Full Version : How to get new template to display on home page


vb_guru
10-14-2004, 11:41 PM
Hi, I have created a new template and am trying to get it to display in the index.php page of Vbulletin forums. The problem is that I can only get my new template or the existing template to display but not both at the same time. See below for more explation:

I created within vBulletin admin the 'forumhome_feature' template. Now I want to display this template within the Forum home page. I added it to the following:

// pre-cache templates used by all actions
$globaltemplates = array(
'FORUMHOME',
'forumhome_event',
'forumhome_forumbit_level1_nopost',
'forumhome_forumbit_level1_post',
'forumhome_forumbit_level2_nopost',
'forumhome_forumbit_level2_post',
'forumhome_lastpostby',
'forumhome_loggedinuser',
'forumhome_moderator',
'forumhome_pmloggedin',
'forumhome_subforumbit_nopost',
'forumhome_subforumbit_post',
'forumhome_subforumseparator_nopost',
'forumhome_subforumseparator_post',
'forumhome_feature'
);


But now I can only get it to display by itself without any of the other home page templates or page output using this code at the end:

eval('$HTML = "' . fetch_template('forumhome_feature') . '";');
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');

Normally just this code is used for the home page index.php but this will not display my template.

eval('print_output("' . fetch_template('FORUMHOME') . '");');

So my question is how do I get a template that I created with VBulletin admin to display in existing VBulletin pages like index.php while still displaying the existing templates?

Thanks in advance for the help.

AN-net
10-15-2004, 12:01 AM
use this in index.php put it before the print_output it called

eval('$forumfeature = "' . fetch_template('forumhome_feature') . '";');


name place $forumfeature inside the forumhome template;)

vb_guru
10-15-2004, 01:23 AM
Thanks for the reply what do you mean by name place $forumfeature?

I put the $forumfeature inside the main formhome template and it didn't seem to help.

AN-net
10-15-2004, 01:26 AM
$forumfeature is the variable name i gave your new template, you can change it if you want to. did u place the php code i gave in the index.php file and put it before the FORUMHOME template was called?

vb_guru
10-15-2004, 02:10 AM
Hey, Thanks I got it to work. Is there a good reference doc about how VB handles templates/variables/.php, etc?

AN-net
10-15-2004, 10:06 AM
check in modification hints and tips, also try the docs at vbulletin.com;)