View Full Version : vb variable in phrase?
doa24uk
07-21-2009, 02:12 PM
Hi guys,
I'm trying to use a variable ... for the thread title in a phrase ...
Is this possible??
$threadinfo[title] - that's the var i'm trying to insert but it isn't outputting the thread title, it's outputting itself ....
Marco van Herwaarden
07-21-2009, 02:27 PM
Please provide the code you are using.
doa24uk
07-21-2009, 02:32 PM
Hi it's just the following in a phrase...
$threadinfo[title] from MySite.com
I've also tried -
Test - $vbphrase[$threadinfo[title]]
and
Test - {$threadindo['title']}
Lynne
07-21-2009, 02:36 PM
This is done quite a bit in vb. If you look at how they do it, it's done something like this:
phrase = my_phrase:
The title is {1}
Code in the template:
<phrase 1=" $threadinfo[title]">$vbphrase[my_phrase]</phrase>
doa24uk
07-21-2009, 07:17 PM
Hi Lynne,
I think we're getting closer but still nothing unfortunately!
I've created a new phrase and put this as the text
<phrase 99xsa=" $threadinfo[title]">$vbphrase[doa_thread_title]</phrase>
Varname - doa_thread_title
Then in the phrase where I wish to call the thread title
Test - {99xsa}
And that simply out puts
Test - {99xsa}
:( :(
So close yet so far!
Lynne
07-22-2009, 01:59 AM
Reread my post. The phrase itself will have the {1} in it, not any variable. Then the other code is what you put in the template to call the phrase. Like I said, if you look at the templates, you will see this method used throughout.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.