Administration > Backend Pages API

Posted by Community Admin on 04-Aug-2018 15:24

Administration > Backend Pages API

All Replies

Posted by Community Admin on 04-Jun-2014 00:00

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?

Thanks,
Nathalia

Posted by Community Admin on 09-Jun-2014 00:00

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.SaveChanges();
pManager.Provider.SuppressSecurityChecks = false;


Regards,
Kaloyan
Telerik
 
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
 

This thread is closed