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

Neutral Singh

Well-known member
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.webp
 
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.
 
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!
 
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}
 
Top Bottom