# Breadcrumb with microdata (scheme.org)

**URL:** <https://forum.getkirby.com/t/breadcrumb-with-microdata-scheme-org/28349>\
**Category:** Questions\
**Tags:** v3\
**Created:** [April 11, 2023, 2:18pm UTC](https://forum.getkirby.com/t/breadcrumb-with-microdata-scheme-org/28349 "2023-04-11T14:18:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexander-hacke](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/alexander-hacke/32/5779_2.png) [@alexander-hacke](https://forum.getkirby.com/u/alexander-hacke)\
**Post date:** [April 11, 2023, 2:18pm UTC](https://forum.getkirby.com/t/breadcrumb-with-microdata-scheme-org/28349/1 "2023-04-11T14:18:13Z")

</div>

Hello together,

I created a breadcrumb navigation using Microdata. Everything works fine except the content number for itemprop=“position” looks like this:

Start 1 → level 1 → level 2

Can someone please help me and tell me how to do this correctly?

```auto
<nav class="d-none d-md-block container" aria-label="breadcrumb">
    <ol itemscope itemtype="https://schema.org/BreadcrumbList" class="breadcrumb">
        <?php foreach($site->breadcrumb() as $crumb): ?>
            <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" class="breadcrumb-item<?php e($crumb->isActive(), ' active') ?>">
                <a itemprop="item" href="<?php echo $crumb->url() ?>" title="<?php echo kirbytextinline($crumb->title()) ?>">
                    <span itemprop="name"><?php echo kirbytextinline($crumb->title()) ?></span>
                    
                    <meta itemprop="position" content="<?php echo $crumb->depth() ?>">
                </a>
            </li>
        <?php endforeach ?>
    </ol>
</nav>

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 11, 2023, 2:30pm UTC](https://forum.getkirby.com/t/breadcrumb-with-microdata-scheme-org/28349/2 "2023-04-11T14:30:03Z")

</div>

What is the expected result, given that level 1 and level 2 are not children of home, but on the same level? So given that the expected result is

Start 1 → Level 2 → Level 3

You would have to increment the depth by 1 for all pages but the home page.

```auto
<meta itemprop="position" content="<?php echo $crumb->isHomePage() ? $crumb->depth() : $crumb->depth() + 1?>">

```

---

<div class="post-metadata">

**Author:** ![alexander-hacke](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/alexander-hacke/32/5779_2.png) [@alexander-hacke](https://forum.getkirby.com/u/alexander-hacke)\
**Post date:** [April 11, 2023, 2:45pm UTC](https://forum.getkirby.com/t/breadcrumb-with-microdata-scheme-org/28349/3 "2023-04-11T14:45:02Z")

</div>

Hello Sonja,

thank you so much. Works awesome 😊

Here is my full working code:

```auto

    <ol itemscope itemtype="https://schema.org/BreadcrumbList" class="breadcrumb">
        <?php foreach($site->breadcrumb() as $crumb): ?>
            <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" class="breadcrumb-item<?php e($crumb->isActive(), ' active') ?>">
                <a itemprop="item" href="<?php echo $crumb->url() ?>" title="<?php echo kirbytextinline($crumb->title()) ?>">
                    <span itemprop="name"><?php echo kirbytextinline($crumb->title()) ?></span>
                    
                    <meta itemprop="position" content="<?php echo $crumb->isHomePage() ? $crumb->depth() : $crumb->depth() + 1?>">
                </a>
            </li>
        <?php endforeach ?>
    </ol>

```
