Jump to content

{if} statement with array and theme setting


ehren.

Recommended Posts

Hi everyone,

I have a button on my theme which I want to show to certain user groups using an array. This works using:

{{if member.inGroup( array(2,4) )}}
xxx
{{endif}}

The "xxx" code is shown to Guests (id=2) and Admins (id=4). So far, so good.

To make this customizable, I turned the array into a setting. It uses a Text Input and is called pickerGroups. In the input field, I entered:

2,4

And my template code looks like this:

{{if member.inGroup( array(theme.pickerGroups) )}}
xxx
{{endif}}

Strangely enough, this works for Guests (2), but not for Admins (4). If I reverse the numbers and change the theme setting to 4,2, the button appears for Admins (4), but not for Guests (2).. it's basically only visible for whatever id comes first.

If I output the setting using {theme="pickerGroups"}, it correctly shows 2,4 - but it doesn't work correctly in the array tag. Am I doing something wrong.. or is this a bug?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...