Keyword

Item Navigation Loop

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152155 by Joe Campbell
Item Navigation Loop was created by Joe Campbell
How can I modify the item override file to provide a previous and next for the first and last item in a category. (otherwise each would be none)

Here's the logic:


If first category item render last item as previous link

If last category item display first item as next link

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152164 by Krikor Boghossian
Replied by Krikor Boghossian on topic Item Navigation Loop
Basically you want to create an infinite loop, right?
That would mean, either hacking K2's model or using an extension.
If you only want to use overrides, then you have to manually query the db and display that item.

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152170 by Joe Campbell
Replied by Joe Campbell on topic Item Navigation Loop
Yes, an infinite loop.

I would prefer to not hack, but querying the DB would impact performance, right?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152181 by Krikor Boghossian
Replied by Krikor Boghossian on topic Item Navigation Loop
Not really, provided that you use caching of course.
Since a query would only be made when only two circumstances are met, chances are that the impact will be minimal.

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152189 by Joe Campbell
Replied by Joe Campbell on topic Item Navigation Loop
I am not using caching.

Can this be a feature added to K2v3 (Category > Item Navigation > Loop) ???

I think it makes sense for most instances - plus I believe would be beneficial from an SEO standpoint as well.

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

More
9 years 1 month ago #152194 by Javi Mata
Replied by Javi Mata on topic Item Navigation Loop
i dont know, but if that need is a carrousel of item can use a jquery plugin

if need display the items like a carrousel can use one like:
kenwheeler.github.io/slick/

Twitter: @Javi_Mata
Web: www.javimata.com

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152197 by Joe Campbell
Replied by Joe Campbell on topic Item Navigation Loop
Thanks for the link @JaviMata but I am looking to use the built in Item Navigation.

Perhaps this example will help illustrate my point:

This is the LAST item (NO Next item link): I want it to display a next (link to first item in category)
demo.nuevvo.com/sites/j3x/janaro/index.php?option=com_k2&view=item&id=31:2001-a-space-odyssey&Itemid=171

This is the FIRST item (NO Previous item link): I want it to display a previous (link to last item in category)
demo.nuevvo.com/sites/j3x/janaro/index.php?option=com_k2&view=item&id=13:dear-white-people&Itemid=171

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

More
9 years 1 month ago #152200 by Javi Mata
Replied by Javi Mata on topic Item Navigation Loop
oh, sorry, i don't understand what need do it :-(

Twitter: @Javi_Mata
Web: www.javimata.com

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152202 by Joe Campbell
Replied by Joe Campbell on topic Item Navigation Loop
@JaviMata can you provide demo links to your extensions? I would like to see how they work :)

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

More
9 years 1 month ago #152205 by Javi Mata
Replied by Javi Mata on topic Item Navigation Loop
in the next days will do it, and upload more modules :-)

Twitter: @Javi_Mata
Web: www.javimata.com

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152206 by Joe Campbell
Replied by Joe Campbell on topic Item Navigation Loop
Ok - Thanks - Send me a message via Twitter when you're ready

Have a GRRRRRREAT Weekend :)

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152284 by Joe Campbell
Replied by Joe Campbell on topic Item Navigation Loop
@Krikor can you olease provide (dare I say it) model hack solution :)

As I perviously stated, this feature would be an ideal feature for K2v3 (Category > Item Navigation > Loop)

It would help retain UI integrity and it makes sense for most instances.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152386 by Krikor Boghossian
Replied by Krikor Boghossian on topic Item Navigation Loop
It can be done in template override.
It does require some coding though. I will try to develop something in the coming days.

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152389 by Joe Campbell
Replied by Joe Campbell on topic Item Navigation Loop
Ok - Thanks - If it's easier top code and less of a performance impact, I will gladly take the model modification :)

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152550 by Joe Campbell
Replied by Joe Campbell on topic Item Navigation Loop
Hey K2ers - I still need help solving this - please provide code for the guy who loves Joomla/K2 but does not code :)

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
9 years 1 month ago #152563 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Item Navigation Loop
@Joe Have you submitted a feature request ? LOL

To me it seems a lot easier and cleaner if a function like getFirstItem and getLastItem is included in the model and view of K2, like the getNextItem and getPreviousItem function.

I like kittens, so don't hack the core :)

I also feel it's messy to do it inside template override, with all the query and urlencode. Maybe @Krikor is already writing a plugin for you :)

K2 Rocks \m/

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
9 years 1 month ago #152583 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Item Navigation Loop
After looking at the code, totally agree with @Kannan :)

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
9 years 1 month ago #152587 by Joe Campbell
Replied by Joe Campbell on topic Item Navigation Loop
I just submitted a formal feature request:
github.com/getk2/k2-v3-dev-build/issues/295

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #152645 by Krikor Boghossian
Replied by Krikor Boghossian on topic Item Navigation Loop
Thanks Joe.
Happy Easter :)

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
9 years 1 month ago #152949 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Item Navigation Loop
In case you don't mind to hack core K2, here is how to implement it:
Easy hack to provide navigation loop for K2 items

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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


Powered by Kunena Forum