The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Duplicate Template Variables & Use It Within Another Template?
I've read quite a bit of helpful threads/tutorials here. I know how to create a custom template and set it in plugins then call from within another template. I was wondering, however, how would I go about creating a template that uses the variables of an existing template such as "threadbit"? Example below...
I want to create a template called "threadbit_test". In it I want to copy/paste the content from "threadbit" template. I then want to use "threadbit_test" template inside "threadbit" template such as: In threadbit template code applied: Code:
<if condition="in_array($forumid, array(x,y,z))"> $threadbit_test <else /> threadbit content here </if> For some reason the variables I took from threadbit template do not display in $threadbit_test? The only way (right now) I'm able to display the variables of threadbit template is to literally copy it and replace it where $threadbit_test is in the code example. It's rather cluttered. Do I need to cache and parse the $threadbit_test template or hook it to threadbit_display or another area in the plugins such as global_start? Your help is appreciated. |
#2
|
||||
|
||||
PHP Code:
|
#3
|
||||
|
||||
Thanks for replying Dismounted.
I've implemented the hook in showthread_complete as described above but the $threadbit content did not display in $threadbit_test. I could be wrong but isn't $threadbit called from the forumdisplay hook? Still, I tried forumdisplay_start and forumdisplay_complete hooks but to no avail either. Hmm... --------------- Added at 12:45 --------------- Update: I changed the hook to "threadbit_display" and the content showed up. :up: The downside is that $threadbit_test added border lines that $threabit template did not. At least I'm getting closer. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|