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.

Breadcrumb solution

June 13, 2008 12:50pm

Subscribe [0]
  • #1 / Jun 13, 2008 12:50pm

    olaola

    21 posts

    Moderator’s note: Moved to Howto.

    I was wondering if someone could point me in the right direction.

    I have three category groups assigned to one of my weblogs; Two for filtering the entries and one to creating the site structure breadcrumb navigation. I have tried to use the category method to create breadcrumb navigation and got stuck. Not sure if I missing something. But I was able to get all my category names to show up, but could not filter out the others. Also it just listed them, not in relation to the page beign viewed. I am sure I messed this one up somehow.

  • #2 / Jun 13, 2008 5:33pm

    Justin Hurlburt

    344 posts

    Greetings,

    Have you referenced this Breadcrumb Navigation article?

  • #3 / Jun 13, 2008 6:23pm

    olaola

    21 posts

    Actually, I did. The problem is It does not really work since I am more interested in segment navigation as an example if you navigate to

    Home > Training
    The training link becomes
    <a href="http://www.siteurl/training/C10">http://www.siteurl/training/C10</a>

    This will generate a 404 page since training page is more akin to a major navigation segment link than a entries category link.  I think what i want is for the segment # to dictate the link title and url.

    Also when used on a page the breadcrumb cycles throught the categories of each entry. Here is a link to the site v-construct

  • #4 / Jun 13, 2008 7:18pm

    lebisol

    2234 posts

  • #5 / Jun 14, 2008 2:36pm

    olaola

    21 posts

    Okay ,
    So I figured this one out using segments and conditional statements. Here is the code for anyone interested. It may be crude, but it works for all my test cases. If any one has a more refined version let me know.

    <div id="mycrumbs">
        
        {if segment_1=="site" OR segment_1=="search"}
        You are here:
        <ol><li><a href="http://{homepage}">Home</a></li>
            <li >{exp:replace find="_" replace="SPACE"}
            {segment_2}
            {/exp:replace}</li>
        </ol>
        {if:elseif segment_1 <>"" AND segment_2 <>""}
        You are here:
        <ol><li><a href="http://{homepage}">Home</a></li>
            <li><a href="http://{path={segment_1}}">{segment_1}</a></li>
            <li>{exp:replace find="_" replace="SPACE"}{segment_2}{/exp:replace}</li>
        </ol>
        {if:elseif segment_1<>"" AND segment_2==""}
        You are here: 
            <ol><li><a href="http://{homepage}">Home</a></li>
                <li>{segment_1}</li></ol>
        {if:elseif segment_1 <>"" AND segment_2<>"" AND segment_3<>""}
        You are here:
            <ol><li><a href="http://{homepage}">Home</a></li>
                <li><a href="http://{path={segment_1}}">{segment_1}</a></li>
                <li><a href="http://{path={segment_2}}">{segment_2}</a></li>
                <li>{segment_3}</li></ol>
        {if:else}
        You are: Home 
        {/if}
              
                    
    </div>
  • #6 / Oct 08, 2008 9:56pm

    Robert Mirabito

    58 posts

    Is there a plugin or is this tag built into EE?

    {exp:replace find="_" replace="SPACE"}{segment_2}{/exp:replace}
  • #7 / Oct 08, 2008 9:59pm

    Robert Mirabito

    58 posts

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

ExpressionEngine News!

#eecms, #events, #releases