More in this section

Forums / Developing with Sitefinity / Administration > Backend Pages API

Administration > Backend Pages API

2 posts, 0 answered
  1. Nathalia
    Nathalia avatar
    25 posts
    16 Nov 2011
    04 Jun 2014
    Link to this post

    Hi all,

      I am working in Administration > Backend Page > Pages. I need to add in Page Edit a script widget via API. How can I do this?




  2. Kaloyan
    Kaloyan avatar
    272 posts
    06 Feb 2017
    09 Jun 2014
    Link to this post
    Hi Nathalia,

    You can try the following code sample which might help you to achieve your desired scenario:

    PageManager pManager = PageManager.GetManager();
    pManager.Provider.SuppressSecurityChecks = true;
    var page = pManager.GetPageNodes().Where(pN => pN.Title == "News" && pN.IsBackend == true).FirstOrDefault();
    page.Page.HeadTagContent += "<script type=\"text/javascript\" src=\"myJavascriptFile.js\"></script>";
    pManager.Provider.SuppressSecurityChecks = false;

    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered