- Posts: 43
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- K2 Sub-Category Ordering in Frontend Select Category pulldown
K2 Sub-Category Ordering in Frontend Select Category pulldown
- Railer
- Topic Author
- Offline
- Senior Member
Less
More
4 years 2 months ago - 4 years 2 months ago #176949
by Railer
Replied by Railer on topic K2 Sub-Category Ordering in Frontend Select Category pulldown
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.
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.
Last edit: 4 years 2 months ago by Railer.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 2 months ago #176952
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic K2 Sub-Category Ordering in Frontend Select Category pulldown
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:...before $db2->setQuery($query2);
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');
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Railer
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 43
4 years 2 months ago - 4 years 2 months ago #176955
by Railer
Replied by Railer on topic K2 Sub-Category Ordering in Frontend Select Category pulldown
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: 4 years 2 months ago by Railer.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 2 months ago #176961
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic K2 Sub-Category Ordering in Frontend Select Category pulldown
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.
- Forum
- K2 Community Forum
- English K2 Community
- K2 Sub-Category Ordering in Frontend Select Category pulldown