Umlauts not converted correctly to anchor-slug/custom slug will remove module from page and menu

@NatLikon, By searching this forum on ‘umlaut’, I found the following post: Umlaute Ü ä in frontmatter

I’ve altered the solution a bit for theme Quark. The solution is quite generic, but you might have to make some changes to adapt to your theme.

  • For each page that has an umlaut in its title, add:
    ---
    title: Über
    anchor: ueber
    ---
    
  • Add a macro to top of template /user/themes/quark/templates/modular.html.twig:
    {% extends 'partials/base.html.twig' %}
    
    {% macro anchor(module) %}
      {{ module.header.anchor ?: (module.menu|hyphenize) }}
    {% endmacro %}
    
    This macro returns the value of anchor from the header of a page, or if not available, the original module.menu|hyphenize
  • In same template replace all occurrences of module.menu|hyphenize with _self.anchor(module)

Page with title Über will now have anchor #ueber.

1 Like