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 / Power Page Main Page L...
Power Pages
Answered

Power Page Main Page Login Buttons and Subforms

(0) ShareShare
ReportReport
Posted on by 18

Hi all,

 

Please pardon me if I am asking stupid questions but am really new to power pages.

My team and me have tried to do many online researches and watched videos over and over again.

So to quickly touch base on the questions that we have namely:

 

  1. I notice that the "edit header" on each page is code based in VS. I had the impression that power pages including login/sign-up button can be done seamlessly through the designer interface but apparently not. Just want to know from the community here is that really the case? We still have to control via VS codes on the buttons visibility on the top of every page that we build?
  2. If I intend to show the main landing page after user has successfully registered and logged in, is there any available online video or step by step guide that can point us to the right direction?
  3. Lets say we have 2 tables from a source process, can be sales, purchase, job or anything (eg, purchase header and lines). We are having difficulty trying to display the lines details under a specific document header.

Really appreciate any help that we can receive here, thanks in advance.

Categories:
I have the same question (0)
  • Lucas001 Profile Picture
    2,434 Super User 2025 Season 2 on at

    Hi @jason_lim,

     

    1. for the header, have a look here: https://www.agarwalritika.com/post/understanding-header-in-power-apps-portals

    Depending on what you want to do you can either adjust the header on different levels in the portal management app. If you need highly different headers you could add a new Webtemplate and use that one inside your websites.

     

    2. for the login landing page it depends a bit on what you actually want to achieve. As an example you can force the registration, full registration with all needed details inside the profil form, with the website setting Profile/ForceSignUp = true. If it is enough for you to direct the people after that registration you could use the success message object length which is 1 after submission to than use javascript.

     

    3. Could you give us some more information which lines you want to display? I guess you are using a list inside power pages to display the data?

  • jason_lim Profile Picture
    18 on at

    Hi Lucas,


    Thanks for the pointers.

     

    I still have some doubts though if you can guide me with it.

    1. I check out that link and try to navigate to make.powerapps.com but could not find the web templates that Agarwalritika mentions. What I could see is "app templates".For header, is it only able to be control via powerapp and not within the power page itself?
       
    2. For example, after login (1st screenshot) and after login shows the home/main page with the buttons to navigate
      jason_lim_4-1687235400214.pngjason_lim_5-1687235421343.png

       

    3. Ok lets give it a simple example, purchase order and lines.
      I wonder if it is easier to create app via powerApp then display it by embedding on Powerpage - is this the correct way to do?
      jason_lim_6-1687235442129.png

       

  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @jason_lim ,

     

    1- For headers in Power Pages, we have Web Template available in Portal Management App. If you want to customize Header, you can play around with liquid. For second part, you don't have direct control available for login/signup page on your Portal. 

     

    2- If you intend to show the main landing page after user has successfully registered and logged in, you can do this by using liquid in Header Web Template. Here is example script where we are redirecting every user to Sign In Page if they are not logged in. 

     

    {% if user %}
    //Check your default page url after login
    if(window.location.href != "" && (window.location.href=="https://myportal.powerappsportals.com/Home")){
     window.location.href = "./MyLandingPage";
    }
    {% else %}
     window.location.href = "https://myportal.powerappsportals.com/SignIn";

     

    3- If you want to set Link/Sub-Links in Header there are two ways:

    • You can move/update pages from Primary to Secondary Navigation or make Sub-Links by drag and drop using Power Pages Designer Studio.
    • You can navigate to Portal Management App -> Web Links and set order/update navigation from there as well.

     

    If you need more clarity or have more questions, feel free to ask.

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • jason_lim Profile Picture
    18 on at

    Hi Saud,

     

    Thanks for the sample code which I did try to test with.

    Wanted to check when you mention Header Web Template, do you refer to below?

    jason_lim_0-1687252603635.png

    But I see a bunch of standard codes here, is it ok to paste your code anywhere at beginning or end of this code?

    Because I tried to use your code and create a new Web Template in portal management but I don't see anywhere at the Page Designer for me to use this Web Template.

    jason_lim_1-1687252648472.png

     

    With regards to your point 3, am currently trying it. I have also created a simple Model Driven App with purchase order header and lines. Would you be able to guide me how can I embed the App I created into my pages and display it? My sincere appreciation to this

  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @jason_lim ,

     

    You're right you have to put your liquid or JavaScript in your Header Web Template. You don't need to create a new one you can edit the existing one as you pointed out in your screenshot. For more clarity I have click on Edit code and attached a screenshot for reference.

     

    saudali_25_0-1687254562209.png

     

    For the point no. 3 managing your site header menu is really simple using Power Pages Design Studio. If you can see on the left-hand side, you can see list of available pages. If you click on three dots (available Infront of every page) a menu will appear where you can either move your page to Main Navigation (means it will appear as main menu option in, you site menu on Portal). If you don't want to show it in main menu you can either move it to Other Pages (which we generally use where we don't want to show a Page in main or sub-menu). 

    If you want to change order of Pages/Main Menu you can drag and drop from Power Pages Design Studio Structure Tree.

     

    saudali_25_1-1687254980817.png

     

    Hope this helps you. 

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • jason_lim Profile Picture
    18 on at

    Hi Saud,

     

    Thanks for sharing and leading me slowly.

    Appreciate your patience.

     

    Let me try for your 3rd point explanation detail later and if I have question will let you know.

    With regards to 1st point, I tried to follow your coding but it seems like did not work but I believe I may have missed out on some parameters as the screenshot got cut-off by a little bit. Would you be able to share the code in text please?

     

    jason_lim_0-1687340899767.png

     

  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @jason_lim ,

     

    Happy to help you out. Sure, here is the explanation:

     

    For example if you want to redirect visitors from Home default page to SignIn page if the user is not logged in and Redirect to Contcat Us when the user logged in then you have to write the below script inside Home page Web Template.

    {% if user %}
    <script>
     window.location.href='./contact-us/';
    </script>
    {% else %}
    <script>
     window.location.href='./SignIn/';
    </script>
    {% endif %}

     

    Let me know, if you have anything else to ask.

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • jason_lim Profile Picture
    18 on at

    Hi Saud,

     

    Sorry I was a bit slow in finding out how the "Web Template" really works but now I get the idea now.

    Basically I will have to go and modify code at "Web Template" and Sync, I was clicking on the Sync button directly.

    Anyway, I tried with the following code but it doesn't work - seems that I may have missed some syntax and it is showing the text directly now on landing page.

     

    {% if user %}
    window.location.href = "https://<sample>.powerappsportals.com";
    {% else %}
    window.location.href = "https://<sample>.powerappsportals.com/SignIn";
    {% endif %}

     

    jason_lim_0-1687456128589.png

     

  • Verified answer
    Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @jason_lim ,

     

    Can you post a screenshot from your Web Template where you have placed this script? It seems you're missing something that's why it's not working and showing as a text on Page. You have to enclose your JS code in <script> tag as below:

     

    {% if user %}
    // Do nothing - By user will be redirected to Profile page
    {% else %}
    <script>
     if(window.location.href != "" && (window.location.href=="https://yourportal.powerappsportals.com/" || window.location.href=="https://yourportal.powerappsportals.com")){
     window.location.href = "https://yourportal.powerappsportals.com/SignIn";
     }
    </script>
    
    {% endif %}

     

     

    Feel free to ask, if you have any queries.

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • jason_lim Profile Picture
    18 on at

    Hi Saud,

     

    There you go, my original placement

    jason_lim_0-1687477688885.png

     

    After I copied your entire code, it works. Thanks however I see that text on my home page. Should I remove the //Do nothing... text? In addition, I noticed I still can manually paste the URL eg domain/pages, domain/contact-us and get there without login. Do I have to paste your code on every single pages?

     

    Once again, thanks for your code and advice!

    jason_lim_1-1687478022632.png

     

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
Fubar Profile Picture

Fubar 89 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard