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

Would like 'listings plugin' to display subcategories ads of parent

Discussion in 'Modules / Plugins / Modifications' started by jevanedwards, Apr 24, 2014.

  1. jevanedwards New Member

    Hello,
    Thanks in advance, I've looked everywhere for this solution. I would like to display all subcategory ads in one list of a parent category with the listings plug-in. I've only got ads in the subcategories which leaves the parent category technically empty. If I specify to only display ads from the parent category, nothing shows up.

    From what I've read it, it's not possible. Are there any tricks? Can I duplicate and modify an existing plug in? Thanks greatly for the help.
  2. Mike-N-Tosh Owner

    The listings plugin was designed to show a few ads at a time that meet a basic criteria (e.g. a category, featured, seller, etc.). It wasn't designed to do more complicated searches and associated arrays.

    I'm sure that you could make a copy of the plugin and make it do much more complex queries, however it would be quite a bit more complicated. Also depending on your category structure and how complex that it, could also be pretty CPU and database intensive.

    There may be other solutions or options if you can give more details to what your goal is. Where are you wanting to do this (e.g. what template file/page)? Perhaps a pre-done search link might serve you better?
  3. jevanedwards New Member

    Thanks for the quick reply. CruiserClassifieds.com is the site. Toward the bottom I've set up 3 ad columns: 'boats', 'sailboats', and 'Newest Listings'; I'd like to change the 'Newest Listings' to 'equipment' and list the 10 newest from equipment. The 'equipment' categories are on the left side, and as you can see there are more than a few. CPU usage might be a problem. What would you suggest? Plug in mod or pre-done search link? I appreciate the help, do you guys take donations?
  4. Mike-N-Tosh Owner

    I modified the original to support this. This will show the listings from the given category and the FIRST level of subcategories under the given category.

    Use this the same way as the original, except it is called listings_subcats AND to use show the additional subcategory listings you must provide BOTH a category AND set sub="Y", like this:

    {listings_subcats limit=8 category=1 sub="Y" assign="mycatlistings"}

    Regarding donations, if you sincerely feel compelled to donate then you may do so at my blog online store

    Attached Files:

  5. jevanedwards New Member

    Thank a lost Mike, I really appreciate the help!
  6. jason1971 Customer

    Hi Mike,

    Another fantastic plugin ! which I want to use. My issue is I can get it to work :(

    One of my top level categories is Holiday Apartments = id=4 and im calling it like this

    {listings_subcats limit=8 category=4 sub="Y" assign="mycatlistings"} is this correct ?

    Cheers Jason
  7. Mike-N-Tosh Owner

    You also need it to not just get featured listings featured="N". The plugin itself is set to look only for featured listings unless it's set not too.
  8. jason1971 Customer

    Mike,

    Sorry too be a pain but I still cant get this plugin to work. I am calling it as above with the addition of featured="N", and it does not seem to matter what page I put it on or what top level category I call nothing seems to appear. any thoughts ?
    Cheers Jason
  9. Mike-N-Tosh Owner

    Jason,

    It does indeed work. I've tested it on two different installs. The only other thing that I can ask is are you putting anything into your template file to actually SHOW THE RESULTS? This works just like the original listings plugin as on the home page. You are assigning the results to a separate array variable. You have to actually display the data just like the original on the home page.

    So in this case you would need something like:
    Code:
    {foreach from=$mycatlistings item="list"}
    <div style="display:inline-block;width:112px;margin:10px 0 10px 5px;text-align:center;padding:2px;border:thin solid #CCC;float:left;">
          <div style="width:100px;height:100px;margin:0 auto;">
                    <a href="{$list.link}">
                          <img class="img-featured" src="{$list.image}" alt="{$list.title}">
                    </a>
            </div>
            <div style="width:110px;height:60px;margin:auto;text-align:center;">
                  <span style="font-size:16px;font-weight:bold;text-align:center;">{$list.price}</span><br />
                        <a href="{$list.link}">
                              {$list.title|truncate:30:" ...":false:true}
                        </a>
              </div>
    </div>
    {/foreach}
    
  10. jason1971 Customer

    Mike,

    I must be the biggest ~@*# going :) I totally forgot to add that works perfectly. PS: I wasn't doubting you or your astounding ability for a minute :D

    Jason
  11. Mike-N-Tosh Owner

    Glad you got it all sorted! :D

Share This Page