• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 How to pass a variable in a phrase in postbit?

Neutral Singh

Well-known member
#1
How can i pass a variable in a phrase in the postbit? So, that along with every post, the name of the poster can be shown as shown in the image.

For example: Phrase abc has value "Start a Conversation with {username}", here what would the xenforo variable to be passed in the phrase...

i hope i made some sense... :rolleyes:
conversation.jpg
 

Robust

Well-known member
#4
What Brogan linked isn't really programming. It kinda answers your question, I can't really even add to that. That's how to use variables in templates.
 

Neutral Singh

Well-known member
#6
Thanks @Brogan

Actually, i had already figured it out that it would be {$user.username} but i was wondering if i could put it in a phrase... which i was asking in the first post... but it was returning {$user.username} as it is.

Actually, it was a template modification and i had to put {$user.username} in there to be able to make it work and now it works!
 

Robust

Well-known member
#7
Thanks @Brogan

Actually, i had already figured it out that it would be {$user.username} but i was wondering if i could put it in a phrase... which i was asking in the first post... but it was returning {$user.username} as it is.

Actually, it was a template modification and i had to put {$user.username} in there to be able to make it work and now it works!
{xen:phrase 'phrase_name', 'variable={$value}'}

phrase_name:
This is {variable}