سؤال

Chris Cundy shared a link. 2 hrs Is JsLink disabled in SharePoint Online?

I have been trying to get a CSR script that styles an annoucements list to work via JsLink however the style is not being rendered.

Has JsLink been deprecated by Microsoft in SharePoint Online??

The below link is what I'm trying to get working.

Any ideas??

https://www.c5insight.com/Resources/Blog/tabid/148/entryid/653/how-you-make-sharepoint-announcements-grab-attention-easily-using-csr.aspx

هل كانت مفيدة؟

المحلول

In SharePoint Admin Center you have to enable "Custom Script" options to "Allow". After this change, system will take around 24 hours to affect the site collection settings. Then that JS Link option will show-up.

Allow users to run custom script on personal sites Allow users to run custom script on self-service created sites O365 Admin--> SharePoint --> Settings

If you want it to be run right away after these settings than use below mentioned PwoerShell commands:

Connect-SPOService -Url https://sitename-admin.sharepoint.com/ -credential admin@sitename.onmicrosoft.com

Set-SPOSite -Identity https://sitename.sharepoint.com/ -DenyAddAndCustomizePages $false

echo "Successfully completed."

pause

in addition, you can also Use SharePoint Designer for changing JSLink. Open your list in SharePoint Designer, then click to the view, and in the page editor you should be able to find the JSLink tag. Change its contents and that's it.

Reference:

Where is the "JS Link" property?

نصائح أخرى

JSLink is not supported with modern lists and libraries; see: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/modern-experience-customizations-customize-lists-and-libraries

JSLink however should work with classic pages in SharePoint Online.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top