We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After I added the localization part for the menu content type(Content Types -> Menu -> Edit), the frontend menu disappeared.
version: 2.0.0
Steps to reproduce the behavior:
The menu should display well, if I change the language, the menu should render with the language.
The layout template codes:
{% shape "menu", alias: "alias:main-menu", cache_id: "main-menu", cache_fixed_duration: "00:05:00", cache_tag: "alias:main-menu" %} {% assign cultures = Culture | supported_cultures %} <div class="culture-picker dropdown"> <button class="btn btn-success btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">{{Culture.Name}}</button> <ul class="dropdown-menu dropdown-menu-end shadow"> {% for culture in cultures %} {% if culture.Name != Culture.Name %} <li><a class="dropdown-item" href="{{ culture.Name | switch_culture_url }}">{{ culture.Name }}</a></li> {% else %} <li><a class="dropdown-item active" href="{{ culture.Name | switch_culture_url }}">{{ culture.Name | t }}</a></li> {% endif %} {% endfor %} </ul> </div>
The text was updated successfully, but these errors were encountered:
I think I found the root cause.
{% shape "menu", alias: "alias:main-menu", cache_id: "main-menu", cache_fixed_duration: "00:05:00", cache_tag: "alias:main-menu" %}
The menu alias changed, I need to update the logic. The alias should be dynamic with the culture.
{% assign menuKey = "alias:main-menu-" | append: Culture.Name %} {% assign menuCacheKey = "main-menu-" | append: Culture.Name %} {% shape "menu", alias: menuKey, cache_id: menuCacheKey, cache_fixed_duration: "00:05:00", cache_tag: menuKey %}
Sorry, something went wrong.
Thanks for the update!
No branches or pull requests
Describe the bug
After I added the localization part for the menu content type(Content Types -> Menu -> Edit), the frontend menu disappeared.
Orchard Core version
version: 2.0.0
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The menu should display well, if I change the language, the menu should render with the language.
Logs and screenshots
The layout template codes:
The text was updated successfully, but these errors were encountered: