{% extends '@NotarisFrontend/layout2017.html.twig' %}
{% if notaryId is defined %}
{% set headTitle = info.header1 | replace({"<BR />":" "}) ~ ' - ' ~ subsite.pageTitle %}
{% else %}
{% set headTitle = subsite.pageTitle %}
{#{% if subsite.slug != 'nieuws-pers' and subsite.slug != 'nouveautes' %}#}
{% set headTitle = headTitle ~ " | " ~ 'nw_header_news' | trans %}
{#{% endif %}#}
{% set headTitle = headTitle ~ ' ' ~ 'alg_basetitle' | trans %}
{% endif %}
{% block title %}
<title>{{ headTitle }}</title>
{% endblock %}
{% if subsite.slug == 'nieuws-pers' or subsite.slug == 'nouveautes' %}
{% set canonicallink = url_scheme ~ '://www.' ~ _context['url_' ~ locale] ~ path('notaris_frontend_news', {_locale: locale}) %}
{% else %}
{% set canonicallink = url_scheme ~ '://www.' ~ _context['url_' ~ locale] ~ path('notaris_frontend_subsite_news', {_locale: locale, subsiteslug: subsite.slug}) %}
{% endif %}
{% set linked_url_nl = url_nl ~ path('notaris_frontend_news.nl') %}
{% set linked_url_fr = url_fr ~ path('notaris_frontend_news.fr') %}
{% block extralinks %}
{% if subsite.slug == 'nieuws-pers' or subsite.slug == 'nouveautes' %} {#for subsites i need to know the translation slug, no connection in database #}
{% set hreflang_start_nl = url_scheme ~ '://www.' ~ url_nl %}
{% set hreflang_start_x = url_scheme ~ '://www.' ~ url_nl %}
{% set hreflang_start_fr = url_scheme ~ '://www.' ~ url_fr %}
{% set xdef_lang = 'nl' %}
{% set hreflang_nl = hreflang_start_nl ~ path('notaris_frontend_news', {_locale: 'nl'}) %}
{% set hreflang_fr = hreflang_start_fr ~ path('notaris_frontend_news', {_locale: 'fr'}) %}
<link rel="alternate" hreflang="nl-be"
href="{{ hreflang_nl }}" />
<link rel="alternate" hreflang="fr-be"
href="{{ hreflang_fr }}" />
{% if notaryId is defined %}
{% if sites | length > 0 %}
{% for key, site in sites %}
{% if key == 'nl' %}
{% set hreflang_start_nl = scheme_url ~ '://' ~ site %}
{% endif %}
{% if key == 'fr' %}
{% set hreflang_start_fr = scheme_url ~ '://' ~ site %}
{% endif %}
{% endfor %}
{% set hreflang_start_x = scheme_url ~ '://' ~ sites[notaryId.locale] %}
{% set xdef_lang = notaryId.locale %}
{% endif %}
{% set hreflang_nl = hreflang_start_nl ~ path('notaris_frontend_news', {_locale: 'nl'}) %}
{% set hreflang_fr = hreflang_start_fr ~ path('notaris_frontend_news', {_locale: 'fr'}) %}
<link rel="alternate" hreflang="nl"
href="{{ hreflang_nl }}" />
<link rel="alternate" hreflang="fr"
href="{{ hreflang_fr }}" />
{% endif %}
{% set hreflang_x = hreflang_start_x ~ path('notaris_frontend_news', {_locale: xdef_lang}) %}
{#{% if ordertype != '' and currentpage == 0 %}#}
{#{% set hreflang_nl = hreflang_start_nl ~ path('notaris_frontend_news_order', {locale: 'nl', otype: ordertype}) %}#}
{#{% set hreflang_fr = hreflang_start_fr ~ path('notaris_frontend_news_order', {locale: 'fr', otype: ordertype}) %}#}
{#{% set hreflang_x = hreflang_start_x ~ path('notaris_frontend_news_order', {locale: xdef_lang, otype: ordertype}) %}#}
{#{% endif %}#}
{#{% if ordertype == '' and currentpage != 0 %}#}
{#{% set hreflang_nl = hreflang_start_nl ~ path('notaris_frontend_news_page', {locale: 'nl', page: currentpage}) %}#}
{#{% set hreflang_fr = hreflang_start_fr ~ path('notaris_frontend_news_page', {locale: 'fr', page: currentpage}) %}#}
{#{% set hreflang_x = hreflang_start_x ~ path('notaris_frontend_news_page', {locale: xdef_lang, page: currentpage}) %}#}
{#{% endif %}#}
{#{% if ordertype != '' and currentpage != 0 %}#}
{#{% set hreflang_nl = hreflang_start_nl ~ path('notaris_frontend_news_page_order', {locale: 'nl', page: currentpage, otype: ordertype}) %}#}
{#{% set hreflang_fr = hreflang_start_fr ~ path('notaris_frontend_news_page_order', {locale: 'fr', page: currentpage, otype: ordertype}) %}#}
{#{% set hreflang_x = hreflang_start_x ~ path('notaris_frontend_news_page_order', {locale: xdef_lang, page: currentpage, otype: ordertype}) %}#}
{#{% endif %}#}
<link rel="alternate" hreflang="x-default"
href="{{ hreflang_x }}" />
{% endif %}
<link rel="canonical" href="{{ canonicallink }}" />
{% endblock %}
{% block extrameta %}
{{ parent() }}
<meta name="keywords" content="{{ subsite.meta.metaKeywords }}"/>
<meta name="description" lang="{{ locale }}" content="{{ subsite.meta.metaDescription }}"/>
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ canonicallink }}" />
{#{% if subsite.meta.ogTitle != '' %}#}
{#<meta property="og:title" content="{{ subsite.meta.ogTitle }}" />#}
{#{% endif %}#}
<meta property="og:title" content="{{ headTitle }}" />
{% if subsite.slug == 'nieuws-pers' or subsite.slug == 'nouveautes' %}
{% if section.meta.ogDescription != '' %}
<meta property="og:description" content="{{ section.meta.ogDescription }}" />
{% endif %}
{% else %}
{% if subsite.meta.ogDescription != '' %}
<meta property="og:description" content="{{ subsite.meta.ogDescription }}" />
{% endif %}
{% endif %}
{% endblock %}
{% block body %}
{% if ordertype == '' %}
{% set ordertype = 'desc' %}
{% endif %}
<section class="content u-padding-top-large">
{% set isPreview = false %}
{% if preview is defined %}
{% set isPreview = true %}
{% endif %}
{% if isPreview %}
<div id="preview-label">PREVIEW</div>
{% endif %}
{{ include('@NotarisFrontend/module/sidenav.html.twig', {'subsite': subsite, 'preview': isPreview }) }}
<!-- news -->
<div id="content-center" class="content-center-large {{ subsite.stylesheet }}">
<div id="content-center-header">
<article class="niveau3 fillcolor">
<div class="article-content">
<p>{{ totalnews }} {{ 'nw_bericht' | trans | raw }}{% if totalnews > 1 %}{{ 'nw_berichten_meervoud' | trans | raw }}{% endif %}, {{ 'nw_ordering' | trans | raw }}<br />
{% if ordertype == 'desc' %}
{% if subsiteslug != '' %}
{{ 'nw_van' | trans | raw }} {{ 'nw_nieuw' | trans | raw }} > {{ 'nw_oud' | trans | raw }} | <a href="{{ path('notaris_frontend_subsite_news_order', {'otype': 'asc', 'subsiteslug': subsiteslug}) }}">{{ 'nw_oud' | trans | raw }} > {{ 'nw_nieuw' | trans | raw }}</a>
{% else %}
{{ 'nw_van' | trans | raw }} {{ 'nw_nieuw' | trans | raw }} > {{ 'nw_oud' | trans | raw }} | <a href="{{ path('notaris_frontend_news_order', {'otype': 'asc'}) }}">{{ 'nw_oud' | trans | raw }} > {{ 'nw_nieuw' | trans | raw }}</a>
{% endif %}
{% else %}
{% if subsiteslug != '' %}
<a href="{{ path('notaris_frontend_subsite_news_order', {'otype': 'desc', 'subsiteslug': subsiteslug}) }}">{{ 'nw_van' | trans | raw }} {{ 'nw_nieuw' | trans | raw }} > {{ 'nw_oud' | trans | raw }}</a> | {{ 'nw_oud' | trans | raw }} > {{ 'nw_nieuw' | trans | raw }}
{% else %}
<a href="{{ path('notaris_frontend_news_order', {'otype': 'desc'}) }}">{{ 'nw_van' | trans | raw }} {{ 'nw_nieuw' | trans | raw }} > {{ 'nw_oud' | trans | raw }}</a> | {{ 'nw_oud' | trans | raw }} > {{ 'nw_nieuw' | trans | raw }}
{% endif %}
{% endif %}
</div>
</article>
</div>
{% if totalpages > 1 %}
<div class="prevnext-pages border-bottom">
{% if currentpage + 1 != 1 %}
{% if currentpage == 1 %}
{% if subsiteslug != '' %}
<a href="{{ path('notaris_frontend_subsite_news_order', {'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% else %}
<a href="{{ path('notaris_frontend_news_order', {'otype': ordertype}) }}">{{ 'vorige' | trans | raw }}</a>
{% endif %}
{% else %}
{% if subsiteslug != '' %}
<a href="{{ path('notaris_frontend_subsite_news_page_order', {'page': currentpage - 1, 'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% else %}
<a href="{{ path('notaris_frontend_news_page_order', {'page': currentpage - 1, 'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% endif %}
{% endif %}
{% else %}
<span>{{ 'vorige' | trans | raw }}</span>
{% endif %}
{% set count = 0 %}
{% set vispages = 4 %}
{% set index = 0 %}
{% if currentpage + 1 <= 2 %}
{% set start = 1 %}
{% else %}
{% set start = currentpage + 1 - 2 %}
{% set vispages = vispages + 1 %}
{% endif %}
{% if start + 4> totalpages %}
{% set start = totalpages - 3 %}
{% endif %}
{% if start < 1 %}
{% set start = 1 %}
{% endif %}
{% if start != 1 %}
<span>...</span>
{% endif %}
{% for i in start..totalpages %}
{% set count = count + 1 %}
{% if count <= vispages %}
{% set index = i %}
{% if i == currentpage + 1 %}
<span class="current">{{ i }}</span>
{% else %}
{% if subsiteslug != '' %}
{% if i == 1 %}
<a href="{{ path('notaris_frontend_subsite_news_order', {'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ i }}</a>
{% else %}
<a href="{{ path('notaris_frontend_subsite_news_page_order', {'page': i - 1, 'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ i }}</a>
{% endif %}
{% else %}
{% if i == 1 %}
<a href="{{ path('notaris_frontend_news_order', {'otype': ordertype}) }}">{{ i }}</a>
{% else %}
<a href="{{ path('notaris_frontend_news_page_order', {'page': i - 1, 'otype': ordertype}) }}">{{ i }}</a>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if index != totalpages %}
<span>...</span>
{% endif %}
{% if currentpage + 1 != totalpages %}
{% if subsiteslug != '' %}
<a href="{{ path('notaris_frontend_subsite_news_page_order', {'page': currentpage + 1, 'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ 'volgende' | trans | raw }}</a>
{% else %}
<a href="{{ path('notaris_frontend_news_page_order', {'page': currentpage + 1, 'otype': ordertype}) }}">{{ 'volgende' | trans | raw }}</a>
{% endif %}
{% else %}
<span>{{ 'volgende' | trans | raw }}</span>
{% endif %}
</div>
{% endif %}
<section class="no-margin o-tabpannel o-tabpannel--neutral">
<div id="info-content" class="o-tabpannel__navigation__items">
{% for newsitem in news %}
{% if subsiteslug == '' %}
<a data-slug="{{ newsitem.slug }}" class="o-tabpannel__item u-color-black u-padding-left-small u-padding-right-small js-info-news-content" href="{{ path('notaris_frontend_news_detail', {'slug': newsitem.slug}) }}">
{% else %}
<a data-slug="{{ newsitem.slug }}" class="o-tabpannel__item u-color-black u-padding-left-small u-padding-right-small js-info-news-content" href="{{ path('notaris_frontend_subsite_news_detail', {'slug': newsitem.slug, 'subsiteslug': subsiteslug }) }}">
{% endif %}
<h2 class="u-h3 u-margin-none">
{% if newsitem.isPers %}
<div class="c-tooltip c-tooltip--top u-text-inline">
<span class="{% if lastPart == subsite.slug %}u-bg-{{ subsite.stylesheet }} {% else %}u-bg-primary {% endif %}u-color-white o-tabpannel__label">{{ 'nw_pm' | trans }}</span>
<p class="c-tooltip__news{% if lastPart == subsite.slug %} u-bg-{{ subsite.stylesheet }}{% endif %}">{{ 'nw_pm_meaning' | trans }}</p>
</div>
{% endif %}
{{ newsitem.title }}
</h2>
<p class="u-margin-top-tiny">
{# {% set txt = newsitem.introduction %} #}
{% if newsitem.introduction == '' %}
{% set words = newsitem.text | striptags | split(' ') %}
{% else %}
{% set words = newsitem.introduction | striptags | split(' ') %}
{% endif %}
{{ newsitem.publicationDate | localdate }} -
{% for word in words|slice(0, 22) %}
{% if loop.last and words|length > 22 %}
{{ word | replace({'.':''}) | raw }}...
{% else %}
{{ word | raw }}
{% endif %}
{% endfor %}
</p>
</a>
{% endfor %}
</div>
</section>
{% if totalpages > 1 %}
<div class="prevnext-pages">
{% if currentpage + 1 != 1 %}
{% if currentpage == 1 %}
{% if subsiteslug != '' %}
<a href="{{ path('notaris_frontend_subsite_news_order', {'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% else %}
<a href="{{ path('notaris_frontend_news_order', {'otype': ordertype}) }}">{{ 'vorige' | trans | raw }}</a>
{% endif %}
{% else %}
{% if subsiteslug != '' %}
<a href="{{ path('notaris_frontend_subsite_news_page_order', {'page': currentpage - 1, 'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% else %}
<a href="{{ path('notaris_frontend_news_page_order', {'page': currentpage - 1, 'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% endif %}
{% endif %}
{% else %}
<span>{{ 'vorige' | trans | raw }}</span>
{% endif %}
{% set count = 0 %}
{% set vispages = 4 %}
{% set index = 0 %}
{% if currentpage + 1 <= 2 %}
{% set start = 1 %}
{% else %}
{% set start = currentpage + 1 - 2 %}
{% set vispages = vispages + 1 %}
{% endif %}
{% if start + 4> totalpages %}
{% set start = totalpages - 3 %}
{% endif %}
{% if start < 1 %}
{% set start = 1 %}
{% endif %}
{% if start != 1 %}
<span>...</span>
{% endif %}
{% for i in start..totalpages %}
{% set count = count + 1 %}
{% if count <= vispages %}
{% set index = i %}
{% if i == currentpage + 1 %}
<span class="current">{{ i }}</span>
{% else %}
{% if subsiteslug != '' %}
{% if i == 1 %}
<a href="{{ path('notaris_frontend_subsite_news_order', {'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ i }}</a>
{% else %}
<a href="{{ path('notaris_frontend_subsite_news_page_order', {'page': i - 1, 'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ i }}</a>
{% endif %}
{% else %}
{% if i == 1 %}
<a href="{{ path('notaris_frontend_news_order', {'otype': ordertype}) }}">{{ i }}</a>
{% else %}
<a href="{{ path('notaris_frontend_news_page_order', {'page': i - 1, 'otype': ordertype}) }}">{{ i }}</a>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if index != totalpages %}
<span>...</span>
{% endif %}
{% if currentpage + 1 != totalpages %}
{% if subsiteslug != '' %}
<a href="{{ path('notaris_frontend_subsite_news_page_order', {'page': currentpage + 1, 'otype': ordertype, 'subsiteslug': subsiteslug}) }}">{{ 'volgende' | trans | raw }}</a>
{% else %}
<a href="{{ path('notaris_frontend_news_page_order', {'page': currentpage + 1, 'otype': ordertype}) }}">{{ 'volgende' | trans | raw }}</a>
{% endif %}
{% else %}
<span>{{ 'volgende' | trans | raw }}</span>
{% endif %}
</div>
{% endif %}
</div>
{% include '@NotarisFrontend/navigation/mobilesubnav.html.twig' with {'websiteSlug': subsite.slug, 'isSven':false, 'isHome':false, 'subsite': subsite} %}
</section>
{% endblock %}
{% block extrajs %}
<script>
//adresbook();
$(document).ready(function(){
$('.js-info-news-content').click(function(e){
e.preventDefault();
var href = $(this).attr('href');
var slug = $(this).attr('data-slug');
$.getJSON('{{ path('notaris_frontend_news_clicked') }}/' + slug, function(result){
window.location.href = href;
});
});
});
</script>
{% endblock %}