murph-skeleton/templates/base.html.twig

65 lines
2.7 KiB
Twig
Raw Normal View History

2022-02-21 23:58:08 +01:00
{% apply spaceless %}
2021-03-24 12:27:07 +01:00
<!DOCTYPE html>
2022-02-21 23:58:08 +01:00
<html lang="{{ _locale }}">
2021-03-24 12:27:07 +01:00
<head>
2022-02-21 23:58:08 +01:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
2022-02-22 00:01:13 +01:00
<link rel="icon" type="image/x-icon" href="{{ asset('build/images/core/logo.svg') }}" />
2022-02-21 23:58:08 +01:00
{%- block opengraph -%}
2022-04-25 21:08:25 +02:00
<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 -%}" />
2022-02-21 23:58:08 +01:00
{%- if _page.ogImage -%}
2022-04-25 21:08:25 +02:00
<meta property="og:image" content="{%- block ogImage -%}{{ absolute_url(asset(_page.ogImage)) }}{%- endblock -%}" />
2022-02-21 23:58:08 +01:00
{%- endif -%}
{%- endblock -%}
2022-06-12 19:07:55 +02:00
<meta name="description" content="{%- block pageDescription -%}{{- _page.metaDescription -}}{%- endblock -%}"/>
2022-02-21 23:58:08 +01:00
{%- block stylesheets -%}
{{ encore_entry_link_tags('app') }}
{%- endblock -%}
2022-04-25 21:08:25 +02:00
<title>{%- block pageTitle -%}{{ _page.metaTitle }}{%- endblock -%}</title>
2021-03-24 12:27:07 +01:00
</head>
2022-02-21 23:58:08 +01:00
2021-03-24 12:27:07 +01:00
<body>
2022-02-21 23:58:08 +01:00
{#
- The current node is `_node` and its menu is `_menu`
- The current navigation is `_navigation`
- The current locale is `_locale`
2022-03-01 16:16:50 +01:00
- The CMS store is `_store`
2022-02-21 23:58:08 +01:00
- 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:
```
2022-02-23 10:59:02 +01:00
{% if not node.disableUrl %}
{% set path = safe_node_path(node) %}
{% set url = safe_node_url(node) %}
2022-02-21 23:58:08 +01:00
{% 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 -%}
2021-03-24 12:27:07 +01:00
</body>
</html>
2022-02-21 23:58:08 +01:00
{% endapply %}