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

Category Entires not showing

How Do I?

JasonG's avatar
JasonG
3 posts
9 years ago
JasonG's avatar JasonG

Hi,

I’ve followed a tutorial at this page - http://www.train-ee.com/courseware/free-tutorials/comments/working-with-categories

I have the below code in place:

{exp:channel:categories channel="articles"}
        <a href="http://{path=how-to-guides/index}">{category_name}</a>
    {/exp:channel:categories}

When you click a category e.g. Email or Web Hosting you should be taken to that category page and the page should display the entries. e.g. Email page would show Outlook, macmail etc

However when I click the category link the URL looks correct /how-to-guides/category/email-panel but the page shows all categories and it’s entries.

How can I get the link to only show the entries for that particular category?

New to EE so not sure what I’m missing?

       
Mighty Citizen's avatar
Mighty Citizen
21 posts
9 years ago
Mighty Citizen's avatar Mighty Citizen

Hi Jason,

What does the /how-to-guides/index template look like? Could you include the code here? Make sure you don’t have dynamic=”no” as a parameter in the channel entries tag (https://docs.expressionengine.com/latest/channel/channel_entries.html#dynamic).

You should also check your category trigger word to make sure EE is looking for “category” in the URL to trigger the dynamic response for the appropriate categories. In EE3 that setting is under the “URL and Path Settings” and is called “Category URL Segment”.

If that is set to “category” and you have a channel entries tag on the /how-to-guides/index template that does not contain the dynamic=”no” parameter the channel entries should be automatically filtered by the category url title that appears in the 3rd URL segment in your example.

       
JasonG's avatar
JasonG
3 posts
9 years ago
JasonG's avatar JasonG

Hey,

Thanks for replying.

I’m using EEv2, I have checked the ‘category trigger word’ and it’s set to category. I don’t have dynamic=”no” entered in the code.

I’m probably going about this all wrong but at the moment I’m just trying to get the categories to show their listings. So I have a template default/test2, in that template I have only the below code:

{exp:channel:categories channel="articles"}
        <a href="http://{path=how-to-guides/index}">{category_name}</a>
    {/exp:channel:categories}

When I view the template in my browser, it shows all the categories as links, which is good but clicking any links e.g. Web hosting, results in a page showing the same-thing, a list of clickable categories.

The url changes to domainname.com/how-to-guides/category/web-hosting

I know this is probably simple to do but I’m stumped….

       
Stephen T's avatar
Stephen T
127 posts
9 years ago
Stephen T's avatar Stephen T

Hi Jason,

It sounds like the missing piece is that you have links that are pointing to /how-to-guide, but you don’t have a template at how-to-guide/index, so it doesn’t know what it should show for that URL.

Create an index template in the how-to-guides template group, and on that template, add a standard channel entries tags like so:

{exp:channel:entries channel="articles"}
     {title}<br>
{/exp:channel:entries

Then, when you click on the links that are generated by the exp:channel:categories tag on the default/test2 template it will go the how-to-guides/index template and display the titles of the channel entries, filtered by the category url title that is being added to that link automatically by the channel categories tag. Once you have it showing you the correct channel entries you can modify the code on the how-to-guide/index template to display those entries however you choose.

       
JasonG's avatar
JasonG
3 posts
9 years ago
JasonG's avatar JasonG

Thank you both, I now have this working correctly. You were right, it was the template holding me up.

       

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.