none
add button to add a page RRS feed

  • Question

  • Hello,

    We're setting up a knowledge base for our internship and we are using an enterprise wiki. Basically what I want is to have a button on my knowledgebase that can add a page.

    They say it's not very convenient to go to the wheel, click it, add a page.

    I guess this has to be made by using javascript or programming code in SP designer? I have no idea how to do this by JS or through code, if somebody could help me?

    Kind regards,

    Dries

    Friday, May 24, 2013 8:51 AM

Answers

  • All what was wrong was the url : it just needed to be ins-shp2013/sites/wiki/_layouts/15/CreatePage.aspx? and not the full url.
    Friday, May 24, 2013 1:05 PM

All replies

  • Hello,

    I found some of the code on line that could achieve this but I'm still having a problem.

    First of all, this creates a popup that makes me fill in a name and I can click create, but then I am redirected to a white page, this is where I should be able to fill in my new page, but it's completely blank. So I guess it's working since I can find the new page I just made. The only problem now is I don't get redirected to a webpage I can edit (I already made a template which works fine when i go to "add a page", we get the custom template)

    But here's the code, is there anything wrong with it?

    ​​<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript">

    </script><script type="text/javascript">

    function OpenCustomEditApproveDialog()

    {

    var options = {

    url:"http://ins-shp2013/sites/wiki/_layouts/15/CreatePage.aspx?List=%7B7349261D-75F3-4B38-89CF-5EE4A8E08E6C%7D&RootFolder=%2Fsites%2Fwiki%2FPages&ContentTypeId=0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39004C1F8B46085B4D22B1CDC3DE08CFFB9C00DCA0446C6663834C89A6956D6C20BD77&Source=%2Fsites%2Fwiki%2F_layouts%2F15%2Fwpribbon%2Easpx%3FGetFormName%3D0%26WebPartId%3Dg%255Fa5f25651%255F11b1%255F47a6%255F88b9%255Fcff84e7f7c7d%26PageComponentId%3DWebPartWPQ2%26List%3D7349261d%252D75f3%252D4b38%252D89cf%252D5ee4a8e08e6c%26View%3Da5f25651%252D11b1%252D47a6%252D88b9%252Dcff84e7f7c7d%26FileUrl%3D%252Fsites%252Fwiki%252FPages%252FForms%252FPagesTest%252Easpx",

    title:'New Item',

    width:700,

    height:300,

      dialogReturnValueCallback: DialogCallback };

      SP.UI.ModalDialog.showModalDialog(options);

        }

    function DialogCallback(dialogResult, returnValue){               }

    </script><input onclick="OpenCustomEditApproveDialog()" type="button" value="add file"/>​​​​​

    Friday, May 24, 2013 12:02 PM
  • All what was wrong was the url : it just needed to be ins-shp2013/sites/wiki/_layouts/15/CreatePage.aspx? and not the full url.
    Friday, May 24, 2013 1:05 PM