Add solo anchor into Volto Light Theme page pointing at heading blocks without addon (thats poor 😬)

In Volto Light Theme (in the suggested Volto Light Theme default setup) linking to an anchor for the Blocks heading is not possible, because the block generates no IDs similar to an H2 in regular text blocks. Even the heading block looks sometimes better and is maybe selected as visual eye catchers (as the name suggests).

I updated this post. Unlike mentioned before, the kitconcept/volto-block-introduction block generates proper ID slugs and wraps everything as H3.

You could maybe add @eeacms/volto-anchors from GitHub - eea/volto-anchors: Slug based anchor links for volto blocks but this is not the purpose of the hint… and not tested yet.

Note: The H1 should be always reserved for the page/section title, even if you need similar styling for other headlines. H2 etc. may appear as often as you like it. Exception: Concatenated listing of multiple HTML5 sections which in fact are listings of many pages (like lazyloaded stuff in blogs or in onepagers).

Workaround:

Add an HTML Block before the target block and insert:

<a id="sponsoring-angebote"></a>

The block is invisible and works as a target for a link in a regular text block linking to link #sponsoring-angebote.

The resulting rendered HTML source snipped is:

<div class="block html">
    <a id="sponsoring-angebote"></a>
</div>

and works as target.

Off Topic but annoying

There is a current issue with the @kitconcept/volto-button-block that you cannot add a link pointing to an anchor on the same page by entering an URL. Selecting from the internal link bowser does not work and results in fallback to the top most object under this page as parent.

1 Like

There's an issue from January 2019.

I requested it be added to the following PLIP.

So the select link thing is actually a general issue of the Volto widget and not of the volto-button-block itzself. Good to know. I did not investigate that further. Therefore no ticket research or own ticket.

When OSS doesn't work as I expect, I go to its issue tracker first, then documentation, and lastly community. Search on GitHub issue trackers for "anchor" turned up its story.

1 Like

Good thing to add to our Support page

No, that's for getting support. Different context. We don't want to drive people to the issue tracker for how to install stuff.