Customizing Views of Page Properties
- Topics:
- Developing
CREATED FOR:
- Admin
- Developer
Every page has a set of properties that can be viewed and edited by users. Some are required when creating the page (create view), others can be viewed and edited (edit view) at a later stage. These page properties are defined and made available by the dialog (cq:dialog
) of the appropriate page component.
The default state for every page property is:
-
Hidden in the create view (for example, Create Page wizard)
-
Available in the edit view (for example, View Properties)
Fields must be specifically configured if any change is required. This is done using the appropriate node properties:
-
Page property to be available in the create view (for example, Create Page wizard):
- Name:
cq:showOnCreate
- Type:
Boolean
- Name:
-
Page property to be available in the edit view such as the View/Edit Properties option:
- Name:
cq:hideOnEdit
- Type:
Boolean
- Name:
Configuring Your Page Properties
You can also configure the fields available by configuring the dialog of your page component and applying the appropriate node properties.
For example, by default the Create Page wizard shows the fields grouped under More Titles and Description. To hide these you configure:
-
Create your page component under
/apps
. -
Create an override (using dialog diff provided by the Sling Resource Merger) for the
basic
section of your page component; for example:<your-page-component>/cq:dialog/content/items/tabs/items/basic
-
Set the
path
property onbasic
to point to the override of the basic tab (see the next step as well). For example:/apps/demos/components/page/tabs/basic
-
Create an override of the
basic
-moretitles
section at the corresponding path; for example:/apps/demos/components/page/tabs/basic/items/column/items/moretitles
-
Apply the appropriate node property:
- Name:
cq:showOnCreate
- Type:
Boolean
- Value:
false
The More Titles and Description section will no longer be shown in the Create Page wizard.
- Name:
Sample Configuration of Page Properties
This sample demonstrates the dialog diff technique of the Sling Resource Merger including use of sling:orderBefore
. It also illustrates use of both cq:showOnCreate
and cq:hideOnEdit
.
You can find the code of this page on GitHub.