ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Can I retrieve the category name inside of the entries tag?

January 12, 2010 7:34pm

Subscribe [2]
  • #1 / Jan 12, 2010 7:34pm

    jdgraffam

    11 posts

    The parts in ALL CAPS are what I want to do. Does anyone know how I would go about getting this done?

    {exp:weblog/channel:entries weblog/channel="foo" orderby="date" sort="desc" limit="99"}
      <h3>
        <a href="http://{title_permalink=">{title}</a>
      </h3>
    <p>  <br />
        {event_summary}<br />
      <br />
      <br />
        <a href="http://index.php/template-name/category/{CATEGORY_URL_TITLE}">See more {CATEGORY_NAME} events</a><br />
      <br />
    {/exp:weblog/channel:entries}

    This would allow me to list all entries regardless of category, then link to a page that shows only entries in a certain category.

  • #2 / Jan 12, 2010 7:48pm

    Adam Dorsey

    1439 posts

    In order to gain access to those cateogy variables within a weblog:entries tag, they need to be wrapped in a {categories} variable pair, like so:

    {categories}
    <a href="http://index.php/template-name/category/{category_url_title}">See more {category_name} events</a>
    {/categories}

    Does this help?

  • #3 / Jan 12, 2010 8:07pm

    jdgraffam

    11 posts

    Does this help?

    Yes it does. You are a rock star! I feel like an idiot (I knew that, just forgot about it because I need sleep!).

  • #4 / Jan 12, 2010 8:09pm

    Adam Dorsey

    1439 posts

    No problem!

    Glad you got things sorted out. Please feel free to post again 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases