Client side pagination

Plugin Development
  • I was hoping that you guys might be able to point me in the right direction for handling custom pagination logic within a theme. I need to be able to define scroll up/scroll down events handlers so I can append or remove cards from the viewport based on direction of scrolling. I also want to disable pagination for certain categories regardless of user settings as these categories will only display topics as cards.

    Cheers

  • I was able to use Categories.setCategoryField to tag the categories that are customized with topic cards and then use that attribute in the templates.


Suggested Topics


  • 0 Votes
    2 Posts
    285 Views

    Hooks that are fired on the server side are only available for use for plugins in their server side code. Same for client side hooks they are only available for use in the client side code of plugins.

  • 0 Votes
    3 Posts
    238 Views

    @baris That's it! Thanks a lot.

  • 0 Votes
    1 Posts
    809 Views

    Good morning.

    First of all, I'm not a developer, and I'm sorry for every noob question that comes up here.

    Right now I'm playing around with the plugin/widget development. My goal is to have a widget which includes a search bar and a result div. Every change in the search input field fires a jquery request against a foreign api. Result is a big json object, containing an array of objects (example fields: image, name, uuid, type).

    I was able to put the plain results into the div. Now I want to process these results (splitting them up by type) and render them into beautiful partials.

    For your imagination:
    <search box>
    <box for type A with a list of entries> <box for type B with a list of entries>...

    Can anyone please give me a headstart?

    Thanks in advance.

  • 0 Votes
    2 Posts
    1k Views

    When you are on the category page you can access the topics with ajaxify.data.topics and on the topic page its ajaxify.data.posts.

    There are also hooks fired whenever new topics/posts are added. They are $(window).trigger('action:topics.loaded', { topics: ajaxify.data.topics }); and $(window).trigger('action:posts.loaded', { posts: data.posts });

  • 0 Votes
    3 Posts
    2k Views

    @yariplus Thanks!