1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Node exclusion (conditional) help

Discussion in 'XenForo Questions and Support' started by PVO_Dave, Feb 18, 2014.

  1. PVO_Dave

    PVO_Dave Active Member

    Can anyone offer some assistance with this please, it should be simple, and it's likely I'm just doing something wrong :)

    I want to exclude adsense from a particular node, 9 in this instance.

    The current conditionals in place are:

    <xen:if is="!{$visitor.user_id}">
    <xen:if is="!in_array({$contentTemplate}, array('', 'message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'login', 'error_with_login', 'contact'))">

    So I tried adding AND !{$forum.node_id} == 9 to the visitor ID condition and it stops the adverts, but it stops it on all nodes, I tried the same against the pages one and got the same result.

    Weirdly however, it works for the in post advert:
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$visitor.user_id} AND !in_array({$thread.node_id}, array(9, 76))">

  2. Brogan

    Brogan XenForo Moderator Staff Member

    You should be using {$forum.node_id} == 9.

    Putting a ! in front of it means all nodes except node 9.
  3. PVO_Dave

    PVO_Dave Active Member

    That's right though, isn't it? I want the adverts to display everywhere but node 9.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    <xen:if is="!{$visitor.user_id} AND {$forum.node_id} != 9">

    That's what you need.
    PVO_Dave likes this.
  5. PVO_Dave

    PVO_Dave Active Member

    Thanks Brogan, that seems to have done the job :)

Share This Page