Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Select language show module

Started by angro 9 years ago · 0 replies · 1350 views
9 years ago

Mainly for the Gantry5

TWIG

==== twig ====

{% extends '@nucleus/partials/particle.html.twig' %}

{% block particle %} {#

    {% set exit = false %}
    {% set languages = particle.language|split(',') %}

    {% for language in languages if not exit %}
        {% if grav.language.getActive == language or language == 'all' %} {% set exit = true %}
            {# content #}
            <h2>Language: {{ grav.language.getActive }}</h2>
        {% endif %}
    {% endfor %}

{% endblock %}

=== yaml ===

language:
  #type: select.select # =grav=
  type: input.multicheckbox # =gantry5=
  label: Language Open
  size: medium
  classes: fancy
  #multiple: true # =grav 1.1=
  help: Language
  data-options@: 'Grav\Plugin\Admin\Admin::siteLanguages'
  default: all
  options:
    all: All

Suggested topics

Topic Participants Replies Views Activity
Showcase · by Anthony L., 2 months ago
3 656 1 week ago
Showcase · by lynbor, 4 weeks ago
0 416 4 weeks ago
Showcase · by francois_fuchs, 1 month ago
3 513 1 month ago
Showcase · by kskt, 2 months ago
2 588 2 months ago
Showcase · by Andy Miller, 3 months ago
2 1002 2 months ago