Hi
I am trying to figure out why, when I click on single items on the index page it does not display any items on the products.
Index Page:
{exp:channel:categories channel="outdoor" style="linear" id=""} {category_name} {/exp:channel:categories}
Products Page
{exp:channel:categories channel="outdoor" require_entry="yes"} {Description} {/exp:channel:categories}
Thank you
I think you may be using the wrong tag for that products page. You may want a channel entries tag instead of that channel categories tag.
That help? If not, what’s the URL look like for the products page that isn’t working?
Let’s back up and make sure I understand what we’re going for.
On the index page, that category tag should show a list of categories as links. It should take you to presumably the products page with urls like mysite.com/products/category/electronics where ‘electronics’ is the url title of the category you clicked on.
You want to then show all entries in the ‘electronics’ category- which is what putting a channel entries tag on the page would do. In a channel entries tag, for every entry you show, you can show the categories it’s in using the categories variable pair.
If you want to show a header with the category name and description in it, you would do that separately using the category heading tag.
But as a good rule of thumb, you don’t want to nest tags inside each other. Things can get confused.
Hi,
Can someone point me somewhere I can get good examples on how to use categories. I am trying to follow the blog example when you install ee demo. But it’s to confusing when I am still learning ee.
I am able to display the categories I can see the links from the category but when I want to see the full details of the one item I can’t see nothing, no title or images.
Please help me.
It might help to read over the documentation on URL structure: https://docs.expressionengine.com/latest/general/url-structure.html
To sort of ‘see it in action’, make a blank template called test in the site template group. Put this on it:
<a href="http://{path=">ALL</a>
{exp:channel:categories channel="blog"}
<a href="http://{path=site/test}">{category_name}</a>
{/exp:channel:categories}
<hr>
{exp:channel:entries channel="blog" limit="10"}
<h3><a href="http://{url_title_path=">{title}</a></h3>
{categories backspace="2"}{category_name}, {/categories}
{/exp:channel:entries}
{exp:channel:entries channel="blog" limit="10"}
<h3>{title}</h3>
{categories backspace="2"}<a href="http://{path=site/test}">{category_name}</a>, {/categories}
{blog_content}
{/exp:channel:entries}
Assuming you’ve got a default template install, that will get you a full listing, a category filter, and a detail page.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.