The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Insert template within template
Is it possible for me to call a template from inside another template?
eg, I'd like to throw all of my custom stuff into a brand new template, and then open the SHOWTHREAD template and manually place it in there without junking it up too much. Is it only possible to do this via plugin/template_hook calls, or is there a manual method i'm missing? |
#2
|
|||
|
|||
Yes it's possible, I do this with my header and footer and then just have one liners in the two templates. First of all you need to create a plugin. The parse_templates hook works well for me.
PHP Code:
Code:
{vb:raw custom_template} |
#3
|
||||
|
||||
Fantastic, thank you so much!
I'm playing with it a bit now and i'm getting it to insert the template as I would expect, but there's one thing I'm not certain about.. Because I am doing something with the SHOWTHREAD template, I am making use of some variables such as {vb:raw threadid} and {vb:raw pagenumber}. These are not being called properly when using the plugin method of inserting the template.. is that simply a byproduct of this (meaning I should likely continue to edit the template manually), or is there a method that would make it work? I thought perhaps changing the hook call could allow it to have the necessary info first, but I don't think that's it. Maybe there's a way for me to tell it to get that info from showthread? Thanks again |
#4
|
|||
|
|||
I'm guessing your problem is that you need to register these variables for use in your custom template.
Just after the first line (before the render line) try this in your plugin: PHP Code:
|
#5
|
||||
|
||||
That was exactly it. You are awesome, thank you!
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|