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

XF 1.4 Ad Template Conditional

Discussion in 'Styling and Customization Questions' started by upnet, Jan 30, 2015.

  1. upnet

    upnet Active Member

    Im using this conditional in ad_message_below

    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} % {$xenOptions.messagesPerPage} == 4 OR {$post.position} % {$xenOptions.messagesPerPage} == 9 OR {$post.position} % {$xenOptions.messagesPerPage} == 15">

    For some reason this change seems to be making my adsense in ad_below_bottom_breadcrumb dysfunctional. I get the spacing for the ad but no add showing.

    If I remove everything at OR and after in the conditional then my ad in ad_below_bottom_breadcrumb works fine. So I must suck at writing the conditionals. Anyone?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    That conditional statement shouldn't affect the other template.

    It's possible you have malformed code somewhere or your other template code is incorrect.
  3. upnet

    upnet Active Member

    Thanks for the response. It sure seems to be the conditional though because If I shorten it to

    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} % {$xenOptions.messagesPerPage} == 4">

    Then the ad in ad_below_bottom_breadcrumb shows fine. Very strange.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    It works for me in my testing.
  5. upnet

    upnet Active Member

    Oh well. I'll just leave it with two ads for now. Works fine that way, maybe the universe is telling me not to have so many ads.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    It could be an AdSense limitation.

    Try replacing the ad code with placeholder text to confirm that.
    upnet likes this.
  7. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    IIRC Adsense do not allow more than 3 ads per page. So you'll likely see nothing after the third one...
    upnet likes this.
  8. upnet

    upnet Active Member

    Guess I'm getting greedy. Thanks for the help.

Share This Page