Wednesday, 3 June 2020

Content Editor Webpart is missing in SharePoint online

Fix using powershell


Connect-SPOService -Url https://abc-admin.sharepoint.com 

set-SPOsite https://abc.sharepoint.com -DenyAddAndCustomizePages 0 

How to Connect to SharePoint Online from PowerShell




 Connect-SPOService -Url https://YourTenant-admin.sharepoint.com


Download all wsp files from Central Admin using Powershell



$pathName = "c:\WSPFiles\"

foreach ($solution in Get-SPSolution)
   {
 
  
    $title = $Solution.Name

    $filename = $Solution.SolutionFile.Name

    $solution.SolutionFile.SaveAs("$pathName\$filename")
}

Customize the Quick Launch as Expand/Collapse in SharePoint 2013/2016 Using Code




var quickLaunchLinks = $("div[id$='QuickLaunchMenu'] > ul > li:has('ul') > a");


quickLaunchLinks.prepend("<span class='ms-commentexpand-iconouter ql-icon'>
<img alt='expand' src='/Comm/Comms2/_themes/1/spcommon-B35BB0A9.themedpng?ctag=2' class='ms-commentexpand-icon'></span>");



quickLaunchLinks.closest("li").find("> ul").hide();




quickLaunchLinks.click(function(e) {



    e.preventDefault();



    var childUl = $(this).closest("li").find("> ul");

    var visibleChildUL = childUl.is(":visible")



    if (visibleChildUL) {

        $(this).find(".ql-icon").replaceWith("<span class='ms-commentexpand-iconouter ql-icon'>
<img alt='Expand' src='/Comm/Comms2/_themes/1/spcommon-B35BB0A9.themedpng?ctag=2' class='ms-commentexpand-icon'></span>");


        childUl.slideUp();



    } else {



        $(this).find(".ql-icon").replaceWith("<span class='ms-commentcollapse-iconouter ql-icon'>
<img alt='Collapse' src='/Comm/Comms2/_themes/1/spcommon-B35BB0A9.themedpng?ctag=2' class='ms-commentcollapse-icon'></span>");


        childUl.slideDown();



    }



});