To create a link manually that have the same features as the one where you click on SiteActions and then “Create New Page”, you need some Javascript and some ModalDialog functions. How to use the links the Site Actions menu, is not all that documented. I actually had to get some help in order to figure this out. No matter how I googled or studied Microsoft’s documentation, I came up empty.
With this, you can even create a link – say on the home page of your SharePoint Intranet, and have that link, create a new Publishing Page on a subsite of your choice.
Case
I have a News Site, where every story is a new Publishing Page. The News Site is located at a subsite, like “Intranet/News”. I would like my users to create a new news story, directly from the home page. Normally the user would have to navigate to the news site and then click on “Site Actions” and then “Create new Page”. That is just not very user friendly in my book. At the same time, I don’t want to create a SharePoint solution, for a single button. And now I don’t have to. The link needed for the solution, is shown below. Just remember to edit the options.
<a href="javascript:javascript:if (LaunchCreateHandler('PublishingPage')) { SP.SOD.executeFunc('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', function() { var dlgOptions = { url:'/News/_layouts/15/CreatePublishingPageDialog.aspx', autoSize: true, autoSizeStartWidth: 550, title:'Create some News' }; SP.UI.ModalDialog.showModalDialog(dlgOptions); }); };" title="Create some News" >Create some News</a>
Remember to take a closer look at Microsoft’s documentation for more options.
Leave a Reply