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.

bread crumb categories ~ limit 1

February 24, 2010 6:07am

Subscribe [1]
  • #1 / Feb 24, 2010 6:07am

    Ross1988

    59 posts

    Hi

    i’m using

    {exp:weblog:entries weblog="{embed:listing_weblog" limit="1"}
    
    {categories}
    You are here: <b><a href="http://{blog_url}">{blog_title}</a></b> » <a href="http://{path={segment_1}/listings/}">{category_name}</a> » {title}
    {/categories}
    
    {/exp:weblog:entries}


    where I embed the name of my weblog in the template

    this works fine - a breadcrumb-like structure is produced, and works fine

    however I’ve noticed if an entry appears in more than 1 category, the breadcrumbs are repeated

    i’ve tried adding “limit=1”, and this is on a single-entry page, but my guess is that EE is limiting it to one entry, but not one category

    is there is a work around? ideally i’d like:

    e.g

    entry is in categories “red” and “blue”

    the user accesses the entry from “red” (site.com/show/category/red/my-entry)

    the breadcrumb links back to “red” (site.com/show/category/red)

    is this possible?

    thanks.

  • #2 / Feb 24, 2010 7:07am

    Ross1988

    59 posts

    i should edit and say i know about {category limit=1} but this limits the category to the order that they are in the control panel, not the “current” category.

    i had initially tried passing the category value via the url (site.com/view/entry/{category}) but this just got confusing

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

ExpressionEngine News!

#eecms, #events, #releases