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

Featured ads on showlistings template

Discussion in 'Templates, HTML, CSS, and Design Help' started by BlackWebs, Sep 4, 2013.

  1. BlackWebs New Member

    Hi all,

    I know this is probably a long shot, but has anyone got or can help me develop the ShowListings template to show the Featured ads from all the sub categories beneath the sub category links.

    For example:

    http://www.supercartrader.com/categories/lamborghini-for-sale/page/1.html

    There's a featured Ad in the "Aventador" category - I'd like to get this add showing on this page (as well as any other featured Lamborghini ads).

    Thanks
    Tom
  2. Mike-N-Tosh Owner

    If the goal is to simply show any "featured" ad listings under the category table when "browsing" by category, then your easiest and most straight forward method would be to use the listings smarty template. Take a look at the default home page to see how it is used to show the featured listings. Apply it to the browse.tpl in your custom template folder. If you want to style it more like the "showlistings", then use the code from the showlistings(2).tpl file the parts between the {foreach ...} ... {/foreach}. (change the "from=$results" to something else that you assign in your smarty call, see below).

    Use the smarty {debug} on the browse page to see what the smarty variable is for the category that you are browsing and use that variable in your listings call. In the link that you gave above in your post the category is "1", so you are looking for the category variable that is one on that page.

    So you will have something like this: (NOTE: the category=$cat <-- is the variable you need)
    Code:
    {listings limit="10" featured="Y" category=$cat assign="catfeatured"}
    {foreach from=$catfeatured item="catfeat" name="catfeatured"}
    ... your display code for listings ...
    {foreachelse}
    {* leaving this blank to avoid errors *}
    {/foreach}
  3. BlackWebs New Member

    Hi Mike,

    I thought it might be via that method, but will that show all the featured ads from each sub category for that parent category only? I will have a play around with it tonight -

    Thanks
    Tom

Share This Page