maju.www
clone your own copy | download snapshot

Snapshots | iceberg

Inside this repository

modular.html.twig
text/plain

Download raw (3.0 KB)

{% extends 'partials/base.html.twig' %}
{% set shuffled_collection = page.collection().shuffle() %}

{% block main_content %}
  {% for module in shuffled_collection if module.template == 'modular/project' %}
    {{ module.content|raw }}
  {% endfor %}
  {% include "partials/drawing.html.twig" %}
{% endblock %}

{% block project_side %}
  {% for module in shuffled_collection  if module.template == 'modular/project' %}
    <div 
      class="project-side"
      data-project-visibility="true" 
      data-project-type="{{module.taxonomy.tag|first|e}}" 
      data-project-year="{{module.header.year}}">
    </div>
  {% endfor %}

    <div 
      class="project-side"
      data-project-visibility="true" 
      {% if module.taxonomy.tag %}
      data-project-type="{{module.taxonomy.tag|first|e}}"     {% else %}
      data-project-type="drawing"
          {% endif %}
      data-project-year="{{module.header.year}}">
    </div>


{% endblock %}

{% block about_content %}
  {% for module in page.collection()  if module.template == 'modular/about' %}
    {{ module.content|raw }}
  {% endfor %}
{% endblock %}



{# {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %}

{% block javascripts %}
    {% if show_onpage_menu %}
        {% do assets.add('theme://js/singlepagenav.min.js') %}
    {% endif %}
    {{ parent() }}
{% endblock %}

{% block bottom %}
    {{ parent() }}
    {% if show_onpage_menu %}
        <script>
        // singlePageNav initialization & configuration
        $('ul.navigation').singlePageNav({
            offset: $('#header').outerHeight(),
            filter: ':not(.external)',
            updateHash: true,
            currentClass: 'active'
            });
        </script>
    {% endif %}
{% endblock %}

{% block header_navigation %}
    {% if show_onpage_menu %}
        <ul class="navigation">
        {% for module in page.collection() if module.header.visible is not same as(false) %}
            {% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
            <li><a class="{{ current_module }}" href="#{{ module.menu|hyphenize }}">{{ module.menu }}</a></li>
        {% endfor %}
        {% for mitem in site.menu %}
            <li>
                <a {% if mitem.class %}class="{{ mitem.class }}"{% endif %} href="{{ mitem.url }}">
                    {% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
                    {{ mitem.text }}
                </a>
            </li>
        {% endfor %}
        </ul>
    {% else %}
        {{  parent() }}
    {% endif %}
{% endblock %}

{% block hero %}
    {% for module in page.collection() if module.template == 'modular/hero' %}
        <div id="{{ module.menu|hyphenize }}"></div>
        {{ module.content|raw }}
    {% endfor %}
{% endblock %}

{% block body %}
    {% for module in page.collection() if module.template != 'modular/hero' %}
        <div id="{{ module.menu|hyphenize }}"></div>
        {{ module.content|raw }}
    {% endfor %}
{% endblock %} #}