Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

wiki page creation with two column layout via JavaScript

$
0
0

Hello everybody.

I need to create wiki page with JavaScript.

I have tried this:

var newPage = files.addTemplateFile( fullPageUrl, SP.TemplateFileType.WikiPage );

it creates page but it is not a wiki: no text field, only one web part zone.

then I have tried to add content:

var newItem = newPage.get_listItemAllFields();

newItem.set_item( "WikiField", wikiPageLayout( layoutsData ) )

newItem.update();

context.executeQueryAsync( ...

I have defined wikiPageLayout as a text:

'<table id="layoutsTable" style="width:100%;">\
     <tbody>\
      <tr style="vertical-align:top;">\
       <td style="width:66.6%;">\

.. and so on

but I got the same page content. May be my approach for item updating is wrong?

P.S. I do not need to add any web parts automatically. The only result I need on this stage is standard pure wiki page.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>