- Posts: 140
COMMUNITY FORUM
Next & Previous link order is all scrambled?
- Uzi
- Topic Author
- Offline
- Premium Member
I have a problem regarding the next and previous links that are below an item.
It's a weird thing, the next and previous links are not taking the article order into account? The next and previous links are all scrambled, it's not like the order it's on the front page. The order is all weird. How can I change this?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
The Next / Previous links are the next (and previous) items within the same category.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Uzi
- Topic Author
- Offline
- Premium Member
- Posts: 140
I have an article with ID 13594, the next and previous link give me the following article ID's: 13272 and 13263
These are not even remotely close to being the next or previous link. Is it possible it has something to do when you copy articles? That is the only thing I can make up as a possible reason.
It's supposed to be: 13595 and 13593
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Uzi
- Topic Author
- Offline
- Premium Member
- Posts: 140
Krikor wrote: Do these items belong to the same category?
Yes, these are articles in the same category.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
github.com/getk2/k2/blob/master/components/com_k2/models/item.php#L1847-L1854
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Uzi
- Topic Author
- Offline
- Premium Member
- Posts: 140
Krikor wrote: It will pull the next item from the same category if there is no ordering value. Otherwise it will respect the component's ordering.
github.com/getk2/k2/blob/master/components/com_k2/models/item.php#L1847-L1854
Hmm, it's still not working. I have a category which is sorted by publication date. Now the previous and next links are not working correctly, it looks like it's not using the publication date, but maybe the ID or something? I cannot find the sorting it's using now. It looks like it's all scrambled.
EDIT: Ok, I think I found something. Which is, if I get the articles to order by publish date I think it can work. I think the ordering of the articles for the next and previous links are not the same as how I configured the rest, namely by date.
EDIT 2: I found it. It uses the ordering of the items in the k2 items manager. Always. So there has to be a core hack for to fix it, and sort it by date.
Please Log in or Create an account to join the conversation.
- Uzi
- Topic Author
- Offline
- Premium Member
- Posts: 140
Yuzi wrote:
Krikor wrote: It will pull the next item from the same category if there is no ordering value. Otherwise it will respect the component's ordering.
github.com/getk2/k2/blob/master/components/com_k2/models/item.php#L1847-L1854
Where can I configure the ordering of the items? I cannot find it in the category itself...?
Found it! It's in the menu options.
Hmm, it's still not working. I have a category which is sorted by publication date. Now the previous and next links are not working correctly, it looks like it's not using the publication date, but maybe the ID or something? I cannot find the sorting it's using now. It looks like it's all scrambled.
EDIT: Ok, I think I found something. Which is, if I get the articles to order by publish date I think it can work. I think the ordering of the articles for the next and previous links are not the same as how I configured the rest, namely by date.
EDIT 2: I found it. It uses the ordering of the items in the k2 items manager. Always. So there has to be a core hack for to fix it, and sort it by date.
Ok I tried to change the item.php model to change the getPreviousItem method. But if I use the publish_up instead of ordering to sort, it's not working as intended.
Please Log in or Create an account to join the conversation.
- Uzi
- Topic Author
- Offline
- Premium Member
- Posts: 140
www.joomlaworks.net/forum/k2-en/45668-item-navigation-order-alphabetically
Cannot seem to make it work by hacking the core code..
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
- Posts: 15920
Ok I tried to change the item.php model to change the getPreviousItem method. But if I use the publish_up instead of ordering to sort, it's not working as intended.
Can you send me the code you used?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.