web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 6+BByV5i1XBtOYem50dgwj
Power Pages - General Discussions
Unanswered

Issue with getting Language Display Name using Power Pages Enhanced Data Model

Like (0) ShareShare
ReportReport
Posted on 11 Mar 2024 18:35:18 by 4

Hi All,

 

I'm trying to build language dropdown for a site that is using Enhanced Data model in Power pages. There are 2 languages English and French. On the portal I've modified the header code as follows so only the other language displays using the code below.

 

 

 

{% if website.languages.size > 1 %}
 {% for language in page.languages %}
 {% capture lang%}/{{language.code}}{%endcapture%}
 {% if request.url contains lang %}
 {% assign langCode = language.code %}
 {% else %}
 {% if user %}
 <a href="/{{ language.url_substitution }}">
 {% else %}
 <a href="/{{ language.code }}">
 {% endif %}
 <abbr title="{{ language.name }}">
 {{ language.code }}
 </abbr>
 <span>
 {{ language.name }} // I would like to use the value from display name here instead of name.
 </span>
 </a>
 {% endif %}
 {% endfor %}
{% endif %}

 

I've updated Display Name as Français but on the website, it shows French - France. 

 

 

PowePortalDev_1-1710182039760.pngPowePortalDev_0-1710182039594.png

 

 

 

 

Is there any liquid attribute in languages object that I can use to get the display name? Based on the Microsoft documentation I don't see an option to get display name.

 

Thanks

Categories:
  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on 05 Jun 2024 at 09:19:21
    Re: Issue with getting Language Display Name using Power Pages Enhanced Data Model

    Apologies, I understand the issue now

    I think the "Display Name" is always ignored, that's my experience anyway

    Please take a look at this thread that I replied recently with the steps to change the "Name" of the Language:

    Language Displayname for language settings on webs... - Power Platform Community (microsoft.com)

     

  • riclund Profile Picture
    14 on 04 Jun 2024 at 12:09:23
    Re: Issue with getting Language Display Name using Power Pages Enhanced Data Model

    Did you manage to resolve this @PowePortalDev? Weird that the display name isn't available as an attribute in EDM.

  • PowePortalDev Profile Picture
    4 on 12 Mar 2024 at 13:55:44
    Re: Issue with getting Language Display Name using Power Pages Enhanced Data Model

    Thanks for getting back @OliverRodrigues 

     

    The reason for writing custom code is I don't want to show a dropdown containing both languages. I only need to show another available language that user can switch. Moreover, I'm using same Liquid tags that are used in Language Dropdown web template. The issue that I've is {{ language.name }} displays the actual language name and not the display name. 

     

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on 12 Mar 2024 at 07:55:44
    Re: Issue with getting Language Display Name using Power Pages Enhanced Data Model

    Hi, is there any reason as to why you are building your custom code for the language dropdown?

    there is one available OOB in the Header Web Template:

    {% if website.languages.size > 1 %}
     <li class=' nav-item dropdown'>
     <a class=' nav-link dropdown-toggle' aria-roledescription='link' href='#' data-bs-toggle='dropdown' aria-label='{{ website.selected_language.name | escape }}' aria-haspopup='true' aria-expanded='false' title='{{ website.selected_language.name | escape }}'>
     <span class='drop_language'>{{ website.selected_language.name | escape }}</span>
     <span class='caret'></span>
     </a>
     {% include 'Languages Dropdown' %}
     </li>
     <li class=' nav-item divider-vertical' aria-hidden='true'></li>

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#2
Lucas001 Profile Picture

Lucas001 48 Super User 2025 Season 2

#3
KevinGador Profile Picture

KevinGador 44 Super User 2025 Season 2

Loading complete