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.
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.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.