pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
988 stars 662 forks source link

Add-PnPJavascriptLink: scriptlink doesn't get added to modern pages #612

Closed szotyar closed 6 years ago

szotyar commented 7 years ago

Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Apply-SPOProvisioningTemplate or Get-SPOProvisioningTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/OfficeDev/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/officedev/PnP-Sites-Core/issues

Reporting an Issue or Missing Feature

I am using Add-PnPJavascriptLink command to add a scriptlink to my pages. It gets added to classic pages, but not modern pages.

Expected behavior

It would be great to add it to modern pages too. I try to customize all sharepoint pages in a site collection and I would like to do it without modifying the masterpage.

Actual behavior

I can see the code in the page source of classic pages, but not in modern pages.

Steps to reproduce behavior

Connect-PnPOnline $url -Credentials $credential Add-PnPJavaScriptLink -Name "script" -Url "link to my script"

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

2.9.1611.0

How did you install the PnP-PowerShell Cmdlets?

prvanbeek commented 7 years ago

Seeing the same behavior. Any update on why this happens and the fix?

ghost commented 7 years ago

Modern experience does not support custom actions. This is a limitation (or as designed) by the modern experience.

The "modern" experiences allow certain user custom actions to be surfaced in the new user interface, but not all user action configurations which are supported by "classic" mode are supported in the "modern" experience.

EditControlBlock Yes, these entries show up as custom menu items CommandUI.Ribbon Yes, these entries show up as toolbar items All other locations (e.g. scriptlink) Sorry, these user custom actions won't work

https://msdn.microsoft.com/en-us/pnp_articles/modern-experience-customizations-customize-lists-and-libraries