Migration Guide from XWiki Syntax 1.0 to XWiki Syntax 2.0
Contents
Migration Guide from XWiki Syntax 1.0 to XWiki Syntax 2.0
Start by reading the differences between the two syntaxes in the Syntax Reference Guide.Migrate new lines
- In XWiki Syntax 1.0 new lines were not taken into account. They now are. So if you want to keep the text on the same line you'll need to remove your new lines.
This is on one line
This is on one line
Migrate links
- Replace [...] with double brackets: [[...]]
Migrate Headers
- Replace 1.1+ syntax with equal signs: ==+
Migrate Velocity scripts
- Surround Velocity code with the velocity macro.
- Replace calls to #include* with the include macro. Use context="current" for executing in the current page context.
1 Latest Articles
#set($nbstart = $request.nbstart)
#set($category = "")
#set($nbitems = "10")
#includeMacros("Blog.Macros")= Latest Articles
{{velocity}}
#set($nbstart = $request.nbstart)
#set($category = "")
#set($nbitems = "10")
{{/velocity}}
{{include document="Blog.Macros" context="current"/}}Migrate HTML
- Surround all HTML blocks with the html macro.
1.1 Add an Article
<form action="" id="newdoc" method="post">
<div>
<input type="hidden" name="parent" value="Main.WebHome" />
<input type="hidden" name="template" value="XWiki.ArticleClassTemplate" />
<input type="hidden" name="sheet" value="1" />
<input type="hidden" name="webname" value="Main"/>
<input type="hidden" name="name" value=""/>
<input type="text" name="title" value="page name" size="18"/>
<input type="button" value="Add" onclick='if (updateName(this.form.title,this.form.name)) { action="../../inline/" + this.form.webname.value + "/" + this.form.name.value; this.form.submit(); }' />
</div>
</form>== Add an Article
{{html}}
<form action="" id="newdoc" method="post">
<div>
<input type="hidden" name="parent" value="Main.WebHome" />
<input type="hidden" name="template" value="XWiki.ArticleClassTemplate" />
<input type="hidden" name="sheet" value="1" />
<input type="hidden" name="webname" value="Main"/>
<input type="hidden" name="name" value=""/>
<input type="text" name="title" value="page name" size="18"/>
<input type="button" value="Add" onclick='if (updateName(this.form.title,this.form.name)) { action="../../inline/" + this.form.webname.value + "/" + this.form.name.value; this.form.submit(); }' />
</div>
</form>
{{/html}}