Pages Component Tags (cpp)
The tags for rendering the HTML code of a content component are the subject of this tag description page. The tags to implement editing UI components such as dialogs are described in Pages Editing Tags.
Some component rendering tags are declaring a model variable like the 'component' tag of the general Nodes tag library (see: 'component' tag in the General Tags); the model attributes are:
- var
the name of the model variable; this name must be unique in the chosen scope - type
the full class name of the models Java class - scope
the scope of the declared variable (page, request, session) - replace
if 'true' an existing value of the same type is replaced by a new instance otherwise an existing instance of the chosen type is reused
Some component rendering tags are using a set of general attributes to support component styling:
- cssBase
this attribute declares the 'cssBase' variable value and overwrites the default 'cssBase' value derived from the components resource type (see: Component Styling); the CSS class declared as 'cssBase' is rendered as the 'main' CSS class of the HTML code rendered by a tag of this taglib - cssAdd
this attribute declares additional CSS classes for the HTML rendered by a tag of the taglib; these classes are added to the 'main' class declared as 'cssBase' - cssSet
this attribute specifies the 'main' class of the HTML tag to render; it overwrites the implicit used 'cssBase' main class, the 'cssBase' variable is declared furthermore and can be used but is not rendered as a tags CSS class if 'cssSet' is specified
head
The PageBodyTag creates the HTML body tag and the EDIT elements around the page content.
body
The PageBodyTag creates the HTML body tag and the EDIT elements around the page content.
Attributes
-
tagId
the optional element id for the BODY DOM element
-
cssBase
specifies the 'cssBase' value and overwrites the default value derived from the component resource type
-
cssSet
the 'main' CSS class for the produced tag (hides the 'cssBase' class)
-
cssAdd
additional CSS classes added to the 'main' CSS class specified by the 'cssBase' or 'cssSet' attribute
defineObjects
The extended define objects tag.
Examples
-
<cpp:defineObjects/>
- pagesAccessAuthor , pagesAccessPreview , pagesAccessPublic : boolean variables that are true if the request runs in access mode author / preview / public , respectively.
- pagesModeNone, pagesModePreview, pagesModeEdit, pagesModeDevelop : boolean variables that are true if the request runs in display mode none, preview, edit or develop, respectively.
token
The tag to render a token request (image).
Attributes
-
test
nothing is rendered if the test attribute value is "false' (general condition)
include
Extends the sling:include Tag options.
Attributes
-
flush
Whether to flush the output before including the target
-
path
The path to the resource object to include in the current request processing. If this path is relative it is appended to the path of the current resource whose script is including the given resource. Either resource or path must be specified. If both are specified, the resource takes precedences.
-
resourceType
The resource type of a resource to include. If the resource to be included is specified with the path attribute, which cannot be resolved to a resource, the tag may create a synthetic resource object out of the path and this resource type. If the resource type is set the path must be the exact path to a resource object. That is, adding parameters, selectors and extensions to the path is not supported if the resource type is set.
-
resource
The resource object to include in the current request processing. Either resource or path must be specified. If both are specified, the resource takes precedences.
-
addSelectors
Works like addSelectors from sling:include
-
replaceSelectors
Works like replaceSelectors from sling:include
-
replaceSuffix
Works like replaceSuffix from sling:include
-
var
the name of the model variable; this name must be unique in the chosen scope
-
scope
The scope in which the variable is stored: page (= default), request or session .
-
dynamic
Whether to force dynamic include as a separate request depending on the server settings. Handle with care: on SSI include, some parameters are not effective anymore.
-
mode
the optional display mode for the include (Pages editing mode), or "request" to take the mode from the request itself (to reset overrides).
-
subtype
an optional subtype to include editing components of a component
-
test
include only if the result of this test expression is 'true' (boolean)
dropZone
A tag to declare a drop zone to change a property by dropping an asset or component (edit mode only).
Attributes
-
tagName
the name of the HTML tag; default: 'div'
-
resource
the resource to modify (default is the resoiurce of the enclosing 'element')
-
resourcePath
the path of the resource to modify (alternative to the 'resource' attribute)
-
property
the path (name) of the property relative to the resource
-
i18n
use localized property path if 'true'
-
filter
the filter key set to determine an appropriate drag operation
-
successEvent
the event key of the event to trigger after a successful change request
-
mode
the optional display mode for the include (Pages editing mode), or "request" to take the mode from the request itself (to reset overrides).
-
cssBase
specifies the 'cssBase' value and overwrites the default value derived from the component resource type
-
cssSet
the 'main' CSS class for the produced tag (hides the 'cssBase' class)
-
cssAdd
additional CSS classes added to the 'main' CSS class specified by the 'cssBase' or 'cssSet' attribute
container
the tag to render a Pages Sling container
Attributes
-
var
the name of the model variable; this name must be unique in the chosen scope
-
type
the full class name of the models Java class
-
scope
The scope in which the variable is stored: page (= default), request or session .
-
replace
if 'true' an existing value of the same type is replaced by a new instance otherwise an existing instance of the chosen type is reused
-
test
nothing is rendered if the test attribute value is "false' (general condition)
-
mode
The edit mode for this render step and all included components
-
decoration
If false, the decoration div will not be written.
-
tagId
the optional DOM tree id for the HTML tag
-
tagName
the tag name to render the wrapping tag (default: 'div')
-
cssBase
specifies the 'cssBase' value and overwrites the default value derived from the component resource type
-
cssSet
the 'main' CSS class for the produced tag (hides the 'cssBase' class)
-
cssAdd
additional CSS classes added to the 'main' CSS class specified by the 'cssBase' or 'cssSet' attribute
-
tagAttributes
a string of tag attributes embedded 'as is' in the rendered HTML tag; this is useful if tag attributes are calculated by the model implementation and used in the tag which declares the model instance variable - with the @{...} JSP-EL expression declaration such a set of dynamic tag attributes can be embedded
element
the tag to render a Pages Sling element
Attributes
-
var
the name of the model variable; this name must be unique in the chosen scope
-
type
the full class name of the models Java class
-
scope
The scope in which the variable is stored: page (= default), request or session .
-
replace
if 'true' an existing value of the same type is replaced by a new instance otherwise an existing instance of the chosen type is reused
-
test
nothing is rendered if the test attribute value is "false' (general condition)
-
mode
The edit mode for this render step and all included components
-
tagId
the optional DOM tree id for the HTML tag
-
tagName
the tag name to render the wrapping tag (default: 'div')
-
cssBase
specifies the 'cssBase' value and overwrites the default value derived from the component resource type
-
cssSet
the 'main' CSS class for the produced tag (hides the 'cssBase' class)
-
cssAdd
additional CSS classes added to the 'main' CSS class specified by the 'cssBase' or 'cssSet' attribute
-
tagAttributes
a string of tag attributes embedded 'as is' in the rendered HTML tag; this is useful if tag attributes are calculated by the model implementation and used in the tag which declares the model instance variable - with the @{...} JSP-EL expression declaration such a set of dynamic tag attributes can be embedded
model
A tag to instantiate a model object.
Attributes
-
var
the name of the model variable; this name must be unique in the chosen scope
-
type
the full class name of the models Java class
-
scope
The scope in which the variable is stored: page (= default), request or session .
-
replace
if 'true' an existing value of the same type is replaced by a new instance otherwise an existing instance of the chosen type is reused
-
path
The resource path to create the model from, if it isn't the currently rendered resource.
-
resource
The resource to create the model from. if it isn't the currently rendered resource.
-
cssBase
specifies the 'cssBase' value and overwrites the default value derived from the component resource type
-
test
nothing is rendered if the test attribute value is "false' (general condition)
property
A tag to instantiate a property model object.
Attributes
-
var
the name of the model variable; this name must be unique in the chosen scope
-
type
the full class name of the models Java class
-
scope
The scope in which the variable is stored: page (= default), request or session .
-
replace
if 'true' an existing value of the same type is replaced by a new instance otherwise an existing instance of the chosen type is reused
-
property
The name of the property of the resource from which we create the model.
-
i18n
If true, i18n is observed - the model is instantiated from the i18nized property.
-
cssBase
specifies the 'cssBase' value and overwrites the default value derived from the component resource type