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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Web page name and head...
Power Pages
Unanswered

Web page name and header modification

(0) ShareShare
ReportReport
Posted on by 57

Hello Everyone,

I am trying to get the current web page name by using {{page.adx_name}} in my header code but it's taking too much time to reflect I've had to refresh 2-3 times to update the web page name and it's affecting my requirement.(I am using Enhanced Data Model of power pages)

Is there any solution to do this, like getting the current web page name in which I am?

Actual Requirement - I have to create a header that shows the name of the web page dynamically in which I am. Is there any way to achieve this?
Also, the Web page name that will be visible in the header as a web link should be in the center of the header.

If anybody can help me on this it would be very helpful.

Thanks 

Categories:
I have the same question (0)
  • Akah Mandela Profile Picture
    445 on at

    You could use the following javascript function as long as your pages got a title tag

    const titleElement = document.getElementsByTagName("title")[0];
    // The title of the HTML page
    const pageTitle = titleElement.innerText;

    Remember to place this code snippet in your header section, and it should dynamically get the web page name as desired.

  • Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    If this is you creating a new page and it not showing up straight away, then make sure you have cleared the Portal Cache (from the Designer re-preview the site - but have had this not work, or manually <yoursiteurl>/_services/about when logged in to the site as a user with the Administrators web role).

     

    Beyond that, it could be the Header output caching https://learn.microsoft.com/en-us/power-pages/configure/enable-header-footer-output-caching which you can either use (wrap the code you don't want cached) the Liquid substitute tag or turn off with Site Settings (both mentioned in that link)

  • _Mayank Profile Picture
    57 on at

    Hi @Fubar 
    The webpage currently displays "{{page.adx_name}}" upon loading, but there's a delay in updating the page name when navigating from the header. It takes a few refreshes before the new page name reflects accurately. I aim to ensure that the webpage name updates promptly whenever I navigate to a new page, without the need for multiple refreshes.

  • _Mayank Profile Picture
    57 on at

    Hi @mandela ,
    This piece of code is working fine to get the page title,
    I've to create a condition using these titles to display the weblink set and I cannot assign javascript value to a liquid variable.

    My condition:

                {% if webpage_name contains 'Test' %}
                {% assign primary_nav = weblinks["Default"] %}
                {% else %}
                {% assign primary_nav = weblinks["Custom Navigation"] %}
                {% endif %}
                {% if primary_nav %}

    please help how can I achieve this.
  • Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    Did you try turning off the Header output caching as per the link in my previous post?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard