XF 2.2 Multiple user IDs - string/array

Old Nick

Well-known member
Hello, i try to set a conditional with multiple user IDs.
HTML:
<xf:if is="in_array($user.user_id, [$xf.options.UsersID])">
UsersID is set as a text box with a string as Data type. It works if i fill in one ID but doesn't work with multiple like 3, 187, 56.
Which parameters i have to use for this works ?

I tried text box/array but the system refuses.
Thanks.
 
I'm trying to get the following to work in a .less template but it doesn't. Any idea how?

Code:
<xf:if is="in_array($forum.node_id, {$xf.options.JFNEnodesId})">
 
Doh!
I didn't even read that bit.

Yes, @K a M a L is correct - you can't use if statements and vars of that nature in less templates.

You will need to use it in a regular template.
How would I apply the css in a regular template? I want to check the selected forums in options then apply the css.
 
Use an inline if statement which applies a new class - define the new class in the less template.

You can find examples of that in the templates.
 
Use an inline if statement which applies a new class - define the new class in the less template.

You can find examples of that in the templates.
I've tried this but it don't work:
Code:
{{ $forum.node_id, $xf.options.JFNEnodesId ? 'blockedContain' }}
 
Back
Top Bottom