From version 1.1
edited by Vincent Massol
on 2014/05/20
To version 2.1
edited by Pascal Bastien
on 2019/07/17
Change comment: Way to create a new FAQ page located in FAQ space sublevels

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.pbas
FAQCode.FAQClass[0]
answer
... ... @@ -32,3 +32,20 @@
32 32  {{/html}}
33 33  {{/velocity}}
34 34  {{/code}}
35 +
36 +Note, if you want to create a new FAQ page located in FAQ space sublevels you could write ,
37 +{{code}}
38 +{{velocity}}
39 +#if("$!request.docName" != '')
40 + ## Request for creating a new instance
41 + ## Add location where to create the new page: FAQ.NewLevel.AnotherLevel
42 + #set ($Location= ["$!{request.spaceName}",'NewLevel','AnotherLevel'])
43 + #set($targetDocReference = $services.model.createDocumentReference('', $!{Location}, "$!{request.docName}"))
44 + $response.sendRedirect($xwiki.getURL($targetDocReference, 'inline', "template=${escapetool.url($request.template)}&parent=${escapetool.url($request.parent)}"))
45 + ## Stop processing, since we already sent a redirect.
46 + #stop
47 +#end
48 +
49 += Add a new question =
50 +...
51 +{{/code}}

Get Connected