We've set up a template to download an .xsl file of entries in a number of specific categories (with much help in this SE thread) - all works fine if we hardcode the category ID but if we tray to make the template dynamic by getting the category ID from the URL segment it fails (see below).

Is it possible to dynamically set the Category ID like this? Or any other way?

{exp:channel:entries channel="my channel" category="{segment_3}" disable="category_fields|member_data|pagination"
  • 1
    "It fails" how? Can you please, update your answer with more details?
    – Sobral
    Jan 21, 2015 at 22:51
  • Ah yes, if I hardcode it then it downloads the Excel file with all the correct data (minus cell borders - just un-bordered cells on a white background but that's ok) but if the Cat ID is taken via {segment_3} which is where the ID number is in the url, then it downloads the .xls file but it is blank containing no data.
    – segovius
    Jan 21, 2015 at 22:58
  • 1
    I think i found the issue. Please, help me a little more. Does the URL used on the hard coded category test have a segment_3? Or, for the test, it just has the segments 1 and 2?
    – Sobral
    Jan 22, 2015 at 1:45
  • It's just one segment it's using - the last one Segment_3 - I'm always passing the third segment for the test
    – segovius
    Jan 22, 2015 at 8:15

1 Answer 1


It should work fine. You're just missing a dynamic="no" on your channel:entries tag.

Try it like this:

    channel="my channel" 
  • That's the one! Great!
    – segovius
    Jan 22, 2015 at 17: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.