Get anchor from custom block

I created a custom block wit Sage 10 and enabled the anchor field.

$supports = [
    'anchor' => true
]

But how do i retrieve the anchor in my view?

<section class="{{ $block->classes }}" id="{{ $block->block->id }}">
</section>

Debugged $block but there’s no anchor value.

<section class="{{ $block->classes }}" id="{{ $block->block->anchor }}">
    ...
</section>
2 Likes

Yes but i just found out that the anchor is not available when the anchor is not filled in the GUI.

{{ $block->block->anchor ?? $block->block->id }}

yep, you’ll need to check it exists, not sure what the problem with that is?

Well the page breaks. With the id this issues does not apears.