src/Notaris/FrontendBundle/Resources/views/faq/index.html.twig line 1

Open in your IDE?
  1. {% extends '@NotarisFrontend/layout2017.html.twig' %}
  2. {% if notaryId is defined %}
  3.     {% set headTitle = info.header1  | replace({"<BR />":" "}) ~ ' - ' ~  subsite.pageTitle %}
  4. {% else %}
  5.     {% set headTitle = subsite.pageTitle %}
  6.     {% if subsite.slug != 'faq' %}
  7.         {% set headTitle = headTitle ~ " | " ~  'FAQ ' %}
  8.     {% endif %}
  9.     {% set headTitle = headTitle ~ ' ' ~ 'alg_basetitle' | trans %}
  10. {% endif %}
  11. {% block title %}
  12.         <title>{{ headTitle }}</title>
  13. {% endblock %}
  14. {% if subsite.slug == 'faq' %}
  15.     {% set canonicalLink = url_scheme ~ '://www.' ~ _context['url_' ~ locale] ~ path('notaris_frontend_faq')  %}
  16. {% else %}
  17.     {% set canonicalLink = url_scheme ~ '://www.' ~ _context['url_' ~ locale] ~ path('notaris_frontend_faq_subsite', {subsiteSlug: subsite.slug}) %}
  18. {% endif %}
  19. {% set linked_url_nl = url_nl ~ path('notaris_frontend_faq') %}
  20. {% set linked_url_fr = url_fr ~ path('notaris_frontend_faq') %}
  21. {% block extralinks %}
  22.     {% if subsite.slug == 'faq' %} {# for subsites i need to know the translation slug, no connection in database #}
  23.         {% set hreflang_start_nl = url_scheme ~ '://www.' ~ url_nl %}
  24.         {% set hreflang_start_x = url_scheme ~ '://www.' ~ url_nl %}
  25.         {% set hreflang_start_fr = url_scheme ~ '://www.' ~ url_fr %}
  26.         {% set hreflang_nl = hreflang_start_nl ~ path('notaris_frontend_faq') %}
  27.         {% set hreflang_x = hreflang_start_x ~ path('notaris_frontend_faq') %}
  28.         {% set hreflang_fr = hreflang_start_fr ~ path('notaris_frontend_faq') %}
  29.         <link rel="alternate" hreflang="nl-be"
  30.               href="{{ hreflang_nl }}" />
  31.         <link rel="alternate" hreflang="fr-be"
  32.               href="{{ hreflang_fr }}" />
  33.         {% if notaryId is defined %}
  34.             {% if sites | length > 0 %}
  35.                 {% for key, site in sites %}
  36.                     {% if key == 'nl' %}
  37.                         {% set hreflang_start_nl = scheme_url ~ '://' ~ site %}
  38.                     {% endif %}
  39.                     {% if key == 'fr' %}
  40.                         {% set hreflang_start_fr = scheme_url ~ '://' ~ site %}
  41.                     {% endif %}
  42.                 {% endfor %}
  43.                 {% set hreflang_start_x = scheme_url ~ '://' ~ sites[notaryId.locale] %}
  44.             {% endif %}
  45.             {% set hreflang_nl = hreflang_start_nl ~ path('notaris_frontend_faq') %}
  46.             {% set hreflang_fr = hreflang_start_fr ~ path('notaris_frontend_faq') %}
  47.             <link rel="alternate" hreflang="nl"
  48.                   href="{{ hreflang_nl }}" />
  49.             <link rel="alternate" hreflang="fr"
  50.                   href="{{ hreflang_fr }}" />
  51.         {% endif %}
  52.         {% set hreflang_x = hreflang_start_x ~ path('notaris_frontend_faq') %}
  53.         <link rel="alternate" hreflang="x-default"
  54.               href="{{ hreflang_x }}" />
  55.     {% endif %}
  56.     <link rel="canonical" href="{{ canonicalLink }}"  />
  57. {% endblock %}
  58. {% block extrameta %}
  59.     {{ parent() }}
  60.     <meta name="keywords" content="{{ subsite.meta.metaKeywords }}"/>
  61.     <meta name="description" lang="{{ locale }}" content="{{ subsite.meta.metaDescription }}"/>
  62.     <meta property="og:url" content="{{ canonicalLink }}" />
  63.     <meta property="og:type" content="website" />
  64.     <meta property="og:title" content="{{ headTitle }}" />
  65.     {% if subsite.slug == 'faq' %}
  66.         {% if section.meta.ogDescription != '' %}
  67.             <meta property="og:description" content="{{ section.meta.ogDescription }}" />
  68.         {% endif %}
  69.     {% else %}
  70.         {% if subsite.meta.ogDescription != '' %}
  71.             <meta property="og:description" content="{{ subsite.meta.ogDescription }}" />
  72.         {% endif %}
  73.     {% endif %}
  74.     {#{% if subsite.meta.ogTitle != '' %}#}
  75.         {#<meta property="og:title" content="{{ subsite.meta.ogTitle }}" />#}
  76.     {#{% endif %}#}
  77. {% endblock %}
  78. {% block body %}
  79.     <section class="content u-padding-top-large">
  80.         {{ include('@NotarisFrontend/module/sidenav.html.twig', {'subsite': subsite }) }}
  81.         <div id="content-center" class="content-center-large {{ subsite.stylesheet }}">
  82.             <section id="info" class="no-margin">
  83.                 <div id="info-content" class="niveau1 info-faq-content">
  84.                     {% if faqgeneral | length > 0 %}
  85.                         {% for sub in faqgeneral %}
  86.                             <div class="info-content-faq">
  87.                                 <a class="info-content-faq-question info-content-blocklink" href="#">
  88.                                     {% if loop.index0 == 0  %}
  89.                                         <h2>{{ sub.subsite.name }} ({{ sub.faqs | length }})</h2>
  90.                                     {% else %}
  91.                                         <h2>{{ 'faq_vragenover' | trans }} {{ sub.subsite.name }} ({{ sub.faqs | length }})</h2>
  92.                                     {% endif %}
  93.                                     <div class="cleaner">&nbsp;</div>
  94.                                 </a>
  95.                                 <article>
  96.                                     <ol>
  97.                                         {% set max = 3 %}
  98.                                         {% if loop.index0 < 1 or sub.subsite.slug == 'mybox' %}
  99.                                             {% set max = sub.faqs | length %}
  100.                                         {% endif %}
  101.                                         {% for faq in sub.faqs | slice(0, max) %}
  102.                                             <li><a class="no-border" data-id="{{ faq.id }}" href="{{ path('notaris_frontend_faq_subsite_detail', {'subsiteSlug': sub.subsite.slug, 'faqSlug': faq.slug}) }}" title="{{ faq.title }}">{{ faq.title }}</a></li>
  103.                                         {% endfor %}
  104.                                     </ol>
  105.                                     {% if max < sub.faqs | length  %}
  106.                                         <p>{{ 'faq_meervragen' | trans | raw }}<br />
  107.                                             <a href="{{ path('notaris_frontend_faq_subsite', {'subsiteSlug': sub.subsite.slug}) }}" title="{{ sub.subsite.name }}">{{ sub.subsite.name }}</a></p>
  108.                                     {% endif %}
  109.                                 </article>
  110.                             </div>
  111.                         {% endfor %}
  112.                     {% endif %}
  113.                     {% if faqsubsites | length > 0 %}
  114.                             <div class="info-content-faq">
  115.                                 <a class="info-content-faq-question info-content-blocklink" href="#">
  116.                                         <h2>{{ 'faq_vragenover' | trans }} {{ subsite.name }} ({{ faqsubsites | length }})</h2>
  117.                                     <div class="cleaner">&nbsp;</div>
  118.                                 </a>
  119.                                 <article class="show-article">
  120.                                     <ol>
  121.                                         {% for faq in faqsubsites %}
  122.                                             <li><a class="no-border" data-id="{{ faq.id }}" href="{{ path('notaris_frontend_faq_subsite_detail', {'subsiteSlug': subsite.slug, 'faqSlug': faq.slug}) }}" title="{{ faq.title }}">{{ faq.title }}</a></li>
  123.                                         {% endfor %}
  124.                                     </ol>
  125.                                 </article>
  126.                             </div>
  127.                     {% endif %}
  128.                 </div>
  129.             </section>
  130.         </div>
  131.         {#
  132.         <aside id="content-right">
  133.             {% if notaryId is defined %}
  134.                 {{ include('@NotarisFrontend/Sven/_sven_address.html.twig') }}
  135.             {% else %}
  136.                 {{ include('@NotarisFrontend/Module/notsearch_module.html.twig') }}
  137.             {% endif %}
  138.         </aside>
  139.         #}
  140.         {% include '@NotarisFrontend/navigation/mobilesubnav.html.twig' with {'websiteSlug': subsite.slug, 'isSven':false, 'isHome':false, 'subsite': subsite} %}
  141.     </section>
  142. {% endblock %}
  143. {% block extrajs %}
  144.     <script>
  145.         //adresbook();
  146.         //faq();
  147.         $(document).ready(function(){
  148.             $('.info-content-faq li a').click(function(e){
  149.                 var id = $(this).attr('data-id');
  150.                 var href = $(this).attr('href');
  151.                 $.getJSON('{{ path('notaris_frontend_faq_click') }}/'+id, function(data){
  152.                     window.location.href = href;
  153.                 });
  154.                 e.preventDefault();
  155.             });
  156.         });
  157.     </script>
  158. {% endblock %}