2

I am developing a slideshow extension for Joomla 3.x. The extension consist of a component in which you can create categories and create slides. When creating slides, you assign each one to a category. The component uses Joomla's core com_categories component in order to create the categories. The component also utilises Joomla's MVC structure (I've tried to keep things as close to core as possible).

The next part of the extension is a module. The module displays the slides from a specific category (or it should).

Everything is fully built and working apart from one feature: The module currently displays all slides regardless of category. When editing the module in Joomla I can select the category I want but I don't know how to get the module to show just the slides from that category.

You can download the module at: Slideshow Module

1
  • 1
    Can you please provide the code you're using to get the slides from a specific category rather than a download alink to your module?
    – Lodder
    May 29, 2014 at 9:18

1 Answer 1

2

Try this,

On your helper file your getList() don't checking the category you have to add the category condition there.

something like below.

    $query->select('catid, id, title, image, select_link, link, menuitem, caption');
    $query->from('#__bdslides');
    $query->where('state=1 AND category = ' . $db->q($params->get('category')));
    $query->order('ordering');
    $db->setQuery($query);

But make sure your category returns only one ID if it is multiple with array you have to use IN() in the query.

for an example Joomla banner module you can download.

2
  • That's amazing, Thank you! So Simple! I did make one slight change to $query->where('state=1 AND catid ='.$params->get('category')); May 29, 2014 at 9:27
  • 2
    Dont forget to escape the values
    – Lodder
    May 29, 2014 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.