Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Anchor cyrillic doesnt work on modular page

Solved by Natalia Bazilenco View solution

Started by Natalia Bazilenco 3 years ago · 8 replies · 392 views
3 years ago

Hi, I use Quark template. My default language is Ukrainian and I added the Romanian, English and Russian. When I named modular page in cyrillic then the menu anchor link doesnt work, doesn scroll to my section. In the menu, the link to the section is simply with a sign #

3 years ago

Try changing slugs for these sections (I assume you're talking about modular page) to all Latin chars. IIRC this is a known issue, but no one bothers to address, because there's an easy workaround

3 years ago

How can I make the menu names remain in Cyrillic and the anchor transition works? Yes I work with modular page (One-Page Site Quark)

3 years ago

@NataliaB, Maybe taking a look at frontmatter variables Menu, Title and Slug will provide some insight.

3 years ago

This my modular page content

title: Головна
body_classes: modular
image_align: right
media_order: hero-image.png
menu: головна

On website show menu item for this modular page in cyrillic, but scrol to section of this modular page doesnt work, beacuse after # in menu item has nothing mysite/#
If I change menu: головна to menu: home than in menu item write Home and link will be mysite/#home But I need menu item in cyrillic for my Ukrainian an Russian language version

3 years ago

If I add a slug then get error
title: 'Про нас'
slug: pronas

ERROR: text.html.twig template not found for page: /home/pronas

3 years ago

Maybe for ua and ru language version disable onpage_menu and create a menu with anchor links ? But how?

3 years ago

@NataliaB, you should copy/paste the modular template into your inherited theme and modify it by changing module.menu|hyphenize to module.slug|hyphenize where it can be found, but left module.menu as link text (line#32)

👍 1
last edited 03/09/23 by Vadym
3 years ago Solution

Than also need rename folder with modular pages to my slug. Well, its work for me but only for Russian and Ukrainian language for other languages doesnt work. On all version in menu item slug from ru version.
Yesterday also I found another solution here Its work for all language version. But now need to exclude the modular items that I set will not be displayed in settings: Visible: Disabled. But they still show up.

Ok, I gues found - on raw 32 need replace:

TWIG
{% for module in page.collection() %}

to

TWIG
{% for module in page.collection() if module.header.visible is not same as(false) %}
last edited 03/09/23 by Natalia Bazilenco

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 10 hours ago
General · by pamtbaau, 15 hours ago
1 51 14 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago