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.