0

Does anyone have a neat solution to using pagination URLs? I would like to set up a simple structure like articles/article-entry with the listing and entry in one template. But once I include pagination in the listing I always end up putting the article-entry into a new template to avoid clashing with the pagination URL (ie articles/P2 etc). I then have articles/entries/article-entry or something equally as clunky.

I could use paginate_base to create a different URL for the paginated pages. But then I have duplicate templates for the listing. Is there any other way?

1 Answer 1

0

Switchee should be able to help you out there:

{exp:switchee variable="{segment_2}" parse="inward"}

  {case value=""}
    No value = landing page
  {/case}

  {case default="yes"}
    Default = anything which isn't landing or pagination (below).
  {/case}

  {case value="#^P(\d+)$#|''"}
    This is for paginated pages.
  {/case}

{/exp:switchee}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.