Keyword

K2 - AJAX Pagination - load more items

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
4 months 2 weeks ago #171018 by Fotis
Fotis replied the topic: K2 - AJAX Pagination - load more items
That is correct, given you only show the "leading" items block.


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.

More
4 months 2 weeks ago #171049 by Dimitris
Dimitris replied the topic: K2 - AJAX Pagination - load more items
ok I got it to work!
I think my mistake was that I had placed the "load more" button outside the k2 wrapper.
I still had to replace $ with jQuery because I was getting an TypeError: $ is undefined - the same happened with beez3 template

Thank you

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
4 months 2 weeks ago #171061 by Fotis
Fotis replied the topic: K2 - AJAX Pagination - load more items
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.

More
4 months 2 weeks ago - 4 months 2 weeks ago #171075 by Dimitris
Dimitris replied the topic: K2 - AJAX Pagination - load more items
Even though it works I've noticed something, that it might not cause any issues in the default templates, it does though cause issues with mine.


The structure is:
#itemListLeading
  .itemContainer
  .itemContainer
  .itemContainer

The way I understand append, the extra items should be loaded under the last itemContainer

Instead the script creates this:
#itemListLeading
  .itemContainer
  .itemContainer
  .itemContainer
  #itemListLeading
    .itemContainer
    .itemContainer
    .itemContainer

why is it duplicating the content div? Having two divs with the same id is not exactly correct either.

obviously I don't have a clue what I'm talking about, but it might have to do with this line?
var items = $(data).find('#' + newsContainer);
Last edit: 4 months 2 weeks ago by Dimitris.

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

More
4 months 2 weeks ago #171089 by Dimitris
Dimitris replied the topic: K2 - AJAX Pagination - load more items
well I did manage to get the results I wanted by changing
var items = $(data).find('#' + newsContainer);

to
var items = $(data).find(".itemContainer");

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
4 months 1 week ago #171113 by Fotis
Fotis replied the topic: K2 - AJAX Pagination - load more items
The example originally provided is a bit messy. I'll create a more modern equivalent using the default layouts and paste it back here in the coming days.


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.

More
3 months 2 weeks ago #171381 by bonzomedia
bonzomedia replied the topic: K2 - AJAX Pagination - load more items
This was what I was looking for. However, this method obviously does not trigger K2's onK2AfterDisplayContent which is what my plug-in needs in order to trigger. Any way to trigger this client side in the JS?

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 months 2 weeks ago #171384 by Fotis
Fotis replied the topic: K2 - AJAX Pagination - load more items
The plugin event is inside category_item.php which means it is triggered as the items are already in the container. If it's not triggered, perhaps you have disabled K2 plugin parsing in the category settings (or even specific K2 items). And of course make sure the plugin event is present in category_item.php. Compare with the source template files when in doubt.


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.

Moderators: william white

Powered by Kunena Forum