CQ Taglibs
CQ
CQ taglib: http://cognifide.com/jsp/slice/cq
include
Extended version of the cq:include tag. In addition to the original behaviour it allows controlling the WCM mode inside the include, and disabling the decoration markup that's added by WCM by default. The control is done either at component level - using custom properties stored in a component's node, or at the include level - using tag's attributes. Tag's attributes have higher priority than component's meta-data. To force WCM disable / enable set the cog:disableWcm property to true / false respectively (String and Boolean property supported). To set in which modes the decoration is enabled, set the cog:enableDecorationInModes property either as String or multi-value String with one or more of following: disabled, edit, read-only, preview, design, author, publish, all, none.
Attribute | Description | Required? |
---|---|---|
additionalCssClassNames | Comma separated list of additional CSS class names that will be added to wrapping markup | |
disableWcm | If true, the component is always included with WCM disabled (WCMMode.fromRequest(request) == WCMMode.Disabled). If false - the current WCM mode is passed. False by default. Note, that thanks to the include hierarchy, this setting is populated to all child components. This attribute overrides component's cog:disableWcm property. | |
enableDecoration | A decoration is an additional markup required by WCM to draw dialog box and added around the include. If true, the decoration of current component is applied as in default cq:include. If false, no decoration is added. True by default. This configuration setting is not populated to children components. This attribute overrides component's cog:disableDecorationInModes property. | |
flush | if true, tag flushes the output before including the target; false by default | |
ignoreComponentHierarchy | A boolean controlling whether the component hierarchy should be ignored for script resolution. If true, only the search paths are respected. False by default. | |
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. | |
render | if false, tag does not render; true by default | |
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. | |
script | The JSP script to include. Either path and resourceType, or script must be specified. |
a
Renders HTML anchor but does not render empty attributes. In other words, the tag can have attribute defined, but if it's value is empty, it will not be rendered. Additionally, this tag supports externalisation of handles passed in a href attribute.
Attribute | Description | Required? |
---|---|---|
href | href attribute of the <a> tag - specifies the destination of a link | |
id | id attribute of the <a> tag - specifies a unique id for an element | |
clazz | class attribute of the <a> tag - specifies a class name for an element | |
title | title attribute of the <a> tag - specifies extra information about an element | |
target | target attribute of the <a> tag - specifies where to open the linked document | |
name | name attribute of the <a> tag - specifies the name of an anchor | |
rel | rel attribute of the <a> tag - specifies the relationship between the current document and the linked document | |
onclick | onclick attribute of the <a> tag - script to be run on a mouse click | |
extension | specifies extension to be used when externalising if a handle was passed as href | |
selector | specifies selector to be used when externalising if a handle was passed as href | |
externalise | if true - the href value will be externalised | |
render | if false, tag does not render; true by default |
catch
Catches exceptions and renders their stack traces surrounded with <pre> tags, or as HTML comments.
Attribute | Description | Required? |
---|---|---|
throwableVariableName | specifies name under which throwable variable is stored | |
render | if false, tag does not render; true by default |
clearFloat
Inserts <div style="clear:both;font-size:1px"> </div>; in edit mode.
Attribute | Description | Required? |
---|---|---|
render | if false, tag does not render; true by default |
disableWcm
Disables edit mode of components included within the tag.
The tag has no attributes.
externalise
Externalises given handle, i.e. changes it into an absolute link. Only content handles are externalised, anything that doesn't start with /content/ is treated as external link and ignored (the handle attribute is returned). It is assumed that the content handle is valid according to the JSR 170 path specification (http://www.day.com/specs/jcr/1.0/4.6_Path_Syntax.html). This tag does not validate the handle. Externalised link consists of the original handle, followed by '.', then selector, another '.' and extension. Example: for handle=/content/cognifide/en_gb/home, selector=print, extension=html, output link is: /content/cognifide/en_gb/home.print.html
Attribute | Description | Required? |
---|---|---|
handle | handle to be externalised | |
extension | extension if required, can be null or empty, should not contain dots | |
selector | selector if required, can be null or empty, should not contain dots | |
render | if false, tag does not render; true by default |
imageDraw
Draws the given CQ image.
Attribute | Description | Required? |
---|---|---|
image | Image (com.day.cq.wcm.foundation.Image) to be drawn |
includeEmulator
Inserts CQ5 mobile emulator includes - to be used in the head section.
Attribute | Description | Required? |
---|---|---|
render | if false, tag does not render; true by default |