Closed rdormanHW closed 1 year ago
Hi @rdormanHW, unfortunately there is no easy way to disable these section. I didn't now about these properties. I'll flag it as an enhancement to expose them in the property pane configuration.
Thanks. Can this property also be available for custom templates, not just the default People view? Adding custom attributes to a persona card is a common requirement for us and this can only be achieved currently through the custom display template. I don't mind if it is a property pane option, or something we can flag/pass in as part of the display template or configuration file.
@rdormanHW Customization of the OOB people card is achieved via the Graph API https://docs.microsoft.com/en-us/graph/api/resources/profilecardproperty?view=graph-rest-beta. If the graph toolkit will read these settings and adapt, then this can happen in the web parts as well. Anything people card is outside of this project.
@wobba I'm not entirely sure I follow. According to this Microsoft documentation sections have to be turned off using JavaScript similar to the following:
import { MgtPersonCard } from @microsoft/mgt;
MgtPersonCard.config.useContactApis = false; MgtPersonCard.config.sections.profile = false;
Given I can't do JavaScript calls like this in the Handlebars template, where would I put this code? I am not asking you to change the web part. I just want to know if there is somewhere I can put this code so I can do it myself.
@rdormanHW there has to be a code change in the web part to support this. I was talking more about showing custom fields in the card, not sections - my mistake :)
Version used 4.2.3
Question When using the hover persona cards as part of the Search Results web part, is there a way to turn off sections of the hover card from the display template? In particular I am looking to hide the Emails and Files sections as well as the Skills and Experience section
Screenshots![image](https://user-images.githubusercontent.com/81604756/126258878-3b0e23b0-4f9e-4393-8394-20d38ceeb1a1.png)
Additional context My understanding is that MS provides the config object as part of MgtPersonCard to allow turning sections on and off similar to the code below:
import { MgtPersonCard } from
@microsoft/mgt
;MgtPersonCard.config.useContactApis = false; MgtPersonCard.config.sections.profile = false;
But I don't want to change the underlaying web part so I can still easily apply updates from here. So is there any way through the existing web part to do this?
Is there anywhere in the template or configuration I can include this sort of code?