Using a control in SharePoint Top Placeholder
See original GitHub issueCategory
[ ] Enhancement
[ ] Bug
[x] Question
I am developing a SharePoint SPFx Placeholder. One of the items in the placeholder must be security trimmed. I’m therefore using the SecurityTrimmedControl to achieve that. But in the SPFx documentation the HTML that is rendered into the Top Placeholder is insereted into an innerHTML property like this:
this._topPlaceholder.domElement.innerHTML =
`
<HTML for Placeholder>
`
I have tried to insert the following in the innerHTML:
<SecurityTrimmedControl context={this.props.context} level={PermissionLevel.remoteWeb} remoteSiteUrl="https://[tenant].sharepoint.com/sites/[site]" permissions={[SPPermission.viewPages]}>
<p>I have access</p>
</SecurityTrimmedControl>
But this does not work. How can I make it work with the innerHTML property?
Thanks in advance!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Use page placeholders from Application Customizer (Hello ...
Application Customizers provide access to well-known locations on SharePoint pages that you can modify based on your business and functional ...
Read more >Using a control in SharePoint Top Placeholder #155 - GitHub
Hi, SecurityTrimmedControl is a React component so this don't work with simple innerHTML. 1 asadullah313 ...
Read more >PnP Placeholder Control for SPFx - Nanddeep Nachan Blogs
Open a command prompt. Create a directory for SPFx solution. ... Navigate to the above created directory. ... Run the Yeoman SharePoint Generator...
Read more >OTB Delegate controls and Content Placeholders in ...
This post on Delegate controls and Content Placeholders in SharePoint 2013 Publishing Master Page is an out come of one of my current...
Read more >How to place multiple SPFx Application customisers (created ...
You should be able to control order by defining sequence attribute on the <CustomAction> element.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is an example how to add React control in the header. Hope it helps.
Hi, SecurityTrimmedControl is a React component so this don’t work with simple innerHTML.