This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in contenttypes.yml: | |
image: | |
type: image | |
attrib: [ alt_nl, title_nl, alt_en, title_en, alt_fr, title_fr ] | |
in de template: | |
{% set alt = attribute(record.values.image, 'alt_'~getlanguage() )|default('') %} | |
{% set title = attribute(record.values.image, 'title_'~getlanguage() )|default('') %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if 'youtube' in record.video.url %} | |
{% set embedurl = 'https://www.youtube-nocookie.com/embed/' ~ record.video.url|split('=')|last ~ '?feature=oembed&rel=0&autoplay=1' %} | |
{% elseif 'youtu.be' in record.video.url %} | |
{% set embedurl = 'https://www.youtube-nocookie.com/embed/' ~ record.video.url|split('/')|last ~ '?feature=oembed&rel=0&autoplay=1' %} | |
{% elseif 'vimeo' in record.video.url %} | |
{% set embedurl = 'https://player.vimeo.com/video/' ~ record.video.url|split('/')|last ~'?autoplay=1' %} | |
{% else %} | |
{% set embedurl = '[todo-else]' %} | |
{% endif %} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.skiplinks { | |
position: absolute; | |
top: 3px; | |
left: 10px; | |
width: 100px; | |
a { | |
color: #000; // force black for optimal contrast | |
font-size: 0.9167em; | |
display: inline-block; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Debugging | |
# OFF on global config! - to make sure it is enabled on PROD by default. | |
debug: | |
enabled: false | |
address: [email protected] | |
# TEMPLATES | |
# Custom for museon site, in the museon2019/templates folder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if app.request.get('_route') %}{# no route, no SEO tags #} | |
<title>{{ seo.title() }}</title> | |
{{ seo.metatags() }} | |
{% else %} | |
<title>Niet Gevonden | {{ config.get('general/sitename') }}</title> | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if record.image is not empty %} | |
<figure class="main-img"> | |
<div class="img-container"> | |
<img class="" | |
{# give the browser three possible imagesizes to choose from #} | |
srcset="{{ record.image|thumbnail(1800,750,'c') }} 1800w , | |
{{ record.image|thumbnail(1200,500,'c') }} 1200w, | |
{{ record.image|thumbnail(800,330,'c') }} 800w" | |
{# give the width the image is used on different mediaqueries - in this case always 100% #} | |
sizes="100vw" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
Create a user friendly 404 page that guesses the broken link by looking at the language attribute, and serving the appropriate language | |
#} | |
{# Special 404 case, no locales present: check for language #} | |
{% set language = getlanguage()|default(app.request.pathInfo|split("/")[1])|default('nl') %} | |
{% if language == 'en' %} | |
{% set record = record.endata|json_decode %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Checks start- and enddates and returns a pretty formatting. | |
# available formats: | |
# 14 jan 2019 (one day) | |
# 14 jan 2019 14:00 - 16:00 (one day but different end time) | |
# 14 jan 2019 - 18 jan 2019 (multiple day event) | |
#} | |
{% if item is not defined %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if item is not defined %} | |
{% set item = record %} | |
{% endif %} | |
{% if item.startdate|localdate("%G%b%e") == item.enddate|localdate("%G%b%e") %} {# one day event #} | |
{% if item.startdate|localdate("%k%M") == item.enddate|localdate("%k%M") %} | |
{# one day, same time #} | |
{{ item.startdate|localdate("%e %b %G") }} | |
{% else %} | |
{# one day, start and end time #} |