Wiki source code of Page Editing

Version 219.1 by Sakthivel Muthu on 2017/12/31

Hide last authors
Thomas Mortagne 186.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
Guillaume Lerouge 33.1 4
Silvia Macovei 131.1 5 In XWiki all pages are editable (provided you are logged in and/or have the edit rights). To edit a page, all you have to do is to click the arrow in the "Edit" button. Please note the location of the "Edit" button varies depending on the skin your wiki is using.
Vincent Massol 15.1 6
Silvia Macovei 131.1 7 If you're using the [[Flamingo skin>>extensions:Extension.Flamingo Skin]] you should see the following:
Silvia Macovei 40.1 8
Silvia Macovei 131.1 9 {{image reference="EditSimpleModeFlamingo.png"/}}
Silvia Macovei 40.1 10
Sorin Burjan 45.1 11 = Simple and Advanced editing modes =
Guillaume Lerouge 1.73 12
Vincent Massol 162.3 13 Since XWiki is an [[application wiki>>platform:Main.SecondGenerationWiki]], not all users will need to use the same features. This is why XWiki comes with a Simple and an Advanced editing mode. Users can easily choose which editing mode they prefer on their profile (available at the top right of the page when you are logged in). This way, standard users do not have to choose between editing modes they may not be familiar with. By default new users are given the Simple editing mode but they can switch to the Advanced mode as described below.
Guillaume Lerouge 1.73 14
Silvia Macovei 43.3 15 == Simple Mode ==
Guillaume Lerouge 1.73 16
Vincent Massol 143.1 17 After clicking the "Edit" button in Simple mode, XWiki will automatically edit the page in the Basic mode (WYSIWYG or Wiki) for standard pages and in Form mode for pages which include Forms. The two editing modes available in Simple mode are:
Guillaume Lerouge 1.73 18
Vincent Massol 162.3 19 * [[Wiki Editing Mode>>platform:Features.PageEditing#HWikieditingmode]]
20 * [[WYSIWYG Editing Mode>>platform:Features.PageEditing#HWYSIWYGeditingmode]]
Guillaume Lerouge 1.73 21
Silvia Macovei 43.3 22 == Advanced Mode ==
Guillaume Lerouge 1.73 23
Silvia Macovei 131.1 24 Experienced XWiki users will want to use all the editing choices (particularly those who want to use XWiki programming features). They can choose to switch to advanced mode on their user profile page (see image below). Following this, clicking on the arrow in the "Edit" button on any page will display the full editing menu, letting the user choose which mode he wants to use ("Wiki", "Inline form", "Objects"...).
Guillaume Lerouge 1.73 25
Sakthivel Muthu 181.1 26 {{image reference="AdvancedEditMode.png"/}}
Silvia Macovei 131.1 27 Once you have switched to advanced mode, the "Edit" menu will look like this on mouse click:
Sakthivel Muthu 204.1 28
Sakthivel Muthu 218.2 29 {{image reference="EditAdvancedMode.png"/}}
Sorin Burjan 93.1 30
Vincent Massol 162.3 31 * [[Form Editing Mode>>platform:Features.PageEditing#HFormeditingmode28akainlinemode29]]
32 * [[Object Editing Mode>>platform:Features.PageEditing#HObjectseditingmode]]
33 * [[Class Editing Mode>>platform:Features.PageEditing#HClasseseditingmode]]
34 * [[Access Rights Editing Mode>>platform:Features.PageEditing#HAccessRightseditingmode]]
Guillaume Lerouge 1.73 35
Vincent Massol 162.3 36 In addition, advanced users have the ability to [[create Terminal pages>>platform:Features.DocumentLifecycle||anchor="HByusingtheAddPageaction"]] (i.e. pages that can't have children).
Vincent Massol 143.1 37
Silvia Macovei 43.3 38 = Common edit actions =
Sergiu Dumitriu 16.1 39
Silvia Macovei 43.4 40 All edit modes have some or all of the elements in the following image :
Sergiu Dumitriu 16.1 41
Gabriela Anechitoaei 149.1 42 {{image reference="autosave.png"/}}
Sergiu Dumitriu 16.1 43
Manuel Smeria 108.2 44 {{info}}
45 A wiki document's version is composed of two numbers. Saving a major change will increase the first component and reset the second to "1", while a minor edit will just increase the second component.
46 {{/info}}
47
Vincent Massol 42.1 48 The **minor edit** checkbox is meant to mark the fact that superficial changes were made to the document. Such changes may include, but are not restricted to: spelling error corrections, text rearrangements, formatting. It is the editor's responsibility to distinguish between major and minor changes.
Sergiu Dumitriu 16.1 49
50 By default, minor edits do not appear in the "What's New" page and in the document history. The option "Show minor edits" will list all the versions, including minor ones.
51
Silvia Macovei 131.1 52 The **Version summary** field allows entering a short description of the changes made to the document in the version that is being saved. It is displayed in the history page and it is meant to increase comprehensibility of the content's evolution.
Sergiu Dumitriu 16.1 53
Guillaume Lerouge 31.1 54 The **Cancel** button causes the changes to be discarded and forwards to the document view mode.
Sergiu Dumitriu 16.1 55
Guillaume Lerouge 31.1 56 The **Preview** button shows the document as it would look with the current changes saved, but does not actually change the document. From the preview mode, the user will be able to cancel the changes, return to edit mode or save the changes. This button is not available in all edit modes.
Sergiu Dumitriu 16.1 57
Guillaume Lerouge 31.1 58 The **Save & Continue** button submits the current changes and returns to the current edit mode.
Sergiu Dumitriu 16.1 59
Guillaume Lerouge 31.1 60 The **Save & View** button submits the current changes and returns to the document view mode.
Sergiu Dumitriu 16.1 61
Marius Dumitru Florea 142.1 62 == Autosave ==
63
64 The Autosave feature automatically saves the document you're working on as a minor version at a given interval. Just check the Autosave checkbox next to the action buttons, at the bottom of the editing area. You can optionally change the autosave interval by entering the desired number of minutes in the input following the checkbox.
65
66 {{warning}}
Thomas Mortagne 145.1 67 Note that this feature is still not fully mature since it creates a new revision of the document every N seconds (where N is the time interval you specify). This means a document may have a lot of revisions which will potentially hamper performances and history readability. In the future one idea is to [[implement the notion of pseudo versions>>https://jira.xwiki.org/browse/XWIKI-500]].
Marius Dumitru Florea 142.1 68 {{/warning}}
69
Silvia Macovei 43.3 70 = Wiki editing mode =
Guillaume Lerouge 1.73 71
Vincent Massol 162.3 72 This is a mode you should be familiar with if you're already a wiki user. In this mode you can enter text using a simple [[Wiki Syntax>>platform:Main.XWikiSyntax]]. Note that the [[Help Application>>extensions:Extension.Help Application]] provides help on the syntax when editing a page.
Guillaume Lerouge 1.73 73
Silvia Macovei 131.1 74 This is how the wiki edit mode looks like with the Flamingo skin:
Guillaume Lerouge 1.73 75
Silvia Macovei 106.2 76 {{image reference="WikiEditing.png"/}}
Guillaume Lerouge 1.73 77
Silvia Macovei 43.3 78 == Choosing a Syntax ==
Vincent Massol 18.1 79
Vincent Massol 162.3 80 You have the option to choose what syntax you want to use for writing the content of the page (see the [[XWiki Syntax Guide>>platform:Main.XWikiSyntax]] for more details and the [[Rendering wiki>>rendering:Main.WebHome]] for a full list of available syntaxes). To choose the syntax to use for the current page, go in wiki edit mode and in the Information Panel select the syntax to use.
Vincent Massol 18.1 81
Vincent Massol 133.2 82 {{info}}
Gabriela Anechitoaei 149.1 83 By default only the latest XWiki syntax is enabled, but you can [[configure other syntaxes>>extensions:Extension.Rendering Administration Application]], as shown in the screenshot below.
Vincent Massol 133.2 84 {{/info}}
85
Vincent Massol 133.3 86 For example using the Flamingo Skin:
87
88 {{image reference="Syntax2.png"/}}
89
Vincent Massol 114.1 90 == Converting between Syntaxes ==
Vincent Massol 19.3 91
Vincent Massol 114.1 92 If you already have content for the page in a given Syntax and you try to change the Syntax to another one then XWiki will propose to convert your content to the new Syntax if it knows how to perform that conversion (converting to XWiki Syntax 2.0+ will always prompt for a conversion). The quality of the conversion will usually be good but may depend on the quality of the original Syntax; for example converting from XWiki Syntax 1.0 to XWiki Syntax 2.0+ may not generate perfect result and you'll need to review manually the result.
93
Silvia Macovei 43.3 94 = WYSIWYG editing mode =
Guillaume Lerouge 1.73 95
Vincent Massol 42.1 96 This mode is ideal for first time users or people who do not want to use the Wiki Syntax. It's a mode similar to the one used by your favorite word processor in which you see how what you type is rendered. There's a toolbar available to add special effects to your text, add images, insert links, add macros, etc.
Vincent Massol 35.2 97
Silvia Macovei 106.2 98 {{image reference="wysiwyg.png"/}}
Guillaume Lerouge 1.73 99
Marius Dumitru Florea 162.1 100 Read the [[documentation for using the WYSIWYG editor>>extensions:Extension.CKEditor Integration.WebHome]] for more details.
Vincent Massol 19.7 101
Sorin Burjan 102.2 102 = Setting the page parent =
Sorin Burjan 101.2 103
Vincent Massol 132.1 104 {{info}}
Vincent Massol 141.2 105 Starting with XWiki 7.2, the concept of setting the page parent has been deprecated in favor of the [[Nested Pages feature>>Features.ContentOrganization]]. The location of a page is no longer controlled by the "parent" field. In order to change a page's location you now need to Rename or Move it to another location.
Sorin Burjan 102.2 106
Vincent Massol 132.1 107 For example a page "CEO" inside a page "Boarding" inside a page "Management" inside a page "Staff" you would have the following Breadcrumb:
108
109 {{image reference="referencebreadcrumb.png"/}}
110 {{/info}}
111
112 {{info}}XWiki < 7.2{{/info}} In order to have an organized structure of your page, when you create a new page in a space, its parent will be automatically set to be the WebHome page of the space in which you create the page.
113
Sorin Burjan 102.2 114 If you want to change the parent of the page, you have to edit the page with wiki or wysiwyg editors.
115
Silvia Macovei 106.2 116 {{image reference="documentParent.png"/}}
Sorin Burjan 102.2 117
118 Click on the small pencil above the page title in order to edit the page parent.
119
Silvia Macovei 106.2 120 {{image reference="documentParentCollapsed.png"/}}
Sorin Burjan 102.2 121
Sorin Burjan 102.3 122 {{info}}
Sorin Burjan 103.3 123 If the page has no parent set, the breadcrumbs feature will not show the path to navigate from the Main.WebHome to the page. These pages are called orphan pages.
Sorin Burjan 102.3 124 {{/info}}
125
Silvia Macovei 106.2 126 {{image reference="documentParentNoParent.png"/}}
Sorin Burjan 102.3 127
Thomas Mortagne 186.1 128 {{image reference="pageNoBreadcrumb.png"/}}
Sorin Burjan 102.3 129
Sorin Burjan 103.4 130 {{warning}}
131 Please note that when you copy a page, its parent field will not be updated accordingly to the new space the copy is in. You will have to do that manually.
132 {{/warning}}
133
Vincent Massol 147.4 134 = Hiding Pages =
Vincent Massol 146.1 135
Vincent Massol 147.3 136 It's possible to hide (or unhide) pages. When a page is hidden, it'll still be visible if you navigate to it but it'll disappear from Search, Page Index, Navigation Trees, etc. However the hidden page will still be visible to users who've [[configured their user profile to show Hidden Pages>>extensions:Extension.User Profile Application#HEditPreferences]]. By default users don't see hidden pages.
Vincent Massol 146.1 137
Vincent Massol 147.2 138 To hide a page, edit it in Wiki or WYSIWYG edit mode and set the flag as shown below:
139
Gabriela Anechitoaei 149.1 140 {{image reference="hiding.png"/}}
Vincent Massol 146.1 141
Vincent Massol 147.3 142 {{info}}
Vincent Massol 161.2 143 When you're a "Simple" user, you only have a single Edit button available and when clicked that takes you to the default edit mode. If the page you're editing is configured to use the "Form" editor then you won't see the side panel as on the screenshot above. Thus you'll need to [[switch to being an "Advanced" user and Edit in Wiki or WYSIWYG mode>>#HAdvancedMode]].
144 {{/info}}
145
146 {{info}}
Vincent Massol 147.3 147 Hiding is not replacing permissions which is what you'll use if you want to make pages not visible to some user or group.
148 {{/info}}
149
Silvia Macovei 43.3 150 = Form editing mode (aka inline mode) =
Guillaume Lerouge 1.73 151
Vincent Massol 36.1 152 Inline mode, or Form mode, is a special feature of XWiki, that allows administrators to define patterns of structured information (like a blog entry, or a standard tax form). Pages containing such structured information can be edited and re-edited as simple HTML Forms, which have (almost) the same structure as the displayed page. Thus, when clicking the edit button, it seems that the page content can be edited in-place, or inline and the form view is automatically displayed.
Silvia Macovei 28.1 153
Vincent Massol 36.1 154 Technically the inline mode is triggered automatically differently whether the page is written in XWiki Syntax 1.0 or 2.0, using the following algorithm:
Sorin Burjan 70.3 155
Vincent Massol 36.1 156 * XWiki Syntax 1.0: If the page contains a call to ###includeForm()##
157 * XWiki Syntax 2.0: If the page is including another page which itself contains an object of the type ##XWiki.SheetClass##
Guillaume Lerouge 1.73 158
Vincent Massol 162.3 159 Note that it is beyond the scope of this simple guide to explain the programming technique supporting this feature. Please check the [[Developer's Guide>>platform:DevGuide.WebHome]] to find out more about programming with Objects/Classes and Forms.
Guillaume Lerouge 1.73 160
Silvia Macovei 43.3 161 = Objects editing mode =
Guillaume Lerouge 1.73 162
Vincent Massol 162.3 163 In XWiki it's possible to attach Objects to pages. Objects are simple sets of properties with values that add additional information about a page. For example a security right can be added to a page to control its rights, a blog object is attached to a page representing a blog entry, etc. Again, it's beyond this simple guide to explain this programming technique. Please check the [[Developer's Guide>>platform:DevGuide.WebHome]] to know more about programming with Objects/Classes.
Guillaume Lerouge 1.73 164
Manuel Smeria 110.2 165 {{image reference="ObjectEditor.png"/}}
Raluca Moisa 93.4 166
Silvia Macovei 43.3 167 = Classes editing mode =
Guillaume Lerouge 1.73 168
Vincent Massol 162.3 169 We've seen that some pages can have Objects attached to them. Some pages can also be Object definitions, a.k.a Classes. The Classes editing mode calls the class editor on the current page, allowing to edit the Classes attached to the document. Again, it's beyond this simple guide to explain this programming technique. Please check the [[Developer's Guide>>platform:DevGuide.WebHome]] to find out more about programming with Objects/Classes.
Guillaume Lerouge 1.73 170
Manuel Smeria 110.2 171 {{image reference="ClassEditor.png"/}}
172
Manuel Smeria 108.3 173 = Access Rights editing mode =
Guillaume Lerouge 1.73 174
Vincent Massol 162.3 175 This mode allows you to control the access rights for the page you're viewing (you need to have the required access rights to modify a page's rights). See the [[Rights Management>>platform:Features.RightsManagement]] topic for more information.
Guillaume Lerouge 1.75 176
Silvia Macovei 43.3 177 = Full Screen Mode =
Guillaume Lerouge 1.75 178
Gabriela Anechitoaei 150.1 179 A full-screen mode is available in XWiki. When editing a page either in Wiki or WYSIWYG mode, clicking on the button at the top right of the edit box will send the editor in full-screen mode. You can then edit your page as usual and click on the button to return to the usual interface when you are finished.
Guillaume Lerouge 1.75 180
Guillaume Lerouge 31.1 181 //The button you need to click to go in full-screen mode//
Silvia Macovei 106.2 182 {{image reference="FullScreenButton.png"/}}
Guillaume Lerouge 1.77 183
Sorin Burjan 45.1 184 //Editing while in full-screen mode//
Silvia Macovei 106.2 185 {{image reference="FullScreen.png"/}}
Vincent Massol 95.1 186
187 = Title Behavior =
188
189 Pages have both names and titles. The page name is used in the URL to the page while the title is used to display a user-friendly short description of the page. The title is used for example as the top level headings when viewing a page.
190
191 Page titles can be set while editing documents in Wiki or WYSIWYG modes.
192
Vincent Massol 162.3 193 Titles are not mandatory by default but it's possible to [[configure XWiki to make titles mandatory>>platform:AdminGuide.Configuration#HTitlebehavior]].
Vincent Massol 95.1 194
Vincent Massol 144.1 195 The title's content is parsed using Velocity so you're also allowed to put Velocity content in there in addition to plain text (this is for example useful when wanting to internationalize titles). Note that you're not allowed to use any wiki markup.
Vincent Massol 95.1 196
Vincent Massol 144.1 197 When a page has no title set then XWiki will use the page name as its title.
198
199 {{info}}
Vincent Massol 162.4 200 It's also possible to [[configure XWiki to extract the topmost heading>>platform:AdminGuide.Configuration#HTitlebehavior]] from the document's content. For example if you have a level 1 heading, it'll be used as the page title. If you don't have a level 1 heading but have a level 2 heading then the level 2 heading will be used as the page title. The heading level depth XWiki used for titles is controlled in [[XWiki's title configuration>>platform:AdminGuide.Configuration#HTitlebehavior]]. Since you're allowed to use any wiki syntax in headings, if a page doesn't have a title set (and titles are not mandatory) then any wiki markup in the topmost headings will get rendered when displaying the extracted title for that page.
Vincent Massol 144.1 201
202 However this is a backward compatibility option and we do not recommend that you use it. The reason we deprecated this behavior that allowed styling the titles is because it leads to all sorts of issues:
Vincent Massol 163.1 203
Vincent Massol 144.1 204 * The title is used in several places including the browser's title or in LiveTable results and since those places forces to display the title in plain text, this means you'd see wiki markup or HTML displayed as is
205 * When the heading is generated through a script, if that script gets executed outside of the page's rendering context, it can lead to side effects and the page title displayed in LiveTable or other places can be completely wrong
206 {{/info}}
Vincent Massol 163.1 207
208 = Locking =
209
Vincent Massol 164.2 210 By default, when you edit a page, a lock is put on the page, till you either Save or Cancel the edition.
Vincent Massol 163.1 211
Vincent Massol 164.2 212 If you navigate away from the page without Saving or Cancelling, the lock will remain for a predetermined period of time (the duration [[can be configured>>Documentation.AdminGuide.Configuration.WebHome#HLockDuration]]). This is why it's recommended to Cancel if you're not making any change to the page instead of just closing your browser tab for example.
213
214 Anyone trying to edit a page that is locked will see the following warning message allowing you to know that the page is locked and also to force the lock.
215
Vincent Massol 163.1 216 {{image reference="lock.png"/}}
217
Vincent Massol 164.3 218 If you force the lock then the last user who saves will overwrite the content with his version of the page.

Get Connected