The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Calling other templates
Is there a way to call other templates?
Basically, is there a way to do this: Code:
<vb:if condition="$bbuserinfo[fieldx] != 'Vertical'"> vb:template postbit; <vb:else /> vb:template postbit_legacy; </vb:if> |
#2
|
|||
|
|||
No, you have to do that in your code.
|
#3
|
||||
|
||||
In the GENERIC_SHELL template, they call certain templates
Code:
{vb:raw headinclude} <title>{vb:raw pagetitle}</title> <vb:if condition="$includecss"> <vb:if condition="$vboptions['storecssasfile']"> <vb:each from="includecss" value="file"> {vb:cssfile {vb:raw file}} </vb:each> <vb:else /> {vb:cssfile {vb:raw includecss}} </vb:if> </vb:if> {vb:raw headinclude_bottom} |
#4
|
||||
|
||||
It works if you have already rendered the template and then you need to register the variables for use in that template (it is actually calling a variable with the same name as a template, not calling a template).
|
#5
|
||||
|
||||
My thought is to copy the postbit to a new template called postbit2, then put the above code in the postbit.
How can I render the two templates (postbit_legacy and postbit2), or choose which template to use then render one of them? |
#6
|
|||
|
|||
You need to fetch the remplate and register it in your code.
|
#7
|
|||
|
|||
Stop!!!!
Just check, how vB is handling the postbit templatess It's much easier to change $vbulletin->options['legacypostbit'] ! |
#8
|
||||
|
||||
^^ What he said. That is the option that determines which postbit template gets used. So, toggle it depending on what the user has selected.
|
#9
|
||||
|
||||
Quote:
Where would I find this and how can I access the user's preferences to switch the option? -David |
#10
|
||||
|
||||
Did you use a User Profile Field for them to pick which to use? Just do a condition based on that field to change it for the user. Look in the showthread.php file to find a good hook. Or, if in debug mode, you can see the hook locations all listed on the bottom of the page in the order they are used. Sometimes I find myself just going down the list to see which is best.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|