SOLVED

How to show logged in Name and Location

Copper Contributor

Hi,

 

I have a requirement to display the name and location of the logged-in user. Getting the name and location isn't an issue but how to place it using the Application Customizer is?

 

Any suggestion?

 

anirudhaditya_0-1652257793661.png

 

1 Reply
best response confirmed by anirudhaditya (Copper Contributor)
Solution

@anirudhaditya 

Application customizers currently provide 2 places to inject your display elements, one at the top of the page, which is right under the Suite Bar in your image, and one at the bottom of the page.  There is no option to add/change anything in the Suite Bar as part of an SPFx solution.

 

It is possible to do DOM manipulation if you really need it in the Suite Bar, but that is not a recommended approach since Microsoft can (and does) change the Identifiers and Classes for Office 365. If they change what you are using in your selector, your solution WILL break.

 

Check out the Extension Samples at https://aka.ms/m365pnp to get ideas on alternative ways to accomplish your result. 

 

Don Kirkham

Microsoft MVP, Office Development

 

Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

1 best response

Accepted Solutions
best response confirmed by anirudhaditya (Copper Contributor)
Solution

@anirudhaditya 

Application customizers currently provide 2 places to inject your display elements, one at the top of the page, which is right under the Suite Bar in your image, and one at the bottom of the page.  There is no option to add/change anything in the Suite Bar as part of an SPFx solution.

 

It is possible to do DOM manipulation if you really need it in the Suite Bar, but that is not a recommended approach since Microsoft can (and does) change the Identifiers and Classes for Office 365. If they change what you are using in your selector, your solution WILL break.

 

Check out the Extension Samples at https://aka.ms/m365pnp to get ideas on alternative ways to accomplish your result. 

 

Don Kirkham

Microsoft MVP, Office Development

 

Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post