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.

Display one category

July 31, 2013 7:03pm

Subscribe [1]
  • #1 / Jul 31, 2013 7:03pm

    mirkob

    74 posts

    I’m working on a site where there a many physicians in many locations (I used categories for the locations)

    So, When I click a location it displays all the physicians in this location.

    Then, I wanted to display the address of the location, so I added the address in the category description.

    However, some physicians are in multiple locations so when I use the code:

    {exp:channel:entries channel="physician" limit="1"}
    
    {categories}
    {category_description}
    {/categories}
           
    {/exp:channel:entries}

    it gives me 2 or more addresses.

    Is it possible to give me only the address on the location I selected with:

    <a href="http://www.site.com/physicians/area/orange_park">http://www.site.com/physicians/area/orange_park</a>

    Thanks
    Mirko

     

  • #2 / Aug 01, 2013 8:15am

    Giraffentoast

    152 posts

    How about something like this:

    {exp:channel:categories}
        {if category_url_title == segment_3}{category_description}{/if}
    {/exp:channel:categories}
  • #3 / Aug 01, 2013 8:32am

    Giraffentoast

    152 posts

    It would be more effective if you had access to the category ID:

    {exp:channel:categories show="15"}
        {category_description}
    {/exp:channel:categories}
  • #4 / Aug 01, 2013 12:10pm

    mirkob

    74 posts

    How about something like this:

    {exp:channel:categories}
        {if category_url_title == segment_3}{category_description}{/if}
    {/exp:channel:categories}

    Thanks this is what I was looking for!

    Mirko

     

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

ExpressionEngine News!

#eecms, #events, #releases