The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
vbphrase inside vbphrase is not possible
Hi,
I want to have $vbphrase[my_phrase_$DynamicValue] but it's not possible, so I tried to put a $vbphrase inside a parent $vbphrase but it's not possible either. Any workaround for this issue beside using if condition because 100 if conditions certainly don't look good and it can kill your server (evaluate and process hundreds of if conditions) Example: I have a drop down select box with short description and long description for car makers. Short description is VW and long is VoltsWagen. For main page, because space is limited so I just want VW displayed instead of VoltsWagen, and since only 1 value VW is saved to the column, when I want to display long description VoltsWagen, I use <if condition="$info[carmaker] == VW">$vbphrase[carmaker_VW]</if> (of course I have a phrase carmaker_VW contains value VoltsWagen) which works fine, but I don't like it because if you have hundreds of carmakers (or for other data) then you have to use hundreds if conditions. I don't like having hundreds of if conditions just in 1 template So I really want something like this: $vbphrase[carmaker_$info[carmaker]] or $vbphrase[carmaker_$vbphrase[carmaker_VW]] I also tried <phrase 1="$info[carmaker]">$vbphrase[maker_]</phrase> with a phrase maker_ contains value maker_{1} but it don't work either. Any help is greatly appreciated! |
#2
|
|||
|
|||
In your PHP script, try:
PHP Code:
Thanks, Alan. |
#3
|
|||
|
|||
I'm trying to do it in templates only though. If it's impossible to do in templates then I'll add it to my PHP script.
Thanks Alan for helping! |
#4
|
||||
|
||||
Use
Code:
{$vbphrase['carmaker_' . $info['carmaker']]} |
#5
|
|||
|
|||
SirAdrian,
It works! Thank you very much! :banana: |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|