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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to show/hide a web...
Power Pages
Answered

How to show/hide a weblink

(0) ShareShare
ReportReport
Posted on by 265

Hi,

I want to set the condition to visible Pages web link after checking some condition. 

Erandi_1-1706853796960.png

 

Above links are in Default web link sets. But i want set a condition to control of visibility of pages... If I  can't try above requirement. I want to hide Home | Pages | Contacts us web links until my condition is succeed. 

 

Thank you

 

 

 

Categories:
I have the same question (0)
  • jyotiatharv Profile Picture
    69 on at

    @Erandi  Create a new weblinkset with only one weblink Home in it

    jyotiatharv_0-1706858500593.png

    In the header web template check condition and show the default weblink set if condition is met else show new weblink containing Home weblink only

  • Inogic Profile Picture
    1,297 Moderator on at

    Hi @Erandi ,

    It seems that you need to hide the  pages ,after few condition in Power pages.

     

    There is OOB ways that Microsoft have been provided in Power pages portal.

      

    The following steps outline how to configure page permissions to restrict access to a specific page.

    1. Sign in to Power Pages.
    2. Select your site, and then select Edit.
    3. In the page navigation, select the ellipses (...) to the right of a page, and then select Page settings.
    4. In the side tab, select Permissions.
    5. Select I want to see who can view this page.
    6. In the list, select the Authenticated Users web role

         

    Inogic_0-1707391134618.png

     

    Output:-

    Inogic_1-1707391134630.png

     

    In addition to this, you can modify the visibility conditions on the header web template according to your specific requirements.

     

    Below, I have hide the web links based on web roles. If the user is authenticated, then the first web link set (home) is hidden.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

    <script type="text/javascript">

     

    var usersRol = '{{user.roles}}';

    console.log(usersRol);

    alert("test2");

     

    if(usersRol.includes("Authenticated")){

      var containerr = $(".container")[0]; // Change the value of [] according to your web link set

      $($(containerr).find(".weblink")[0]).hide();

    }

     

    // Your existing code goes here

    </script>

    Inogic_2-1707391134637.png

    You can refer to the provided forum question for further guidance.

    https://powerusers.microsoft.com/t5/General-Discussions/How-to-hide-Main-Navigation-in-power-pages-portal/td-p/2584218


    Thanks!

    Inogic Professional Services

    An expert technical extension for your techno-functional business needs

    Power Platform/Dynamics 365 CRM

    Drop an email at crm@inogic.com

    Service:  http://www.inogic.com/services/ 

    Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

  • Verified answer
    Lucas001 Profile Picture
    2,595 Super User 2026 Season 1 on at

    Hi @Erandi,

     

    is your problem solved or do you need further guidance?

    @Inogic provided all needed information as far as I understood your problem.

     

    If it is solved, please close the thread.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 33

#2
Fubar Profile Picture

Fubar 31 Super User 2026 Season 1

#3
sannavajjala87 Profile Picture

sannavajjala87 28 Super User 2026 Season 2

Last 30 days Overall leaderboard