murph-skeleton/templates/base.html.twig

65 lines
2.7 KiB
Twig

{% apply spaceless %}
<!DOCTYPE html>
<html lang="{{ _locale }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/x-icon" href="{{ asset('build/images/core/logo.svg') }}" />
{%- block opengraph -%}
<meta property="og:title" content="{%- block ogTitle -%}{{ _page.ogTitle }}{%- endblock -%}" />
<meta property="og:description" content="{%- block ogDescription -%}{{ _page.ogDescription }}{%- endblock -%}" />
<meta property="og:type" content="{%- block ogType -%}website{%- endblock -%}" />
<meta property="og:url" content="{%- block opengraphUri -%}{{ app.request.uri }}{%- endblock -%}" />
{%- if _page.ogImage -%}
<meta property="og:image" content="{%- block ogImage -%}{{ absolute_url(asset(_page.ogImage)) }}{%- endblock -%}" />
{%- endif -%}
{%- endblock -%}
<meta name="description" content="{%- block pageDescription -%}{{- _page.metaDescription -}}{%- endblock -%}"/>
{%- block stylesheets -%}
{{ encore_entry_link_tags('app') }}
{%- endblock -%}
<title>{%- block pageTitle -%}{{ _page.metaTitle }}{%- endblock -%}</title>
</head>
<body>
{#
- The current node is `_node` and its menu is `_menu`
- The current navigation is `_navigation`
- The current locale is `_locale`
- The CMS store is `_store`
- Retrieve all navigations: `_store.navigations`
- Retrieve a navigation by its code: `_store.navigation('the_code')`
- Retrieve all navigation menus: `_navigation.menus`
- Retrieve a menu by its code: `_navigation.menu('the_code')`
- Retrieve all nodes of a menu: `menu.rootNode.children`
- Retrieve visible nodes of a menu: `menu.rootNode.children({visible: true})`
- Test if a node is the current one: `_store.isActiveNode(node)`
- Test if a node is or contains the current one: `_store.isActiveNode(node, true)`
- Generate a node url:
```
{% if not node.disableUrl %}
{% set path = safe_node_path(node) %}
{% set url = safe_node_url(node) %}
{% endif %}
```
- Generate a node url when the navigation has several domains: `safe_node_path(node, {_domain: _domain})`
#}
{% block page %}{% endblock %}
{%- block javascripts -%}
{{ encore_entry_script_tags('app') }}
{%- endblock -%}
</body>
</html>
{% endapply %}