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

URL item are not displaying on page.

How Do I?

Jason Stringer's avatar
Jason Stringer
19 posts
5 years ago
Jason Stringer's avatar Jason Stringer

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

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

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?

       
Jason Stringer's avatar
Jason Stringer
19 posts
5 years ago
Jason Stringer's avatar Jason Stringer

Thank you Robin. So I can call category within a channel?

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

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.

       
Jason Stringer's avatar
Jason Stringer
19 posts
5 years ago
Jason Stringer's avatar Jason Stringer

Yessssss, actually what I am trying to do. But seem not to work for me. I am sure it something stupid I am missing.

       
Jason Stringer's avatar
Jason Stringer
19 posts
5 years ago
Jason Stringer's avatar Jason Stringer

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.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

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}
Now- go make a template called test_detail in the site template group. Put this on it:
{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.

       
Jason Stringer's avatar
Jason Stringer
19 posts
5 years ago
Jason Stringer's avatar Jason Stringer

Thank you Robin for the information it was useful.

       

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.