Keyword

K2 Sub-Category Ordering in Frontend Select Category pulldown

  • Railer
  • Railer's Avatar Topic Author
  • Offline
  • Senior Member
More
1 week 3 days ago - 1 week 3 days ago #176949 by Railer
HI Fotis,

Yes, the root category used for the data source is ordered the way we want it. However, there are template overrides in the template.
I'm not sure which files to grab for you, but I grabbed the beginning of the category.php override which contains an ordering switch and have uploaded the screenshot. I'm not sure which would be the correct syntax to use if I changed it, but I do note the following in the default:

$orderby = 'i.id DESC';

Would that be the cause?
Further down in the file, I see a div for what looks like a category filter pulldown... which is the second screenshot attachment.
Attachments:
Last edit: 1 week 3 days ago by Railer.

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 week 2 days ago #176952 by Fotis
The drop-down was embedded in the category layout, so there's no module used.

The code at the top does not relate to the one in the bottom, which is apparently the drop-down. You need to sort the SQL query by ordering. So prepend:
$query2->order('ordering');
...before $db2->setQuery($query2);

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.

  • Railer
  • Railer's Avatar Topic Author
  • Offline
  • Senior Member
More
1 week 2 days ago - 1 week 2 days ago #176955 by Railer
Hey Fotis! Thanks so much, yes, I had a hunch that the override was the problem. I added your query code at line 144 and it worked! Thanks for sticking with me. Much appreciated!
Last edit: 1 week 2 days ago by Railer.

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 week 1 day ago #176961 by Fotis
You're welcome.

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