The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Including one template in another
Hello,
I have made a custom template and want to include it at the top of my header template for ease, so when I update the reverts don't remove my code. If the custom template is called "HEADERLOGINBOX" how could I call it at the start of my standard header template? I've tried $HEADERLOGINBOX but that doesn't work. Thanks for your help. |
#2
|
|||
|
|||
Cant you just take the login box from the navbar template and use it in the header?
|
#3
|
|||
|
|||
Quote:
What i want to do is include my custom template inside the header so that when I update, the reverts don't mess everything up. The login box in the navbar template actually has nothing to do with my custom header. |
#4
|
||||
|
||||
You need to eval your template in a plugin so the variable is available for use.
PHP Code:
|
#5
|
|||
|
|||
Thanks Lynne. Will give that a shot tonight
Where would I hook it? Header_redirect? |
#6
|
|||
|
|||
Don't need to hook it, just call it where you want in the style.
As Lynne showed, replace $yourvariable with $headerloginbox calling the template you created in place of your_template. You'll need to add that eval to a page somewhere. Then in the header template place the $headerloginbox where you would like. |
#7
|
|||
|
|||
Quote:
|
#8
|
||||
|
||||
It sounds to me like the OP does need to use a plugin since this is not on a custom page, but on every page. And, since you want it included in the header, you'll have to use a very early hook location like a global_* one (global_start?). So, try that.
|
#9
|
|||
|
|||
The way to do this is to look at what php page you are loading.
So it depends where you want to insert the template. Let's say you want to insert a template on a thread's page somewhere in the SHOWTHREAD template. So you would be looking at the thread with the showthread.php file. This is the file that you have to scan for hooks. Open it in a text editor and check what hooks are in the php file and where they are located. Often, there is a hook at the end which is safe to hook into (in this case 'showthread_complete'). Then you do as suggested above. Go to the plugins. Create a plugin for the hook you just found. Eval the template in that hook and use the variable in the showthread template. |
#10
|
|||
|
|||
Quote:
Quote:
Thanks people |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|