Keyword

Order of featured items

  • Rene Kreijveld
  • Rene Kreijveld's Avatar Topic Author
  • Offline
  • New Member
More
14 years 5 months ago #81775 by Rene Kreijveld
Order of featured items was created by Rene Kreijveld
Hi all,I have a category with items where some are featured.Now, I'd like the ordering to be that the featured items are shown first, and then the rest of the items (non-featured).Can this be done with the default category settings or do I need a template override for this?Thanks,Rene

Please Log in or Create an account to join the conversation.

  • Rene Kreijveld
  • Rene Kreijveld's Avatar Topic Author
  • Offline
  • New Member
More
14 years 5 months ago #81776 by Rene Kreijveld
Replied by Rene Kreijveld on topic Order of featured items
I managed to create this list through a template override. Basically I loop over this list of items to show twice.
The first time I only whow the featured items and the second time only the non-featured items. But there should be an easier way to do this.
Any suggestions?

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #81777 by No Name
Replied by No Name on topic Order of featured items
I think that best solution for this is to use one of offered orderings and just change sql code in model to order it as you want. For example, I used Random ordering (since I'm not going to need it at all) and changed file components/com_k2/models/itemlist.php. This is how it should look like:

case 'rand':
$orderby = 'i.featured DESC';
break;

It works for me and I hope it will work for you too.

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #81778 by Kibekas
Replied by Kibekas on topic Order of featured items
Can it be done also in a way that featured are first, and then the rest are sorted by date?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum