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 description and image missing

How Do I?

ckubs's avatar
ckubs
5 posts
4 years ago
ckubs's avatar ckubs

Coming from something like Wordpress I see Expression Engine is a lot different when it comes to templates.

When I edit a category I see 2 fields for category description and category Image. I edit them but they are nowhere to be seen on the frontend. Adding {category_image} and {category_description} to the appropiate template I get the code on the frontend, not the image and the description. If I put it like that {if category_description}{category_description}{/if} I get nothing on the frontend.

I’m not a developer and I may be doing it wrong. If someone could give me a little help to see how things work I’m thankfull for that.

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

It is definitely a big shift, but once you get the logic, it gets easier.

First issue- do you want to view the category info for the page/URL or the entry?

If it’s for the url (mysite.com/index.php/template_group/template/category/cats) you use this tag:

{exp:channel:category_heading channel="pets"}
    <h1>{category_name}</h1>
    {if category_description}
        {category_description}
    {/if}
{/exp:channel:category_heading}

The tag is going to ‘see’ that ‘category’ indicator in the url and know the next segment ‘cats’ is a category url title- so it will go find that category and output the data.

Now- say you’re showing a bunch of blog entries using the channel entries tag and you want to show all of the categories each of those entries are in- and make them links, so they can go to your category page and just see entries in the shared category. You’ll use the categories variable pair

{exp:channel:entries channel="news" limit="10"}
    <h2>{title}</h2>
    {body}

{categories backspace="5"}
    <a href="http://{path=template_group/template/}">{category_name}</a>, 
{/categories}

{/exp:channel:entries}

Skim the docs on url structure: https://docs.expressionengine.com/latest/general/url-structure.html that and the 10 minute tutorial will help a lot.

And if you have questions, just ask.

       
ckubs's avatar
ckubs
5 posts
4 years ago
ckubs's avatar ckubs

For the URL. Thank you for the detailed answer 😊

šŸ‘ 1
       

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.