1 Reply Latest reply on Sep 17, 2016 8:40 AM by Carla@home

    Multilingual website: web apps - detail template view - how to load different templates

    Carla@home Level 1

      For a listing website I need to display the list view items and the details pages in English and Dutch.

      The bottleneck is the details view for the Dutch page (the details view in English works).

       

      How can I assign “a dutch template” to a page when it’s only possible to assign one template to "Web app item - Item Details - Template” ?

      I can’t figure out on how to make {{ item.url }} (=the link for the details view of the item) to load an other template.

      (Btw. it’s not possible to set culture to Dutch in site domains, because is not implemented )

       

      Thanks, for any help.

      Kind regards,

      Carla

        • 1. Re: Multilingual website: web apps - detail template view - how to load different templates
          Carla@home Level 1

          I’ve figured out some sort of workaround.

          Based on the previous url link (= the previous page where a site visitor clicks on the link for a details view ) the details template will be loaded/rendered for the applicable language.

          The previous url contains /nl for the dutch pages to load.

          In an “over-all” template I’ve placed includes for the <head> and <scripts> and {tag_pagecontent}. This template serves as the details template and is assigned to the applicable web app item in “item details” “template”.

           

          code example

          {% capture pathCap -%} {module_referreraddress} {% endcapture -%}

           

                  {% if {{pathCap}} contains '/nl'-%}

                  <p> true: nederlands </p> <! — test nl —>

                  {% include"/Layouts/Custom/layouts/myDutchTemplate.tpl" -%}

           

                  {% else -%}

                  <p>false: other </p> <! — test other —>

                  {% include"/Layouts/Custom/layouts/myOtherTemplate.tpl" -%}

           

                  {% endif -%}

           

          I think that there are better solutions. Feel free to post one.

           

          Kind regards,

          Carla