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.

View All Entries Button

November 21, 2011 3:40am

Subscribe [2]
  • #1 / Nov 21, 2011 3:40am

    Hi.

    I am looking to find a way to have a ‘View All’ button on my channel entries page.

    I am using the limit parameter to limit the number of entries displayed per page.

    What I want is to have a button with the pagination that allows the user to just show all of the entries in one page, if they prefer to not use the pagination.

    How would I go about this?

    Thanks

  • #2 / Nov 22, 2011 4:58am

    John Henry Donovan

    12339 posts

    Hi Chris,

    You could use a conditional in your template and roll your own URL

    So for the link you would use this

    <a href="http://{path=articles/index}/all">View all Articles</a>

    Then in your template you would use conditionals like this

    {if segment_3 == "all"}
    {exp:channel:entries channel="articles" pagination="bottom" limit="500"}
    ...
    {/exp:channel:entries}
    
    {if:else}
    {exp:channel:entries channel="articles" pagination="bottom" limit="10"}
    ...
    {/exp:channel:entries}
    {/if}

    Moving to Community Help as more appropriate there.

    Let us know if that works for you as a solution

    There are also dynamic parameters to investigate

  • #3 / Nov 22, 2011 5:35am

    Perfect, thanks John!

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

ExpressionEngine News!

#eecms, #events, #releases