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

1 Answer 1

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
  • 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. Commented May 11, 2016 at 15:04

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.