# On-page navigation with blocks

**URL:** <https://forum.getkirby.com/t/on-page-navigation-with-blocks/33286>\
**Category:** Questions\
**Created:** [January 8, 2025, 9:49pm UTC](https://forum.getkirby.com/t/on-page-navigation-with-blocks/33286 "2025-01-08T21:49:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeharrison](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mikeharrison/32/9620_2.png) [@mikeharrison](https://forum.getkirby.com/u/mikeharrison)\
**Post date:** [January 8, 2025, 9:49pm UTC](https://forum.getkirby.com/t/on-page-navigation-with-blocks/33286/1 "2025-01-08T21:49:34Z")

</div>

Hi,

I have a page builder setup with various blocks the user can choose from. What is the best way of assigning/exposing id’s for these so they can be linked to using the anchor option in the link field?

I could have a simple text box in each block but then would need to somehow check that these were all unique (or just warn the user they needed to be). In an ideal world I would use the block id assigned by Kirby but I can’t work out a way to display that as part of the block preview for the user.

Has anyone done this before with blocks?

---

<div class="post-metadata">

**Author:** ![David](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@David](https://forum.getkirby.com/u/David)\
**Post date:** [January 8, 2025, 10:01pm UTC](https://forum.getkirby.com/t/on-page-navigation-with-blocks/33286/3 "2025-01-08T22:01:28Z")

</div>

Sorry, i missed the part that you want to display the ID in the panel.

---

<div class="post-metadata">

**Author:** ![mikeharrison](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mikeharrison/32/9620_2.png) [@mikeharrison](https://forum.getkirby.com/u/mikeharrison)\
**Post date:** [January 8, 2025, 10:12pm UTC](https://forum.getkirby.com/t/on-page-navigation-with-blocks/33286/4 "2025-01-08T22:12:30Z")

</div>

No problem! I just want to make it as easy as possible for the user to link to individual blocks using anchors.

---

<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:** [January 8, 2025, 10:59pm UTC](https://forum.getkirby.com/t/on-page-navigation-with-blocks/33286/5 "2025-01-08T22:59:40Z")

</div>

You can access the block id with `this.id`

```auto
  blocks: {
      exampleblock: `
        <div @click="open">
          {{ this.id }}
        </div>
      `,
    }

```

Note that you would have to change all block previews to include the id somewhere
