We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Page template empty despite category having content set to it

How Do I?

Andy @ Pillory Barn's avatar
Andy @ Pillory Barn
130 posts
8 years ago
Andy @ Pillory Barn's avatar Andy @ Pillory Barn

Hi all,

I’m creating a template that loads FAQ’s based on the category that is in segment_2. I am using seg2cat in order to get the ID of this and then using that in my loop, shown below:

{exp:channel:entries channel="faqs" dynamic="yes" category_id="{segment_2_category_id}”}

The URI is domain.com/faqs which loads all the FAQs in the system, this works.

Otherwise, domain.com/faqs/renewables would use the ‘renewables’, find the ID (which it does) however it doesn’t load any content associated within that category at all.

Can anyone help me shed some light on what on earth is going on? haha

Andy

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

So in this case the route would be /faqs/{category:alpha_dash} correct?

Any chance your entries have custom statuses? If so it’s a good idea to add a status=”not closed” to the tag.

       
Andy @ Pillory Barn's avatar
Andy @ Pillory Barn
130 posts
8 years ago
Andy @ Pillory Barn's avatar Andy @ Pillory Barn

No custom statuses on the channel. Put the route in, made the tag dynamic=”no” and now no matter what the URI is it loads ALL the FAQs, not the ones specific to this category

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

I thought it didn’t show any. It’s not working because the parameter is category and not category_id.

{exp:channel:entries channel="faqs" dynamic="yes" category="{segment_2_category_id}”}
       
Andy @ Pillory Barn's avatar
Andy @ Pillory Barn
130 posts
8 years ago
Andy @ Pillory Barn's avatar Andy @ Pillory Barn

It still doesn’t show any FAQs in the category when there is at least one already ticked to show.

When we do the custom route and turn dynamic off, it shows every FAQ on every category, which isn’t right

Andy

       
Andy @ Pillory Barn's avatar
Andy @ Pillory Barn
130 posts
8 years ago
Andy @ Pillory Barn's avatar Andy @ Pillory Barn

Fixed it! There was a typo. Thank you 😊

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.