The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi there,
I'm trying to optimize some processes and for that I need to know if it's possible to have variables inside of templates. Now, I know about conditionals and stuff, but what I want to achieve is typing less code while manually updating some custom slider-templates or having these templates update automatically. A SIMPLE EXAMPLE: Code:
<ul id="slider"> <li> <a class="featured-item_1" href="showthread.php?t=4468" title="Title"> <span class="slide-caption">Title</span></a> </li> </ul> The optimal thing would be extracting the thread-ID and title of each thread marked as featured item, so that it shows up automatically. Do I make sense? ![]() Thanks! |
#2
|
|||
|
|||
![]()
You can use variables, you just put a php variable directly in the template. You can use any variable that's available when the template is eval()'d. So you could do something like:
Code:
<ul id="slider"> <li> <a class="featured-item_$item" href="showthread.php?t=$tid" title="$title"> <span class="slide-caption">$title</span></a> </li> </ul> Then of course you'd need to set those variavle in php code somewhere, like a plugin or a custom script. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|