XF 2.2 Calling variable from a script inside a template

jasculs

Member
So I'm trying to call specific variables from a script for a product tour software that I'm using.

The software is able to recognized the property id but it is not recognizing the variable output.

Is there a way I can format this so then the software I use can identify the values?

This is what I have so far:

Code:
<xf:js>LOU.identify('$xf.visitor.user_id',
    { 
    usergroup: '$xf.visitor.user_group_id',
    username: '$xf.visitor.username',
    url: '$xf.fullUri',
    message_count: '$xf.visitor.message_count',
    })
</xf:js>

This is the documentation for the software installation:


It recognizes the script but it's not recognizing the values

Thank you!
 
You're currently printing the variable names as strings instead of their actual values. If you want to output a value, you need to wrap it in curly brackets like this: '{$xf.visitor.user_group_id}'. If you want to take it a step further, you can leave the wrapping quotes away, you can instead use the json filter and it'll print it appropriately: {$xf.visitor.user_group_id|json}
 
You're currently printing the variable names as strings instead of their actual values. If you want to output a value, you need to wrap it in curly brackets like this: '{$xf.visitor.user_group_id}'. If you want to take it a step further, you can leave the wrapping quotes away, you can instead use the json filter and it'll print it appropriately: {$xf.visitor.user_group_id|json}

Thank you very much...that worked for me!
 
Top Bottom