1

I am trying to enable login feature for selected pages in SXA site using existing header and footer components.

There is an existing header component with option like a,b,c. I need to add login feature/button along with a,b,c. can i do this with existing header component or do i have to create a new one only for selected pages?

1

I am assuming you created the header as a partial view. That would make sense and you although not exactly stated in the question, it feels safe to assume that.

In that case you have a few options:

  • Add the login feature to the header and use personalization rules to hide/show it on the pages where you need it (this does require some logic in the selection of those pages, e.g. same template).
  • Create another partial view (and other page designs) - I wouldn't go for this option, but without full knowledge of your platform it is hard to determine what is best
  • Add a placeholder to the partial view so you can add renderings to it. This way you can add the feature where needed (could be a good solution if you do not have many pages where it is needed)
  • I have created a header partial design for my site using navigation rendering and have selected home item from tree for Start Page in Navigatin Settings. After user gets loggin in, I have to change header to have logout button in it instead of login. How can i do this? Should I need to have controller rendering for hearder? – Newbie Sep 22 at 18:34
  • You could put both buttons there (login and logout) and use personalization to hide them when not relevant. – Gatogordo Sep 22 at 18:53
  • I have set a folder in my site as a Start Page field for Navigation Settings section under Control Properties. Because of this, I am unable to set personalization for Login and Logout links separately. Do I need to set it for Navigation itself? – Newbie Sep 22 at 20:38
  • You should get the logout and login out of the navigation and display them seperately. – Gatogordo Sep 23 at 7:46
  • I added personalisation like you suggested removing Login and Logout from navigation. Now the probelm I am facing is, after login still page shows Login button. After a page refresh, it is changed to Logout. How can i fix this? – Newbie Sep 23 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.