<
From version < 109.1 >
edited by Alex Cotiugă
on 2020/01/28
To version < 110.1 >
edited by Hassan Ali
on 2020/02/22
>
Change comment: Better indentation in the bullet(ed) images, and minor text size changes (for better and distinguishable look).

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.acotiuga
1 +XWiki.Haxsen
Content
... ... @@ -12,6 +12,7 @@
12 12  
13 13  {{warning}}
14 14  If you've already followed the [[AWM FAQ Tutorial>>Documentation.DevGuide.FAQTutorial.FAQTutorialAWM]] or installed the [[FAQ Application>>extensions:Extension.FAQ Application]] you'll need to do one of 2 things before you can take this tutorial:
15 +
15 15  * Delete the ##FAQ## space (if you've followed the AWM FAQ Tutorial) or uninstall the FAQ Application (if you've installed the FAQ Application)
16 16  * or simply follow the tutorial below but replace the space ##FAQ## with another value everywhere it's used. For example use ##MyFAQ## as the space name instead.
17 17  {{/warning}}
... ... @@ -30,13 +30,33 @@
30 30  
31 31  Let us begin by taking a look at what we are going to build. The new application will have the following views:
32 32  
33 -* The FAQ [[Class>>FAQ.WhatIsAClass]]
34 +* (((
35 +===== The FAQ [[Class>>FAQ.WhatIsAClass]] =====
36 +
37 +*
38 +
34 34  {{image reference="FAQsSummary.png"/}}
35 -* An FAQ entry in View mode
36 -{{image reference="FAQSheetView.PNG"/}}
37 -* An FAQ entry in Edit mode
38 -{{image reference="FAQSheetEdit.PNG"/}}
40 +)))
39 39  
42 +
43 +* (((
44 +===== An FAQ entry in View mode =====
45 +
46 +*
47 +
48 +==== {{image reference="FAQSheetView.PNG"/}} ====
49 +)))
50 +
51 +
52 +* (((
53 +===== An FAQ entry in Edit mode =====
54 +
55 +*
56 +
57 +==== {{image reference="FAQSheetEdit.PNG"/}} ====
58 +)))
59 +
60 +
40 40  = Authoring Templates and Page Design Sheets =
41 41  
42 42  An Authoring Template is a template for creating documents of a specific type. Unlike a regular content page in edit mode with one field for freeform editing, an Authoring Template presents a custom set of form fields for creating a document with specific type of data. These form elements are defined by the properties of a class.
... ... @@ -53,11 +53,15 @@
53 53  
54 54  = Create the FAQ Class =
55 55  
56 -* On the Class Editor wizard entry page (XWiki.XWikiClasses), under the heading "Create a new data type", in the "Title" field, enter ##FAQ## as the name of the page to create:(((
77 +* On the Class Editor wizard entry page (XWiki.XWikiClasses), under the heading "Create a new data type", in the "Title" field, enter ##FAQ## as the name of the page to create:
78 +** (((
57 57  {{image reference="CreateANewClass1.png"/}}
58 58  )))
81 +
82 +
59 59  * As you can see in the Breadcrumb below the new page will be created at location ##XWiki > FAQ##. In practice the Class Wizard will automatically prefix the page name with ##Class## (you could also enter ##FAQClass## as the page name directly).
60 -* Now it would be nice to have it created in a new location such as ##FAQ > FAQ Class##. Since the ##FAQ## parent doesn't exist we cannot use the Tree picker button. Thus click the Pencil button as shown in the following image and replace ##XWiki## by ##FAQ##.(((
84 +* Now it would be nice to have it created in a new location such as ##FAQ > FAQ Class##. Since the ##FAQ## parent doesn't exist we cannot use the Tree picker button. Thus click the Pencil button as shown in the following image and replace ##XWiki## by ##FAQ##.
85 +** (((
61 61  {{image reference="CreateANewClass2.png"/}}
62 62  )))
63 63  * In technical terms you're creating a page named ##FAQClass## (with a title of "FAQ Class") located in a space also called ##FAQ## and thus the technical reference is ##FAQ.FAQClass##.
... ... @@ -101,11 +101,13 @@
101 101  In our document, we'll store both a //question// and an //answer//. So we need to create a property for each of them.
102 102  
103 103  * Enter the text //question// in the "name" field
104 -* Choose a TextArea type for the property and then click on "Add". The TextArea will ultimately give us a multi-line text field in our authoring template.(((
129 +* Choose a TextArea type for the property and then click on "Add". The TextArea will ultimately give us a multi-line text field in our authoring template.
130 +** (((
105 105  {{image reference="AddQuestionProperty.PNG"/}}
106 106  )))
107 107  * Click on the "+" icon to expand the options for the newly created property
108 -* Change the value of the "Pretty Name" field to "Question"(capital Q):(((
134 +* Change the value of the "Pretty Name" field to "Question"(capital Q):
135 +** (((
109 109  {{image reference="QuestionProperty.PNG"/}}
110 110  )))
111 111  * Now create another property called //answer// the same way that you did for the previous "question" property (choose TextArea for the property type)
... ... @@ -114,7 +114,8 @@
114 114  
115 115  = Create the Page Design Sheet =
116 116  
117 -* After the previous step you are now on the FAQClass page which should look like this:(((
144 +* After the previous step you are now on the FAQClass page which should look like this:
145 +** (((
118 118  {{image reference="FAQClass2.PNG"/}}
119 119  )))
120 120  * Click the first button ("Create the document sheet") to create the document sheet (the Page Design Sheet). This sheet determines how your page's objects will be rendered to the user. The document is automatically created.
... ... @@ -121,7 +121,8 @@
121 121  * You should see a warning message with the text "The sheet is not bound to the class so it won't be applied automatically when a page that has an object of this class is displayed". Click the "Bind the sheet to the class" link that appears after the text. **What this does is important**:
122 122  ** It adds an object of type ##XWiki.ClassSheetBinding## to the ##FAQ.FAQClass" document. Basically it ties the FAQ Class to the Sheet.##
123 123  ** **It's because of this object that users will be sent to form edition mode when editing FAQ entries**
124 -* Now click on "View the sheet document". This takes you to the ##FAQ.FAQSheet## page which you can edit in wiki mode and see its default content:(((
152 +* (((
153 +Now click on "View the sheet document". This takes you to the ##FAQ.FAQSheet## page which you can edit in wiki mode and see its default content:(((
125 125  {{code language="none"}}
126 126  {{velocity}}
127 127  ## You can modify this page to customize the presentation of your object.
... ... @@ -134,7 +134,9 @@
134 134  #end
135 135  {{/velocity}}
136 136  {{/code}}
137 -)))Let's take a moment now and analyze this code:(((
166 +)))Let's take a moment now and analyze this code:
167 +
168 +(((
138 138  * The first line retrieves the ##FAQ.FAQClass## from the wiki
139 139  * Then we iterate through all its properties and display their values for the current document in a definition list.
140 140  
... ... @@ -154,10 +154,12 @@
154 154  
155 155  * Click "Save & View"
156 156  )))
188 +)))
157 157  
158 158  = Create the Authoring Template =
159 159  
160 -* Navigate back to the ##FAQ.FAQClass## document (you can use the arrows in the breadcrumb to do so). The document should look like this:(((
192 +* Navigate back to the ##FAQ.FAQClass## document (you can use the arrows in the breadcrumb to do so). The document should look like this:
193 +** (((
161 161  {{image reference="FAQClass3.PNG"/}}
162 162  )))
163 163  * Click on the "Create the document template" button. The Authoring Template will be automatically created.
... ... @@ -168,7 +168,8 @@
168 168  
169 169  * If you're on the template page, navigate back to the ##FAQ.FAQClass## document.
170 170  * At the bottom of the page, look for the following warning message: "The template does not contain an object of type FAQClass. Add a FAQ object to the template »."
171 -* Click on "Add a FAQ object to the template »":(((
204 +* Click on "Add a FAQ object to the template »":
205 +** (((
172 172  {{image reference="FAQObject.png"/}}
173 173  )))
174 174  
... ... @@ -381,7 +381,8 @@
381 381  
382 382  * Copy this code and paste it as Wiki content inside ##FAQ.WebHome##, below the code that's already there
383 383  * Click "Save and View"
384 -* A form to create new FAQ entries is now available on the page:(((
418 +* A form to create new FAQ entries is now available on the page:
419 +** (((
385 385  {{image reference="FAQsWithForm.png"/}}
386 386  )))
387 387  
... ... @@ -394,13 +394,16 @@
394 394  * Go to ##FAQ.WebHome##
395 395  * Below the "Add a new question" header, enter a question (which will also be used as the document title) in the //Document// field
396 396  * Click //Create this FAQ//
397 -* You can then enter your question in longer form using the //Question// field on the template, like this:(((
432 +* You can then enter your question in longer form using the //Question// field on the template, like this:
433 +** (((
398 398  {{image reference="FAQSheetEdit.PNG"/}}
399 399  )))
400 -* Click //Save & View// and then you will see the newly created document, like this:(((
436 +* Click //Save & View// and then you will see the newly created document, like this:
437 +** (((
401 401  {{image reference="FAQSheetView.PNG"/}}
402 402  )))
403 -* Go back to the ##FAQ.WebHome## page (you can use the breadcrumbs) to see the list of existing questions(((
440 +* Go back to the ##FAQ.WebHome## page (you can use the breadcrumbs) to see the list of existing questions
441 +** (((
404 404  {{image reference="FAQsWithEntry.png"/}}
405 405  )))
406 406  

Get Connected