Last modified by Michael Hamann on 2021/10/18

From version 54.3
edited by Vincent Massol
on 2010/12/12
Change comment: There is no comment for this version
To version 55.1
edited by Guillaume Lerouge
on 2010/12/29
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.GuillaumeLerouge
Content
... ... @@ -200,8 +200,26 @@
200 200  
201 201  == Creating new FAQ entries ==
202 202  
203 -Now you need to write some code to let your users create new FAQ entries. To do this, you will have to create a form in which the user can enter the name of the questions she wants to create. Once typed in, the form calls the same page to trigger the new document creation based on the parameters entered by the user:
203 +There are 2 ways for you to let your users create new FAQ entries. You can either declare the FAQ as a template or add a custom creation form.
204 204  
205 +=== Using a Template ===
206 +
207 +You will have to define a template provider [[as explained on this page>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Administration+Application#HCreatethetemplateprovider]]
208 +
209 +Go to your wiki's administration interface, in the "Templates" section. Create a new template provider in the "FAQ" space and name it "FAQTemplateProvider"
210 +
211 +You can then use the following values:
212 +
213 +* Provider name: "FAQ Template Provider"
214 +* Template name "New FAQ entry"
215 +* Template to use: "FAQ.FAQTemplate"
216 +
217 +If you'd like, you can restrict FAQ entries so that they're created only in the "FAQ" space. Once you're done, click "Save & View". Your template is now ready to be used! Users who click on the "Add >> Create page" button will now have the option to create a new page using the FAQ template.
218 +
219 +=== Custom creation form ===
220 +
221 +If you choose this option, you will need to write some code to let your users create new FAQ entries. To do this, you will have to create a form in which the user can enter the name of the questions she wants to create. Once typed in, the form calls the same page to trigger the new document creation based on the parameters entered by the user:
222 +
205 205  * The first part of the code checks whether the page has a parameter. If so:
206 206  ** The name of the document that will be created is computed
207 207  ** The name is cleaned to remove extra characters

Get Connected