script editor webpart
5 TopicsGetting the MArquee JQuery library to work
Hi I have a very simple javascript, Housed in @MikaelSvenson 's excellent script editor for the Modern UI. I am trying to get an announcement from the Announcements list to display on a modern UI Page from Right to Left across the page. Just like the old fashioned Marquee HTML element. But nothing is being displayed. CAn anyone see why ? <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/jquery.marquee/1.3.1/jquery.marquee.min.js"></script> <script type="text/javascript"> console.log("At start of REST Script"); $url = "https://<tenantname>.sharepoint.com"; $.ajax({ url: $url + "/_api/web/lists/getbytitle('Announcements')/items?select=*", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function(data) { console.log("Success"); console.log(data.d.results); var $dataArray = data.d.results; for (var $i in $dataArray) { console.log(data.d.results[$i].Title); var $str = $dataArray[$i].Body0; var $gtindex = $str.indexOf(">"); $gtindex = $gtindex + 1; $str1 = $str.substring($gtindex); console.log($str.substring($gtindex)); var $ltindex = $str1.indexOf("<"); console.log($ltindex); console.log($gtindex); var $length = $ltindex -$gtindex; var $innertext = $str1.substring(0,$ltindex); console.log($innertext); var $bodyHtml = "<li>" +$innertext + "</li>"; $("marquee").append($bodyHtml); } }, error: function(data) { console.log("Failure"); alert(JSON.stringify(error)); } }); $("#marquee").marquee(); console.log("At End of Script"); </script> <ul id="marquee" class="marquee" /> Apologies for some of the code I have been debugging it. Thanks Nigel1.2KViews0likes1CommentModernization: _'0x0D' is invalid within a JSON string. The string should be correctly escaped.
Problem Area Page Transformation: Error during the use of page transformation from PnP PowerShell Expected or Desired Behavior ConvertTo-PnPPage PnP PowerShell command should modernize the web part pages having script editor web parts. It should convert classic OOB script editor web parts to configured react script editor web part. PnP PowerShell Online Version Details: Name: SharePointPnPPowerShellOnline Version: 3.29.2101.0 Observed Behavior Getting the below error while trying to modernize the page with script editor web part: '0x0D' is invalid within a JSON string. The string should be correctly escaped. Path: $ | LineNumber: 0 | BytePositionInLine: 317. at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, JsonReaderException ex) at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack) at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader) at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at PnP.Core.Model.SharePoint.PageWebPart.set_PropertiesJson(String value) at PnP.Framework.Modernization.Transform.ContentTransformator.Transform(List`1 webParts) at PnP.Framework.Modernization.Transform.PageTransformator.Transform(PageTransformationInformation pageTransformationInformation) Page Transformation Settings Property Setting Engine version 1.9.1.0 Target Page Takes Source Page Name False Target Page Prefix Migrated_ Source Page Prefix Previous_ Copy Page Metadata True Set Author In Page Header False Replace Home Page With Default Home Page False Overwrite True Target Page Name Target Page Folder Target Page Folder Overrides Default Folder False Keep Page Specific Permissions False Remove Empty Sections And Columns True Handle Wiki Images And Videos True Add Table List Image As Image Web Part False Keep Page Creation Modification Information True Publish Created Page True Post As News False Disable Page Comments True Skip Url Rewrite False Skip Default Url Rewrite False Url Mapping File Skip Hidden Web Parts False Term Mapping File Skip Term Store Mapping False Skip User Mapping False User Mapping File L D A P Connection String Skip Telemetry False Transformation Operation Details Note: It is similar to issue https://github.com/pnp/modernization/issues/url It is working fine if I remove the newline character from the script. But for us it is a lot of pages and will not be feasible to manually remove the newline character from each script. Is there any alternative solution to fix this issues for all of the pages. Steps to Reproduce Install the react-script editor web part to the app catalog from the link https://github.com/pnp/modernization/issues/url Create a web part page in a classic SharePoint site, add OOB script editor web part and add the below sample script in the code snippet of the script editor web part. Sample Script: <h1>My First JavaScript</h1> <button type="button"onclick="document.getElementById('demo').innerHTML = Date()">Click me to display Date and Time.</button> <p id="demo"> </p> Then use the below script to modernize the page with the switch -UseCommunityScriptEditor: ConvertTo-PnPPage -Identity $page.FieldValues["ID"] -Overwrite -DisablePageComments -AddTableListImageAsImageWebPart: $false -ClearCache -SkipItemLevelPermissionCopyToClientSidePage -TakeSourcePageName:$TakeSourcePageName -LogType File -LogFolder $LogOutputFolder -LogVerbose -LogSkipFlush -KeepPageCreationModificationInformation -UseCommunityScriptEditor -CopyPageMetadata25KViews0likes0CommentsContent editor web part losing table format and images inside a table on editing the modernized page
Problem Area Page Transformation: Error during the use of page transformation from PnP PowerShell Expected or Desired Behavior Content in the tables having custom formatting for the table and images added within the table cells in the content editor web part in the classic web part pages should be modernized properly. PnP PowerShell Online Version Details: Name: SharePointPnPPowerShellOnline Version: 3.29.2101.0 Observed Behavior Content in the content editor web parts having tables with formatting and images within the table are migrated properly but when we edit the page and save the modernized page, it is losing its table format along with the inline images in the table. Classic Web part page Modernized page Edit and save the modernized page You can notice, it is losing the image on save and for other cases it is also losing formatting in the tables which has highly customized formatting. Steps to Reproduce Create a classic web part page -> add content editor web part -> Insert tables -> apply custom formatting -> add images in the table cell -> save the page Then use the below script to modernize the page: ConvertTo-PnPPage -Identity $page.FieldValues["ID"] -Overwrite -DisablePageComments -AddTableListImageAsImageWebPart: $false -ClearCache -SkipItemLevelPermissionCopyToClientSidePage -TakeSourcePageName:$TakeSourcePageName -LogType File -LogFolder $LogOutputFolder -LogVerbose -LogSkipFlush -KeepPageCreationModificationInformation -CopyPageMetadata793Views0likes0CommentsNeed to Hide & Show field Sharepoint Form.
Hi SP Experts, I am very new to SharePoint, I have 1 requirement regarding the hide & Show field based on condition SharePoint Form. I tried to get the idea from the Internet and find so many solutions but when I am trying in SharePoint then I did not find the steps mentioned in the Threads. (Like - Adding Javascrit / WebPart) So I decided to raise my query here. My Issue - I have One Yes/No field if values is "Yes" then i need to display 2 field like i mentioned in the below screenshot. So Please suggest me the idea regarding my Issue. Internet Finding - https://www.enjoysharepoint.com/script-editor-web-part-sharepoint/ I can not see the "Insert" Tab in my Sharepoint. see the - below ScreenShot for2.9KViews0likes2Comments