Keyword

K2 Tools - Order by

  • Boskiz
  • Boskiz's Avatar Topic Author
  • Offline
  • New Member
More
2 weeks 3 days ago #175181 by Boskiz
Boskiz created the topic: K2 Tools - Order by
Hi Fotis,
I have on my website a K2 Tools module / Authors List Settings.
If you go to my site www.mattatoio5.com/ on the right, you may vie thw authors list. Is it possible to set an order?
Thnaks!
Max

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 2 days ago #175182 by Fotis
Fotis replied the topic: K2 Tools - Order by
How would you like to order/sort the authors?

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Boskiz
  • Boskiz's Avatar Topic Author
  • Offline
  • New Member
More
2 weeks 2 days ago #175188 by Boskiz
Boskiz replied the topic: K2 Tools - Order by
Yes, for example sort by name or items publised.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
1 week 4 days ago #175202 by Fotis
Fotis replied the topic: K2 Tools - Order by
First read this getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates to create your own override for that module in your Joomla template's html/ folder.

Then to sort by an author property (e.g. name or number of items), you need to usort() the $authors array in the authors.php override of the K2 Tools module. Example on how to sort a PHP array by one of its properties: stackoverflow.com/questions/3701855/how-do-i-sort-a-php-array-by-an-element-nested-inside

In your case, it's an array of objects.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum