Conditional Statements

Conditional Statements

Different steps are required when using that add-on.
You will need to check in the resource thread for what they are.
 
Then default XF Sidebar is not in use, You can edit Staff Widget here www.forum.com/admin.php?widgets/.

Different steps are required when using that add-on.
You will need to check in the resource thread for what they are.

Sorry for the double post here, I only use that widget framework for new members, so I have switched it off and still nothing happens, remembering - I have already hidden the users online list to guests, just not the staff.
Thank you for the help so far. :)
 
The guest conditional statement is the same for all templates/content.

If it's not working then either you're not inserting it correctly, not in the style you're viewing. or there's a third party modification involved.
 
Got it...
It's nothing to do with BD widgets or the style and it took me a while, but if anyone wishes to hide staff online and uses Andy B's sidebar positions add-on then you must edit this template, with the conditionals;
andy_staff_online_now

Thanks both @Brogan and @RoldanLT for your help, much appreciated. :)
 
Is there a conditional statement for display size?

I have a customized template with contents (ads) I don't want displayed on smaller mobile devices (phones).
 
<xen:if is="{$contentTemplate} == ‘forumview’”>

</xen:if>

Do I just put the appropriate template? forum view, thread view etc?
 
Well, when I test it using using this in the page container js head template, and I'm told that it breaks the as gives me a line error to the last </xen:if>.
Here is the exact thing I use to test with
<xen:if is="{$contentTemplate} == 'forum_list'">
Hello world!</xen:if>

My ultimate goal is ad tags, and not show them on places that do not meet our criteria.
 
That worked fine for me.

upload_2016-3-16_18-59-40.webp

However, conditional statements related to ads would normally be used in the ad templates, not js templates.
 
However, conditional statements related to ads would normally be used in the ad templates, not js templates.

GPT tags need to be in the header. They need a header tag, and a body tag. so I'm a bit confused as to why I would want to use the ad templates for that case?
 
What would be the conditional for checking the usergroup membership of a specified user?

<xen:if is="!{xen:helper ismemberof, $visitor, x}"> determines if the browsing user is not a member

I'm looking for something like <xen:if is="!{xen:helper ismemberof, <UserId>, x}">
... where <UserId> = the value I specify, returning true if <UserId> is not a member of usergroup x.
 
Hi Brogan,

Have Google Publisher tag codes and I would want to use them below the first post in a thread view page as below

- Show ad code IL_Showthread_FirstPost', [728, 90] for desktop devices
- Show ad code IL_forums_firstpost_showthread', [300, 250] for phones

Is there a template conditional that I could use to do the above?
@Brogan Thanks in advance for the response.
 
Apologies for asking.

I'm trying to only allow a custom template I've created to be called if the user is on a page with the ID 7. I've read over the documentation and for some reason can't get it to work. It works fine if I want it to show in a forum view, but I only want it to show if it's on the page with the ID of 7.
This is what I have, but it doesn't seem to work.
Code:
<xen:if is="{$page.node_id} == 7">
<xen:include template="gp_container" />
</xen:if>
 
Last edited:
If you just want it to show on that page node only, just include the template in the page html.
 
Top Bottom