1

In an efford to restrict page results to categories (that I pass in the URL from a link on another page) I came up with the following URL structure.

    my_site.com/index.php/template_group/category/category_url/

This tag code on the index page of this template_group:

    {exp:channel:entries channel="my_channel" limit="5" dynamic="off" category="{segment_2}" pagination="bottom" paginate_base="template_group/{segment_2}/{segment_3}/"}

This works, but the pagination fails.

I do get the correct pagination numbers at the end of my URL, but the tag does not listen anymore to the URL.

I tried very hard to get around this, but failed.

I do hope someone can shine a light here. Many thanks.

2
  • Why {segment_2}? Isn't the category the {segment_3}?
    – Sobral
    Oct 4, 2013 at 18:00
  • 1
    Also even though {segment_3} is the category this still won't work because the channel:entries tag expects the category ID not short_name: ellislab.com/expressionengine/user-guide/modules/channel/… Basically your thinking looks correct. After segment 2 & 3 EE doesn't care where the pagination segment is it will parse it (EE uses regex to find P0, P5, PX etc). Just beware of duplicated content, but a canonical url can get around that. Oct 4, 2013 at 18:41

1 Answer 1

1

I think you're doing more work than you need to here. Are you familiar with the Use Category URL Titles In Links? and Category URL Indicator preferences?

These preferences will let you do exactly what you want, but dynamically (so, no need for dynamic="off" category="{segment_2}").

3
  • Thank you, Derek, I have figured that out now using Category URL Titles In Links. (How can I set this question as solved?)
    – Hansl
    Oct 5, 2013 at 12:50
  • Glad to help - just click the checkmark icon next to my answer to mark it as accepted. Oct 5, 2013 at 12:57
  • done (I am new to this as you probably noticed :-)
    – Hansl
    Oct 6, 2013 at 20:46

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.