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

Conditional for specific pages only

Discussion in 'Styling and Customization Questions' started by Neil E., Feb 16, 2013.

  1. Neil E.

    Neil E. Active Member

    I'm working on ad_below_bottom_breadcrumb.

    PAGE_CONTAINER calls ad_below_bottom_breadcrumb for every page.

    I only want to display the ad on the conversation_view and thread_view pages.

    In ad_below_bottom_breadcrumb I have:

    <xen:hook name="ad_below_bottom_breadcrumb" />
    <div class="bottomAd">
    <div style="text-align: center;">
    "....google ad script here...."
    </div>
    </div>

    In EXTRA I can do a display: none for the class bottomAd in all pages EXCEPT conversation_view and thread_view. So the ad only shows where I want, however the ad "space" is still present in all the other pages, pushing the footer down.

    I think I need a conditional in PAGE_CONTAINER that would be something like:
    <xen:if is="{conversation_view}+{thread_view} />
    <xen:include template="ad_below_bottom_breadcrumb" />
    </xen:if>

    Ideas?
     
  2. Neil E.

    Neil E. Active Member

    The CSS wasn't taking hold, so the footer was pushed down by the google "fill ad space with blank space" function. I moved the code block in EXTRA and it started working.

    I'd still like to know if a conditional could be made to work.
     
  3. EQnoble

    EQnoble Well-Known Member

    add this under <xen:hook name="ad_below_bottom_breadcrumb" />
     
  4. Neil E.

    Neil E. Active Member

    I tried your code exactly as posted but it didn't work right. The ad showed up on all pages. I tried another variation but received the same result.

    <xen:if is="{$contentTemplate} == 'conversation_view' || 'thread_view' ">
    <xen:hook name="ad_below_bottom_breadcrumb" /> .....[google script and classes inside this template]
    </xen:if>
    I can stay with the CSS method.
     
  5. EQnoble

    EQnoble Well-Known Member

    I am sorry...color me stupid but I posted something completely irrelevant....



    This will work... just wanted to follow up so the right info is out there

    HTML:
    <xen:if is="in_array({$contentTemplate}, array('conversation_view', 'thread_view'))">
     
        <div class="bottomAd">
     
            <div style="text-align: center;">
     
                "....google ad script here...."
     
            </div>
     
        </div>
     
    </xen:if>
    Sorry about the confusion
     
    DRE likes this.
  6. Neil E.

    Neil E. Active Member

    This conditional works perfectly, thank you.
     
  7. EQnoble

    EQnoble Well-Known Member

Share This Page