• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

Contributor ,
Sep 16, 2016 Sep 16, 2016

Copy link to clipboard

Copied

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

TOPICS
Web apps

Views

316

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 17, 2016 Sep 17, 2016

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines