Featured listings by category

I’m writing this article, because of the number of times that this seems to have come up in the 68 Classifieds support forums. Obviously, it is a feature that many seem to want and I believe it certainly brings up some interesting uses.

I have modified the original Smarty plugin supplied by 68 Classifieds called, “function.featured_listings_horizontal.php”

You can download my modified file for your use here.

I have submitted this to 68 Classifieds to be included in the next official release which should be V4.1.2. In the meantime, feel free to use my file now if you can’t wait. :)

To use this plugin, you will need to upload this to your server. In V4.1.x this would be placed here “yoursite.com/plugins” For version 4.0.x this would be “yoursite.com/includes/classes/smarty/plugins”
(*NOTE: I highly recommend that you keep a copy of your original file before over writing it with my modified file. I suggest that you either keep the original on your local computer or better yet rename the original file on the server. My suggestion would be call it something like this: “function.featured_listings_horizontal.original.php”)

To use the new functionality of getting listings by the category, you need to know the ID# of the category that you would like to retrieve. You can find out your category IDs by logging into your admin and clicking on the “Categories” link and then the “Manage Categories” sublink. You will then see your list of categories. The category ID is the number to the left of the category name.

In the template file that you wish to list your categories you need to call the smarty function like this:
{function.featured_listings_horizontal.php cat=X}
Replace X with the category ID of your choosing. Also remember that this additional parameter is an addition, so all of the other parameters can still be used.

I hope that you find this useful. Enjoy :)

If you do find this useful and you find my blog useful, why not consider donating to help support this blog. You can donate by using the link on the right hand side menu. Thanks for your consideration! Always appreciated.

2 Responses to “Featured listings by category”

  1. Jérôme Says:

    Hello,

    I just red your text above and I tried to do the changes but I am afraid to be a bit lost!! You write:

    In the template file that you wish to list your categories (Can you tell me what template file for exemple as I use the default version in v4.1.2, thank you) you need to call the smarty function like this:

    {function.featured_listings_horizontal.php cat=X} Could you tell me where I have to put this code in the right template file, thank you.

    Replace X with the category ID of your choosing.

    (does that mean that we just can see one category?)

    Also remember that this additional parameter is an addition, so all of the other parameters can still be used (Can you explain a little bit more, sorry i am a bit new in php and smarty code, thank you)

    Regards

    Jérôme

  2. Mike-N-Tosh Says:

    Hi Jérôme,

    You can place this smarty plugin in any template file that you wish to. In your default template folder, any file that has a suffix, “.tpl” is a template file. This plugin is already in use in the “home.tpl” file. Open that to see how it is used there.

    When specifying the category ID as was the purpose of this mod, then yes, it does limit this to one category. This is the reason for this modification as before it would pull listings from all categories. The main reason people wanted this was to add this specifically to category page, therefore showing only listings within that ONE category.

    For the additional parameters, please visit the official 68 Classifieds documentation as it explains all of the parameters and how to use them. Bear in mind that this article was written specifically for an additional parameter modification. Therefore it is assumed that you are familiar with the use of the plugin and the parameters. Here’s a link to the documentation for this plugin on 68 Classifieds website: 68Classifieds.com/documentation.