I am encountering a strange (to me, but maybe I'm missing something) bug when attempting to use conditionals to distinguish between users in the Solspace Calendar tag. As you can see from the code below I'm attempting to display a different calendar dependent on the user's member_group (I have also tried group_id to no avail).
{exp:calendar:cal
{if segment_3 == ''}
date_range_start="year-month-01"
date_range_end="year-month-last"
{/if}
{if segment_3 != ''}
date_range_start="{segment_3}-{segment_4}-01"
date_range_end="{segment_3}-{segment_4}-last"
{/if}
{!-- Main problem from here down --}
{if member_group == 1}
calendar_id="1|2|3"
{if:else}
{calendar_id="1|2"}
{/if}
}
The above is essentially what I believe the code should look like. I have tried many different methods including:
- the same style of {if}code{/if} {if}code{/if} as the segment_3 above it (which works for the segment_3 bit)
- enclosing the entire tag within a conditional checking the member_group
- making the conditionals around segment_3 more specific to only allow certain member_groups
- using quotes on the member_group like so: {if member_group == "1"}
- putting the member_group check above the segment_3 check
- Taking out the if statement for segment_3 and only having one on member_group
- probably various other things that I forget at the moment
When the conditionals are set up like either case of the example above, it will always use the second case. So if I make "1|2|3" the calendar_id for the else statement, that is what it will display.
I have checked to make sure that I am getting proper values from the member_group/group_id by using conditionals with them just outside of the calendar tag and these work properly. Do I just not have access to them within the calendar tag?
Thanks in advance for any help!