1

Does anyone know how to check page layout from javascript of current page in sharepoint 2013? Ideally I would prefer to not use any ajax calls.

Thanks

0

By using below code you will get the Page Layout URL of current page.

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);

function sharePointReady(){
    var url = SP.Utilities.Utility.getLayoutsPageUrl(window.location.href);
    /* DO YOU STUFF */
}
  • 1
    This is not giving me the right value. I made a page layout, and then made a page, set it to that page layout called News Item based on the content type News Item. Then the value I got was /en/_layouts/15/http://mysite/en/Pages/testpagelayout.aspx. – omega May 11 '16 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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