<
From version < 48.3 >
edited by Silvia Macovei
on 2010/02/25
To version < 48.4 >
edited by Silvia Macovei
on 2010/03/04
>
Change comment: Aligned Images and Code

Summary

Details

Page properties
Content
... ... @@ -33,11 +33,11 @@
33 33  * On the Class Editor wizard entry page (XWiki.XWikiClasses), under the heading "Create a new data type", enter the following web space and class name:
34 34  ** Space: FAQ
35 35  ** Class: FAQ
36 -
36 +(((
37 37  image:CreateANewClass.PNG
38 -
38 +)))
39 39  * Click the "Create this Class" button. You should then see a code page with the following code:
40 -
40 +(((
41 41  {{code language="none"}}
42 42  {{velocity}}
43 43  ## Replace Main with the Space where you want your documents to be created.
... ... @@ -49,6 +49,7 @@
49 49  {{/velocity}}
50 50  {{include document="XWiki.ClassSheet"/}}
51 51  {{/code}}
52 +)))
52 52  
53 53  In the code, change the word "Main" with the name of the space where you want you FAQ pages to be created as the commented instructions in the page code suggest. Replace the word "Main" with the word "FAQ". The line of code should now look like this:
54 54  
... ... @@ -73,13 +73,13 @@
73 73  
74 74  * Enter the text //question// in the "NAME" field of the Class Editor panel: the "ADD PROPERTY" panel is in the right column.
75 75  * Choose a TextArea type for the property and then click the "ADD PROPERTY" button. The TextArea will ultimately give us a multi-line text field in our authoring template.
76 -
77 +(((
77 77  image:AddQuestionProperty.PNG
78 -
79 +)))
79 79  * Configure this property with the following values (actually, if you are using the current XWiki version, you don't need to change anything but the Pretty name ? all the rest are the default values):
80 -
81 +(((
81 81  image:QuestionProperty.PNG
82 -
83 +)))
83 83  * Now add a property called //answer// in the same way that you did for the "question" property (choosing TextArea for the property type)
84 84  * Choose it from the property list on the left and configure this property with the same values as the "question" property, except for the //name// and //pretty name// which will, obviously, match the new property we're creating
85 85  * When you are done adding and configuring the properties, click the "Save & View" button.
... ... @@ -87,9 +87,9 @@
87 87  = Create the Page Design Sheet =
88 88  
89 89  * After the previous step you are now on the FAQClass page which should look like this:
90 -
91 +(((
91 91  image:FAQClass2.PNG
92 -
93 +)))
93 93  * 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.
94 94  * Click on "View the sheet document"
95 95  * Edit that page in Object edition mode
... ... @@ -97,7 +97,7 @@
97 97  ** **Adding the XWiki.SheetClass object is important. It's because of this object that users will be sent to form edition mode when editing FAQ entries**
98 98  * Click "Save & View"
99 99  * If you edit the page in wiki mode, you will see the following code:
100 -
101 +(((
101 101  {{code language="none"}}
102 102  {{velocity}}
103 103  ## You can modify this page to customize the presentation of your object.
... ... @@ -112,7 +112,7 @@
112 112  #end
113 113  {{/velocity}}
114 114  {{/code}}
115 -
116 +)))
116 116  Let's take a moment now and analyze this code:
117 117  
118 118  * The first line retrieves the FAQ.FAQClass from the wiki
... ... @@ -132,14 +132,14 @@
132 132  = Create the Authoring Template =
133 133  
134 134  * Click on "FAQClass" in the breadcrumb. The document should look like this:
135 -
136 +(((
136 136  image:FAQClass3.PNG
137 -
138 +)))
138 138  * Notice that now, there is a link for the FAQSheet in place of the button that was previously there
139 139  * Click on the "CREATE THE DOCUMENT TEMPLATE" button. The Authoring Template will be automatically created. If you click on "View the template document" and edit that page in wiki mode, you will see the following code:
140 -
141 +(((
141 141  {{code language="none"}}{{include document="FAQ.FAQSheet"/}}{{/code}}
142 -
143 +)))
143 143  * Note that we changed the space name preceding the page name also because we want all of our FAQ pages to reside in the same XWiki space
144 144  * Remember that all our documents will be copies of the Authoring Template used as a prototype so the content will be copied in all our FAQs documents and will execute the Design Sheet code in the context of the current document. See the [[dedicated page>>DevGuide.IncludeInVelocity]] for more information regarding this technique.
145 145  
... ... @@ -149,9 +149,9 @@
149 149  * At the bottom of the page, look for the following error message: "The template does not contain an object of type FAQClass. Add a FAQ object to the template »."
150 150  * Click on "Add a FAQ object to the template »"
151 151  * Congratulations: you just created an Authoring Template! You're almost done now.
152 -
153 +(((
153 153  image:FAQClass4.PNG
154 -
155 +)))
155 155  = Create a home page for the FAQ application =
156 156  
157 157  You want your users to be able to see a list of all existing questions and answers and to add new questions. The best way to do this is to put the FAQ application in its own space and to use that space's homepage to display existing questions.
... ... @@ -254,13 +254,13 @@
254 254  
255 255  * Under the "Add a new question" header, enter a document title in the //Document// field and click //Create this FAQ//. For example, enter //What is the meaning of life?//.
256 256  * You can then enter your question in longer form using the //Question// field on the template, like this:
257 -
258 +(((
258 258  image:FAQSheetEdit.PNG
259 -
260 +)))
260 260  * Click //Save & View// and then you will see the newly created document, like this:
261 -
262 +(((
262 262  image:FAQSheetView.PNG
263 -
264 +)))
264 264  * Go back to the "FAQ.WebHome" page to see the list of existing questions
265 265  
266 266  = Conclusion =

Get Connected