<p>A conditional that keys off the presence of the second segment to determine what to show for the "Blog" link/copy will work.</p>

<pre><code>{% set seg2 = "" %}
{% set seg2 = craft.request.getSegment(2) %}

&lt;ol class="breadcrumb"&gt;
    &lt;li&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;
        {% if seg2 == "" %}
            Blog
        {% else %}
            &lt;a href="{{ siteUrl }}"&gt;Blog&lt;/a&gt;
        {% endif %}
    &lt;/li&gt;
    {% for crumb in entry.getAncestors() %}
        &lt;li&gt;{{ crumb.getLink() }}&lt;/li&gt;
    {% endfor %}
    &lt;li&gt;{{ entry.title() }}&lt;/li&gt;
&lt;/ol&gt;
</code></pre>

CC BY-SA 3.0
2015-03-26T22:27:41.243Z
Worked like a charm ... I am still getting a "/" after "Blog" on the Home page of the Blog but I can live with that. TY again.
Steve VH
CC BY-SA 3.0
2015-03-26T22:29:15.180Z
Is the "/" coming from your CSS? It's not in the code that you posted.
Anna_MediaGirl
CC BY-SA 3.0
2015-03-27T15:20:49.547Z
I think it's a bootstrap style. If you 'inspect element' `::before` is shown and I think that is where the slashes are coming from.
Steve VH
CC BY-SA 3.0
2015-03-28T20:58:07.650Z
@SteveVH If so, you can wrap the "Blog" text within the conditional in a span, e.g. ```<span class="nolink">Blog</span>```, and hide the slash in your CSS like so: ```.nolink:before { display: none; }```
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2015-03-26T20:14:07.950Z
2015-03-26T20:14:07.950Z
Anna_MediaGirl
<p>First, if your Blog section type is a Channel and not a Structure, then <code>{% for crumb in entry.getAncestors() %}</code> won't return anything. Your entry needs to be in a structure have any ancestors.</p>

<p>Here's a rundown of Craft's section types:</p>

<p><a href="http://buildwithcraft.com/docs/sections-and-entries" rel="nofollow">http://buildwithcraft.com/docs/sections-and-entries</a></p>

<p>This is really going to depend on how you have your templates and sections are setup, but here's how a basic setup for a Blog channel might work.</p>

<p>Let's say you have a <strong>Blog</strong> section that's a <strong>Channel</strong> section type. In your <code>craft/templates</code> folder, you have the following folders:</p>

<pre><code>blog/
blog/index.html
blog/_entry.html
</code></pre>

<p>In the settings for the Blog section, you have...</p>

<p><strong>Entry URL Format:</strong> <code>blog/{slug}</code></p>

<p><strong>Entry Template:</strong> <code>blog/_entry</code></p>

<p>If you're on an entry page like <code>example.com/blog/what-makes-a-good-logo-design</code>, Craft will route to the <code>blog/_entry.html</code> template. In that file your breadcrumb could be just this:</p>

<pre><code>&lt;ol class="breadcrumb"&gt;
    &lt;li&gt;&lt;a href="{{ siteUrl }}"&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/blog"&gt;Blog&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;{{ entry.title }}&lt;/li&gt;
&lt;/ol&gt;
</code></pre>

<p>If you go to <code>example.com/blog</code>, Craft will route to the <code>blog/index.html</code> template. In that file, you can have a separate breadcrumb like this:</p>

<pre><code>&lt;ol class="breadcrumb"&gt;
    &lt;li&gt;&lt;a href="{{ siteUrl }}"&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Blog&lt;/li&gt;
&lt;/ol&gt;
</code></pre>

CC BY-SA 3.0
2015-03-27T15:34:14.823Z
Thanks for the further clarification. I'm new to Craft and still trying to understand all of it!
Steve VH
CC BY-SA 3.0
2015-03-27T16:15:52.630Z
OK so I just had that "aha" moment - I really didn't understand until now about the "block - endblock" concept and how you can replace different sections with new stuff. 

I mentioned to Craft how they really need to have a primer for the non-developer/designer that gives a step-by-step on how to develop a basic Craft site, like Mike Boyink's and Ryan Irelan's [excellent] books for EE. :)
Steve VH
CC BY-SA 3.0
2015-03-27T22:49:16.927Z
There's a good list of beginner resources on this question "Are there any beginner Craft tutorials?": http://craftcms.stackexchange.com/a/1826/273
Alex Roper
CC BY-SA 3.0
2015-03-27T09:45:12.697Z
2015-03-27T12:29:23.727Z
2015-03-27T12:29:23.727Z
Alex Roper
<p>I am using Craft only for the blog section of my HTML site. I have integrated my existing breadcrumbs to the blog, but there is a problem.</p>

<p>When I am on the home page of the blog, the word "Blog" in the breadcrumb is linked, and I would rather it <strong>not</strong> be linked.</p>

<p>I would like the word "Blog" in the breadcrumb to be a link only after going to an article on the blog. Please see attached.</p>

<p><img src="https://i.sstatic.net/KZuDG.png" alt="Screen shot comparing the Home page of the blog and an Article page"></p>

<p>The code I am using right now is</p>

<pre><code>    &lt;ol class="breadcrumb"&gt;
        &lt;li&gt;&lt;a href="/index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="{{ siteUrl }}"&gt;Blog&lt;/a&gt;&lt;/li&gt;
            {% for crumb in entry.getAncestors() %}
                &lt;li&gt;{{ crumb.getLink() }}&lt;/li&gt;
            {% endfor %}
            &lt;li&gt;{{ entry.title() }}&lt;/li&gt;
    &lt;/ol&gt;
</code></pre>

<p>I am new to Craft - thanks for your help!</p>

CC BY-SA 3.0
2015-03-26T20:12:47.167Z
Just to be clear... is the section that `entry` lives in a structured section?
Brad Bell
CC BY-SA 3.0
2015-03-26T22:10:57.477Z
...ummm I don't think it's structured. I am working off the the sample templates included with Craft.
Steve VH
<navigation>
Question about breadcrumb links
# Question about breadcrumb links

(Asked by: username_0 on 2015-03-26)

I am using Craft only for the blog section of my HTML site. I have integrated my existing breadcrumbs to the blog, but there is a problem.
When I am on the home page of the blog, the word "Blog" in the breadcrumb is linked, and I would rather it not be linked.
I would like the word "Blog" in the breadcrumb to be a link only after going to an article on the blog. Please see attached.

The code I am using right now is
    
        Home
            Blog
            {% for crumb in entry.getAncestors() %}
                {{ crumb.getLink() }}
            {% endfor %}
            {{ entry.title() }}
    

I am new to Craft - thanks for your help!

**Tags:** navigation
> **Comments:**
> **username_1**: Just to be clear... is the section that `entry` lives in a structured section?  
> **username_0**: ...ummm I don't think it's structured. I am working off the the sample templates included with Craft.  

---

## 2 answers

### Answer by username_2 on 2015-03-26. Score: 2

A conditional that keys off the presence of the second segment to determine what to show for the "Blog" link/copy will work.
{% set seg2 = "" %}
{% set seg2 = craft.request.getSegment(2) %}


    Home
    
        {% if seg2 == "" %}
            Blog
        {% else %}
            Blog
        {% endif %}
    
    {% for crumb in entry.getAncestors() %}
        {{ crumb.getLink() }}
    {% endfor %}
    {{ entry.title() }}

> **Comments:**
> **username_0**: Worked like a charm ... I am still getting a "/" after "Blog" on the Home page of the Blog but I can live with that. TY again.  
> **username_2**: Is the "/" coming from your CSS? It's not in the code that you posted.  
> **username_0**: I think it's a bootstrap style. If you 'inspect element' `::before` is shown and I think that is where the slashes are coming from.  
> **username_3**: @SteveVH If so, you can wrap the "Blog" text within the conditional in a span, e.g. ```<span class="nolink">Blog</span>```, and hide the slash in your CSS like so: ```.nolink:before { display: none; }```  

---

### Answer by username_4 on 2015-03-27. Score: 2

First, if your Blog section type is a Channel and not a Structure, then {% for crumb in entry.getAncestors() %} won't return anything. Your entry needs to be in a structure have any ancestors.
Here's a rundown of Craft's section types:
http://buildwithcraft.com/docs/sections-and-entries
This is really going to depend on how you have your templates and sections are setup, but here's how a basic setup for a Blog channel might work.
Let's say you have a Blog section that's a Channel section type. In your craft/templates folder, you have the following folders:
blog/
blog/index.html
blog/_entry.html

In the settings for the Blog section, you have...
Entry URL Format: blog/{slug}
Entry Template: blog/_entry
If you're on an entry page like example.com/blog/what-makes-a-good-logo-design, Craft will route to the blog/_entry.html template. In that file your breadcrumb could be just this:

    Home
    Blog
    {{ entry.title }}


If you go to example.com/blog, Craft will route to the blog/index.html template. In that file, you can have a separate breadcrumb like this:

    Home
    Blog

> **Comments:**
> **username_0**: Thanks for the further clarification. I'm new to Craft and still trying to understand all of it!  
> **username_0**: OK so I just had that "aha" moment - I really didn't understand until now about the "block - endblock" concept and how you can replace different sections with new stuff.   I mentioned to Craft how they really need to have a primer for the non-developer/designer that gives a step-by-step on how to develop a basic Craft site, like Mike Boyink's and Ryan Irelan's [excellent] books for EE. :)  
> **username_4**: There's a good list of beginner resources on this question "Are there any beginner Craft tutorials?": http://craftcms.stackexchange.com/a/1826/273  

---

