2

I have created a custom masterpage inherited from Seatle, and then created custom masterpages.

When I apply my custom pagelayout to the site and click on Side--> Edit to edit the pagelayout again or to do any another modifying then the edit ribbon comes disabled (grayed) and cannot do any action.

_ I have tried to check out the page/ check in / ignore utcheckning all this things _ im admin on the page

enter image description here

1
  • Which browser you are using? Have you checked on other browsers?And are there any error in console window when you inspect page in developer tools?
    – 404
    Apr 22, 2015 at 10:47

3 Answers 3

1

I had the same problem happened to me and, in my particular case, it was because the div containing the class "welcome-content" had been taken out / commented out. I'm talking about the following lines of code in the page layout itself:

    <div class="welcome-content">
        <PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" HasInitialFocus="True" MinimumEditHeight="400px" runat="server"/>
    </div>

It was about line 32. Make sure those are not commented out or removed. If they are, put them back in. This will turn the toolbar back on.

1

Or, you could add a snippet to your page / template to display the ribbon, regardless of edit object (page, list, library, etc).

  1. Add a Content / Snippet web part
  2. Add the below script content to your web part
  3. Name that web part something logical, like "Ribbon Display"
  4. Export your Ribbon Display web part (save anywhere)
  5. Navigate to the top level of that site collection / Site Settings
  6. View Web Part Gallery
  7. Upload your new Web Part; create a new web part category called "Custom Web Parts"
  8. Visit your template / site / page of interest, and go into Edit mode
  9. Select Add a Web Part. You should now see a category called "Custom Web Parts", and the "Ribbon Display" web part within. Add the Ribbon Display web part.
  10. Drag the web part to the bottom of the page (just cleaner for future editors)
  11. Bonus: use the same process for things like minor css overrides, analytics code, etc.

Here is the snippet content:

<script>
        setTimeout(function() {
        var elem = document.getElementById("MSOZoneCell_WebPartWPQ2");
           if(elem != null) {
                var dummyevent = new Array();
                dummyevent["target"] = elem;
                dummyevent["srcElement"] = elem;
                WpClick(dummyevent);
                _ribbonStartInit("Ribbon.Browse", true)
            }
        }, 2000);
        </script> 
0

This fixes it for all sites:

  1. Sign in to https://admin.microsoft.com as a global or SharePoint admin.
  2. In the left pane, under Admin centers, select SharePoint. (You might need to select Show all to see the list of admin centers.) If this opens the new SharePoint admin center, select Classic SharePoint admin center in the left pane.
  3. Select settings.
  4. Under Custom Script choose: o Allow users to run custom script on personal sites. o Allow users to run custom script on self-service created sites.
  5. Open Windows PowerShell as an administrator. Run the following scripts: o Set-ExecutionPolicy unrestricted o $credential = get-credential

o Install-Module -Name Microsoft.Online.SharePoint.PowerShell

o Connect-SPOService –credential $credential -Url https://domain-admin.sharepoint.com o Get-SPOSite

o Set-SPOsite -DenyAddAndCustomizePages 0

  1. For more information please see this link: https://docs.microsoft.com/en-us/sharepoint/allow-or-prevent-custom-script

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.