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

Carousel for Featured Listings

Discussion in 'Templates, HTML, CSS, and Design Help' started by belvedere, Feb 9, 2012.

  1. belvedere Customer

    Hi. I'm trying to put a Carousel for featured listings on my site using jquery and css_horizontal_listings module. It only half works, because the same adverts are being loaded on the carousel when it reaches the end of the cycle, therefore not all featured adverts appear. The code I'm using is as follows:-

    <ul id="mycarousel" class="jcarousel-skin-tango" style="visibility:hidden;">
    <li>{css_listings_horizontal number=3 type="featured" type="random"}</li>
    <li>{css_listings_horizontal number=3 type="featured" type="random"}</li>
    <li>{css_listings_horizontal number=3 type="featured" type="random"}</li>
    </ul>


    Anybody have any ideas of a workaround for this or another way of doing it.

    I've found other posts here regarding similar requests but none seem to have an answer.

    Thanks
    Mike
  2. Mike-N-Tosh Owner

    I'm not quite sure that I'm following you. The code that you have in each <li> element is exactly the same. A call to the smarty function for listings, so each <li> should show you 3 featured listings picked at random. Since these are each a separate call to the function and depending on how many featured listings that you have, there would of course be the possibility that the same listing(s) could be chosen at random.

    If it were me (I've made a few of these carousels for clients), I would make a copy smarty listings plugins and change the output itself. Have it get a much larger number or all of the featured listings (limit) and then loop through each of the listings putting each listing into it's own separate <li>.

    In other words have the plugin itself put all the html code into the template file with a single variable, like $output.

    $output = "<ul id="mycarousel" class="jcarousel-skin-tango" style="visibility:hidden;">";

    then for each of the individual listings something like
    $output .= "<li>" . each of your listing variables that you want to show here . "</li>\n\t";

    Then finish your out put.
    $output .= "</ul>\n";
    }
    return $output;

    Any javascript carousel that I've worked with has it's own set of parameters as far as how many of the <li>s that are shown and whether it support full circle loops, start, stop, pause, speed, etc..
  3. belvedere Customer

    Thanks for your reply Mike. Yes the code in each <li> element is exactly the same as I'm just experimenting at the moment. I wanted to see if each <li> element picked up a different set of featured ads, and it does. However when the loop starts again it will repeat each group of three ads.

    I'll look into your solution but I'm not familiar with SMARTY so it'll will take me a while to figure it out.
  4. seymourjames All Hands On Deck

    Forgive me but I am confused as to what you are actually trying to do.

    Not sure why you have two types featured and random. What I can say is you can make the TC css horizontal plugin do this with a bit more custom development by adding a jquery slider

    Annonces Immobilières

    This sets 20 items in the carousel. I am unsure if this is what you mean.
  5. belvedere Customer

    Hi David,
    The type "featured" is so that it picks up only featured ads and "random" was a test to try and pick them out at random.

    What you have on your website is exactly what I'm looking for but I want ALL the featured ads to appear in rotation and not limit it to say 20.

    Thanks for your help.
    Mike
  6. seymourjames All Hands On Deck

    Mike

    I can set the number to as many as I like. Also the type to featured, random, new, category, combos, etc. Basically what the normal TC module does but animated. You can email me if you wish to take it further.

Share This Page