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.

Using index template for single entry view, pagination problems

July 01, 2011 12:05am

Subscribe [2]
  • #1 / Jul 01, 2011 12:05am

    Tony Geer

    253 posts

    Hi There,

    I’m trying to be a bit clever and use only the index template to display a list of entries when segment 2 is blank, and then a single entry when a url_title is passed to segment 2. So a shortened version of my code looks like:

    {if segment_2==""}
         [display list of entries]
    {if:elseif}
         [display single entry]
    {/if}

    This works all well and good, but it obviously breaks pagination. I like having URLs like:

    domain.com/template_group/entry_url_title

    As I find them much cleaner than having another template to create a URL like:

    domain.com/template_group/view/entry_url_title

    Has anyone tried doing it this way and got past the pagination problem?

  • #2 / Jul 01, 2011 12:14am

    Trevor Davis

    39 posts

    Try checking out Switchee

  • #3 / Jul 01, 2011 12:16am

    Tony Geer

    253 posts

    Thanks, this will do the trick. I had read about Switchee then completely forgot about it after! Thanks again.

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

ExpressionEngine News!

#eecms, #events, #releases