Getting Started With ExpressionEngine: Working with Categories

In this video, we will add a category group and categories to our blog, as well as display them in our blog template.

In this video, we will add a category group and categories to our blog, as well as display them in our blog template.

What We Do

  • Create a category group
  • Create categories
  • Assign a category group to channels
  • Show category loop in our most recent posts
  • Use the backspace parameter

Code Snippets

Adding Category Loop To Display Name

{!-- Categories --}
<p class="text-sm leading-5 font-medium text-indigo-600">
   {if has_categories}
      {categories backspace="2"}<a class="hover:underline" href="/blog/entry/{url_title}">{category_name}</a>, {/categories}
   {/if}
</p>
{!-- End categories --}

Links

  • ExpressionEngine ChannelEntries Loop: https://docs.expressionengine.com/latest/channels/entries.html
  • ExpressionEngine Categories Loop: https://docs.expressionengine.com/latest/channels/categories.html
  • ExpressionEngine Backspace Parameter: https://docs.expressionengine.com/latest/channels/categories.html#backspace
  • See all of the site build in action in the Learn EE git repository

Take It For A Test Drive

Get a free scan and start your trial today!

Additional Resources

Ready to dive in?
Start your free 15 day trial today.

Sign Up For Updates

We'll keep you in the loop of new features, resources, and articles!
We keep your info private.

© 2021 tripleNERDscore. All rights reserved.