1

I have a publishing site in SharePoint 2013. I am trying to incorporate page status bar using the following snippet

    function addPageStatusMessage() {
    SP.SOD.executeFunc("SP.js", "SP.ClientContext", function () {
    statusID = SP.UI.Status.addStatus("Information", "This is my first status bar", true);
    SP.UI.Status.setStatusPriColor(statusID, "red");
});

}

The page status bar appears only in system pages and in pages where the ribbon is loaded. Is there some setting where I can have this page status bar even if ribbon is not loaded?

I have the page status bar tag outside the ribbon element.

    <SharePoint:AjaxDelta ID="DeltaPageStatusBar" BlockElement="true" runat="server">
          <div id="pageStatusBar"></div>
    </SharePoint:AjaxDelta>

Additional findings

On putting the break-point for any attribute change on pagestatus div, I can see that init.js is being called after my function call and it has a function to remove the status message. I tried to use
ExecuteOrDelayUntilScriptLoaded(addPageStatusMessage,"init.js") without any luck.

protected by Community Jun 25 '16 at 14:16

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Browse other questions tagged or ask your own question.