The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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... |
#2
|
|||
|
|||
Cache and parse the template then use a replacement variable to change $header to $yourvariable
|
#3
|
||||
|
||||
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'; |
#4
|
|||
|
|||
Thank you so much kirk, that was a really great guide and i appreciate it immensely!
|
#5
|
||||
|
||||
No problem.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|