GalleryWidgets
From OpenCms Wiki
(Difference between revisions)
(Created page with "== Description == All standard gallery widgets (DownloadGalleryWidget, LinkGalleryWidget, HtmlGalleryWidget and TableGalleryWidget) share some configuration op...") |
(Added config example) |
||
(2 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
− | All standard gallery widgets ([[DownloadGalleryWidget]], [[ | + | All standard gallery widgets ([[DownloadGalleryWidget]], [[HtmlGalleryWidget]], [[ImageGalleryWidget]], [[LinkGalleryWidget]] and [[TableGalleryWidget]]) share some configuration options. |
== Configuration == | == Configuration == | ||
Line 10: | Line 10: | ||
<layouts> | <layouts> | ||
<layout element="..." widget="..." configuration="..." /> | <layout element="..." widget="..." configuration="..." /> | ||
+ | |||
+ | The configuration String is written as JSON (JavaScript Object Notation) object. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <layout ... configuration="{ | ||
+ | class: 'org. ... .CmsGalleryWidgetConfiguration', | ||
+ | type: 'dynamic', | ||
+ | startup: 'dynamic', | ||
+ | }"/> | ||
== Options == | == Options == | ||
− | ;type : defines the startup folder type that the widget should display when opened, either | + | ;type : defines the startup folder type that the widget should display when opened, either <tt>gallery</tt> or <tt>category</tt> |
− | ;startup : defines the startup folder that the widget should display when opened, e.g. | + | ;startup : defines the startup folder that the widget should display when opened, e.g. <tt>/demo_en/images/</tt> |
− | ;class: optional class implementing the interface | + | ;class: optional class implementing the interface <tt>[[I_CmsGalleryWidgetDynamicConfiguration]]</tt> in the package <tt>org.opencms.widgets</tt>. This class can configure dynamic startup parameters. |
+ | |||
+ | ==See also== | ||
+ | *[[XMLContent]] |
Latest revision as of 17:53, 14 September 2012
Contents |
Description
All standard gallery widgets (DownloadGalleryWidget, HtmlGalleryWidget, ImageGalleryWidget, LinkGalleryWidget and TableGalleryWidget) share some configuration options.
Configuration
Remember that all configuration options have to be added in the annotation section of the XSD:
<xsd:annotation> <xsd:appinfo> <layouts> <layout element="..." widget="..." configuration="..." />
The configuration String is written as JSON (JavaScript Object Notation) object.
Example:
<layout ... configuration="{ class: 'org. ... .CmsGalleryWidgetConfiguration', type: 'dynamic', startup: 'dynamic', }"/>
Options
- type
- defines the startup folder type that the widget should display when opened, either gallery or category
- startup
- defines the startup folder that the widget should display when opened, e.g. /demo_en/images/
- class
- optional class implementing the interface I_CmsGalleryWidgetDynamicConfiguration in the package org.opencms.widgets. This class can configure dynamic startup parameters.