1

I have an index page showing channel entries and also working as the category view.

I want to link to a single entry from either of the above states and then be able to paginate to the next / previous entry within context.

E.g. there are 400 entries. On the main index they show in groups of 20. A category view might show a subset of 70 entries, category 'foo'. I know how to paginate either of these index views. The URLs looks like:

/archive/P40 or

/archive/category/foo/P20

If I want to view a single entry in each state (and paginate) the URL's look like:

/archive/single/P40 or

/archive/single/category/foo/P20

What I can't figure out is how to code the links from the index page to the single entry versions.

Hope that makes sense. Can anyone help? Cheers

2
  • Can you post some example code. Most likely you will need conditionals to display the correct content or use a addon like Template Routes
    – Siebird
    Nov 6, 2013 at 14:54
  • I'd rather not create code as it'd take ages and it is really straight forward. Normal channel archive page doubling up as the channel view, 'you are viewing pages from the FOO channel' for example. Linking to the single view, comments page is straight forward, yes? And the URL might look like archive/page/name_of_entry What I want, instead, is to link to the single view where the URL might be either: /archive/single/P40 or /archive/single/category/foo/P20 Which I can then paginate (optionally through the category results passed from the parent archive page). Nov 6, 2013 at 19:33

2 Answers 2

1

I'm not following 100% but I think you just need:

{title_permalink="archive/single"}

This will get you a URL like:

/archive/single/article-name-here-using-url-title
1

Untested answer here, but just a suggestion.

You want to be able to show a single entry url but also have a paginated listing on the same page?

Maybe from the initial listing, say /archive/P40, you could create links using {title_permalink='archive/single'}/{segment_2} or /archive/single/{url_title}/{segment_2}.

or links on /archive/category/foo/P40 you'd do {title_permalink='archive/single'}/category/{segment_3}/{segment_4} or /archive/single/{url_title}/category/{segment_3}/{segment_4}.

Then on your single entry article you'd use

{exp:channel:entries url_title="{segment_3}" dynamic="no" ...}

and for your listing - to be honest I don't know if it'll pick it up automagically from the url - but you could use Low Seg2Cat to help out.

{exp:channel:entries category="{segment_4_category_id}"}

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.