Log in

View Full Version : Problem getting new template to show


led_belly
12-06-2005, 07:22 AM
Hello,

I have done the following but still am not getting the template to be included in a page:

First, I created a new template called navbar_popups and added some markup. (btw: When I try to associate the new template with a custom product, after I save it and go back it appears under the default vbulletin product... is this normal?)

Second, in an existing template (that works) I added: $navbar_popups

Third, I created a plugin in the global_start hook with this:

eval('$navbar_popups .= "' . fetch_template('navbar_popups') . '";');

Lastly, I created another plugin in the cache_templates hook location with this:

$globaltemplates = array_merge($globaltemplates, array('navbar_popups'));

I am running in debug mode and when I refresh the page "navbar (1)" shows up in Template Usage (not red, so the cache works) but the markup isn't present in the source thus the template does not showup on the page. Any ideas?

Marco van Herwaarden
12-06-2005, 07:45 AM
First, I created a new template called navbar_popups and added some markup. (btw: When I try to associate the new template with a custom product, after I save it and go back it appears under the default vbulletin product... is this normal?)
Yes it is normal that it defaults back to vB. Only in the Master Style you can add your own product templates.

global_start might not be the best hook location for this, but try adding the following line before the template eval:
global $navbar_popups;
PS you probably also want to use '=' instead of '.=' in the eval.