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.

How to add category_name to search?

August 28, 2007 3:16pm

Subscribe [1]
  • #1 / Aug 28, 2007 3:16pm

    eeuser

    10 posts

    I am using the sample search result that comes eith EE. I am trying to display category_name . How do I go about displaying the category name?

    Thanks in advance .. the code is listed below.

    {exp:search:search_results switch="resultRowOne|resultRowTwo"}

    <tr>
    <td class=”{switch}” width=“30%” valign=“top”>{title}</td>
    <td class=”{switch}” width=“30%” valign=“top”>{excerpt}</td>
    <td class=”{switch}” width=“10%” valign=“top”>{author}</td>
    <td class=”{switch}” width=“10%” valign=“top”>{entry_date format="%m/%d/%y"}</td>
    <td class=”{switch}” width=“10%” valign=“top”>{category_name}</td>
    <td class=”{switch}” width=“10%” valign=“top”>{recent_comment_date format="%m/%d/%y"}</td>
    </tr>

    {/exp:search:search_results}

  • #2 / Aug 28, 2007 4:03pm

    Lisa Wess

    20502 posts

    Hi, eeuser. I’ve deleted your duplicate post in the Technical Support Forum - this is the appropriate forum.  We do ask that you do not cross-post like that, it is not necessary.

    To answer your question, however, you can use any of the weblog entries variables as noted here, so you’ll want the {categories} variable pair.

  • #3 / Aug 28, 2007 4:28pm

    eeuser

    10 posts

    Thank a bunch That worked 😊

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

ExpressionEngine News!

#eecms, #events, #releases