Keyword

Featured articles ordering from different categories

  • Gianluca
  • Gianluca's Avatar Topic Author
  • Offline
  • Junior Member
More
3 years 11 months ago #177684 by Gianluca
Hello, i have a category with several subcategories. I've set to show "featured first" so in the main category all the featured articles from the various subcategories are shown first, and that's ok.
The problem is that i cannot order those featured articles list.
If, in the backend, i set a filter to show "featured only" i have the possibility to order them (drop up and down even if in different categories), but any order i give it's ignored in fronted.
Is there a way to set the featured first order in frontend to follow articles order of backend? (as i have featured articles more important than other featured articles).
Thanks!

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

More
3 years 10 months ago #177743 by JoomlaWorks
This is really an edge case.

To achieve what you want you can modify the itemlist model (in /components/com_k2/models/itemlist.php) around line 297 from this:
            case 'featured':
                $orderby = 'i.featured DESC, i.created DESC';
                break;

to this:
            case 'featured':
                $orderby = 'i.featured_ordering, i.created DESC';
                break;

Note down the change to re-apply it after upgrading in the future.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
3 years 10 months ago #177744 by JoomlaWorks
I'll see if I can add this as an extra ordering option in an upcoming K2 release.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Gianluca
  • Gianluca's Avatar Topic Author
  • Offline
  • Junior Member
More
3 years 10 months ago - 3 years 10 months ago #177772 by Gianluca
Great! Thank you for both of your answers

Fotis wrote: I'll see if I can add this as an extra ordering option in an upcoming K2 release.


I think this would be a great option. I think ordering the featured is vital in a content website (in example: an online newspaper. There are always more important news, and if you have 2/3 important news is vital to orer them from the most important to the less).
Last edit: 3 years 10 months ago by Gianluca.

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

More
3 years 10 months ago #177775 by JoomlaWorks
To be honest, some times it makes more sense to use a combination of a module and a component view. So you get the featured ones in the module, with whatever ordering you like and then everything else follows below in the component view (where you can easily filter out the featured items, so you don't get duplicate content).

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Gianluca
  • Gianluca's Avatar Topic Author
  • Offline
  • Junior Member
More
3 years 10 months ago #177779 by Gianluca
I was thinking about this solution, the problem is that then i have problems with pagination (if there are a lot of featured articles they are not paginated), and if i just use the pagination for the "normal" list, the module will show up in every pages of the list

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

More
3 years 10 months ago #177782 by JoomlaWorks
If there are lots of featured items, then you need a different view - that's for sure.

"...if i just use the pagination for the "normal" list, the module will show up in every pages of the list..."
Well, isn't that the point of "featuring" something?

Again, it's all a matter of preference.

That was my 2 cents on the matter.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Gianluca
  • Gianluca's Avatar Topic Author
  • Offline
  • Junior Member
More
3 years 10 months ago #177794 by Gianluca
It depends... if someone see 3 articles and click on "next" page i assume he's not interested to those 3 articles and want to see more... anyway i see your point of view. For my case your hack is perfect. Thanks again

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

More
3 years 10 months ago #177803 by JoomlaWorks
You're welcome.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum