Skip to content

Commit

Permalink
feat(Show in shop): Add menu with locale to show in shop a page
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-monsieurbiz committed Feb 26, 2024
1 parent 58224f8 commit d22ee4f
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/Resources/views/Admin/Page/_showInShopButton.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,27 @@
</div>
</div>
{% else %}
{% for channel in enabledChannels %}
{% set url = channel.hostname is not null ? 'http://' ~ channel.hostname ~ path('monsieurbiz_cms_page_show', {'slug': resource.slug, '_locale': channel.defaultLocale.code}) : url('monsieurbiz_cms_page_show', {'slug': resource.slug, '_locale': channel.defaultLocale.code}) %}
<a class="ui labeled icon button" href="{{ url|raw }}" target="_blank">
<i class="angle right icon"></i>
<div class="ui floating dropdown labeled icon button">
<i class="share alternate icon"></i>
<span class="text">
{{ 'monsieurbiz_cms_page.ui.show_page_in_shop_page'|trans }}
</a>
{% endfor %}
</span>
<div class="menu">
<div class="scrolling menu">
{% for channel in enabledChannels %}
{% for locale in channel.locales %}
{% set localeCode = locale.code %}
{% set translationResource = resource.getTranslation(localeCode)|default(resource) %}
{% set url = channel.hostname is not null ? 'http://' ~ channel.hostname ~ path('monsieurbiz_cms_page_show', {'slug': translationResource.slug, '_locale': localeCode}) : url('monsieurbiz_cms_page_show', {'slug': translationResource.slug, '_locale': localeCode}) %}
<a href="{{ url|raw }}" class="item" target="_blank">
<i class="angle right icon"></i>
{{ 'monsieurbiz_cms_page.ui.show_in'|trans }}
{{ channel.name }} ({{ channel.code }}) ({{ localeCode }})
</a>
{% endfor %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% endif %}

0 comments on commit d22ee4f

Please sign in to comment.