Remove ads on featured listings

Discussion in 'Templates, HTML, CSS, and Design Help' started by cwp, Apr 6, 2015.

  1. cwp Customer

    I have a banner on the top of each page (code is in layout.tpl)

    I would like to remove the ad on listings that are marked as featured (the advertisement would be displayed on all other pages). I'm not very good with smarty templates or php but I sometimes I get lucky.. basically on the layout.tpl page I want to put some code above and below the advertisement.. here's what I've come up with but its not working

    Code:
    {if $body=='viewlisting2.tpl'}
    {elseif $featured! == "N"}
    advertisement here
    {/if}
  2. freeze2 Super Moderator

    Just going from something I had worked on in the past...try this and see if it works:

    Code:
    {if $body=='viewlisting2.tpl' && $featured!=='Y'}
    advertisement here
    {else}
    show something else
    {/if}
    
  3. cwp Customer

    I tried this - changing both "Y" and "N" in "entry.featured!=='N'}" and every page showed "2" except for the listing pages, which showed "1" regardless if it was a featured listing or not.

    Code:
    {if $body=='viewlisting2.tpl' && $entry.featured!=='N'}
    1
    {else}
    2
    {/if}
    Any other ideas? I'd be willing to pay for your time if you will have to look into it.
  4. cwp Customer

    I figured it out. I had to remove "entry." from your code. Regardless you helped me out. PM me your paypal email so I can buy you lunch.
  5. Mike-N-Tosh Owner

    I just love happy endings.
  6. freeze2 Super Moderator

    No worries...I just ate

Share This Page