![]() |
How do i make a variable?
I'm new to modifying templates, and am currently trying to make a different head for certain modifications. I know that the $header variable displays header code found under the header style template, but say i wanted to make a variable $header_articles how would i set it up so it displays the template code found in header_articles
I hope this make sense.. lol i'm not the brightest when it comes to coding terms.... EDIT: i'm almost certain it aint a phrase... |
Cache and parse the template then use a replacement variable to change $header to $yourvariable
|
Create a new template containing what you'd like displayed when your variable is used.
Create a hook using location "global_start" with the following: Code:
eval('$myvar = "' . fetch_template('mytemplate') . '";'); Anywhere you use $myvar in a template, the contents of mytemplate will be executed. To cache the template, create a new plugin at hook location "cache_templates" with the following: Code:
$globaltemplates[] = 'mytemplate'; |
Thank you so much kirk, that was a really great guide and i appreciate it immensely!
|
No problem.
|
All times are GMT. The time now is 02:59 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|