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

XF 1.5 Need some help with responsive ad conditionals

Discussion in 'Styling and Customization Questions' started by Sonya, Mar 11, 2016.

  1. Sonya

    Sonya Member

    Do you ever get the feeling you may be too dumb for new software? I'm there! ;)

    I'm trying to get some ads set up in my test environment and I'm struggling. Here's what I want to do:

    If it's the forumhome page, Display responsive (adsense) ads (728x90, 468x60 and 320x50)
    If it's a specific forum node, display responsive (DFP) ads from a specific ad site (728x90, 468x60 and 320x50)
    For all other pages, display responsive (DFP) ads (728x90, 468x60 and 320x50)

    I can get one to work, but when I try to add another I'm unsuccessful. Can anyone help?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. Sonya

    Sonya Member

    Thanks, Brogan. I used that to get going, but when I try to add the 2nd and 3rd parts, I'm doing something wrong.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Breaking it down to the simplest form, it's just this:
    Code:
    <xen:if is="{$contentTemplate} == 'forum_list'">
        Ad code for forum list
    <xen:elseif is="{$forum.node_id} == x" />
        Ad code for node x
    <xen:else />
        Ad code for all other pages
    </xen:if>
     
  5. Sonya

    Sonya Member

    Thank you! That will help.
     
  6. Temery

    Temery Active Member

  7. Brogan

    Brogan XenForo Moderator Staff Member

    The ad vendors need to offer their own solutions.
     
    Temery likes this.

Share This Page