Keyword

K2 Tools - Order by

  • Boskiz
  • Boskiz's Avatar Topic Author
  • Offline
  • New Member
More
4 years 8 months ago #175181 by Boskiz
K2 Tools - Order by was created by Boskiz
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.

More
4 years 8 months ago #175182 by JoomlaWorks
Replied by JoomlaWorks on topic K2 Tools - Order by
How would you like to order/sort the authors?

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

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

  • Boskiz
  • Boskiz's Avatar Topic Author
  • Offline
  • New Member
More
4 years 8 months ago #175188 by Boskiz
Replied by Boskiz on 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.

More
4 years 7 months ago #175202 by JoomlaWorks
Replied by JoomlaWorks on 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.

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