question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using a control in SharePoint Top Placeholder

See original GitHub issue

Category

[ ] 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:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
AJIXuMuKcommented, Oct 19, 2018

Here is an example how to add React control in the header. Hope it helps.

1reaction
PooLPcommented, Oct 19, 2018

Hi, SecurityTrimmedControl is a React component so this don’t work with simple innerHTML.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found