ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

random ordering + pagination

August 16, 2012 7:16am

Subscribe [2]
  • #1 / Aug 16, 2012 7:16am

    j0han

    20 posts

    Hi,
    is there a way to use pagination for random entries? if I just use orderby=“random” i get repeating entries.

    Thanks!

  • #2 / Aug 17, 2012 1:09pm

    Shane Eckert

    7174 posts

    Hello j0han,

    Thank you for posting your question here on the ExpressionEngine forums.

    Can you show me your template code?

    Cheers,

  • #3 / Aug 17, 2012 3:40pm

    j0han

    20 posts

    Hi Shane,

    this is what I’m using:

    {exp:channel:entries channel="shops|ads" limit="20" disable="categories|member_data|trackbacks|category_fields" orderby="random" paginate="top"}
      
      <h3><a href="/index.php/shops/shop/{url_title}">{title}</a></h3><p>  <br />
     <br />
        {paginate}<br />
            <div id="pagination"><br />
            {pagination_links}<br />
            </div><br />
        {/paginate}<br />
     {/exp:channel:entries}

  • #4 / Aug 20, 2012 12:24pm

    Lisa Wess

    20502 posts

    Hi, j0han,

    This is true that pagination will not hold in memory what random entries it has shown, so you may get repeats.  There is an existing feature request for a change to this behavior that you could add your voice to.

    Unfortunately I do not have a solution for you now - a custom plugin might achieve your goals though.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases