Home > Contents > Index >
Makes an asset field editable in web mode. All data types are supported, except asset reference fields
(to enable in-context editing for asset reference fields, see insite:calltemplate
instead).
<insite:edit [field="edited asset field name"] [assetid="edited asset id"] [assettype="edited asset type"] [mode="text|html"] [editor="type of editor"] [params="editor parameters"] [value="field value"] [index="index of edited value"] [variable="variable name"] [list="list name"] [column="column name"] [ssvariable="session variable name"] [property="property name"] />
field (optional)
assetid (optional)
cid
variable, i.e. the value returned by ics.GetVar("cid")
assettype (optional)
c
variable, i.e. the value returned by ics.GetVar("c")
mode (optional)
text
: <, >, &, < space >, " and ' are encoded to their html numerical code, i.e. <
etc. html
: all characters are streamed as-ishtml
.
editor (optional)
ckeditor
, which specify that the CKeditor rich text editor should be used instead of the default widgetThe default editing widget depends on the data type of the edited field, as summarized in the following table:
Field data type
|
Editing widget
|
---|---|
string |
a dijit.form.ValidationTextBox widget |
date |
a dijit.form.DateTextBox widget |
float |
a dijit.form.NumberTextBox widget |
int |
a dijit.form.NumberTextBox widget, with the appropriate constraints set |
text |
a dijit.form.Textarea widget |
long |
a dijit.form.NumberTextBox widget |
currency |
a dijit.form.CurrencyTextBox widget |
blob |
file upload widget, based on HTMLUploader |
params (optional)
noValueIndicator
: text to be displayed when the field is emptywidth
: specifies the width of the CKEditor instance. This can be an integer, for pixel sizes, or any CSS-defined unit.height
: specifies the height of the CKEditor instance. This can be an integer, for pixel sizes, or any CSS-defined unit (except percents)toolbar
: specifies a toolbar name to useresize
: specifies whether the resize handle should be visible or notcustomConfig
: specifies an alternate CKEditor configuration filewidth
: for text fields, specifies the width of the editing widget (by default, it occupies the available width)constraints
: for text, date or number fields, specifies additional constraints defining valid values.regExp
: regular expression to be used to validate user input.invalidMessage
: tooltip displayed by the editing widget when an invalid value is providedSee examples below or The Dojo Toolkit for more details.
value (optional)
variable
: designates a variable containing the current field valuelist
/column
: designates a list and column containing the current field value.ssvariable
: designates a session variable containing the current field valueproperty
: designates a property containing the current field value
index (optional)
This tag allows content contributors to edit assets using the web mode UI. When viewed outside of the web mode UI, this tag behaves exactly like render:stream
when mode="html"
, or like string:stream
when mode="text"
.
For more information about editing assets in web mode, see the Sites Developer's Guide.
The following example enables in-context editing the headline
of the asset determined by the c
and cid
Sites variables:
<%-- - The code sample assumes the current value of the headline attribute to be available - in a list called "article:headline" with a single column called "value", such as a list - returned by the <assetset:getattributevalues /> tag --%> <h1> <insite:edit field="headline" list="article:headline" column="value" /> </h1>
This example enables in-context editing of the body
field of the asset determined by c
and cid
, using CKEditor with specific parameters:
<%-- - The code sample assumes the current value of the body attribute to be available - in a variable called "articleBody" --%> <h1> <insite:edit field="body" variable="articleBody" editor="ckeditor" params="{noValueIndicator: '[ Enter body here ]', width: '100%'}" /> </h1>
The width of text fields can also be controlled using the width
parameter as follows:
<h1> <insite:edit field="headline" list="article:headline" column="value" params="{width: '300px'}" /> </h1>
In the following example, a price
attribute (e.g. a money
attribute) is constrained to the 0-100 range, and is required to have 2 decimals (e.g. 10.99):
<%-- - The code sample assumes the current value of the price attribute to be available - in a list called "product:price" with a single column called "value", such as a list - returned by the <assetset:getattributevalues /> tag --%> <insite:edit field="price" list="product:price" column="value" params="{constraints: {fractional: true, max: 100.00}, invalidMessage: 'Price must include cents'}" />For more details on dojo constraints, see the following dojo documentation on dates and numbers.
For more information about editing assets in web mode, see "Coding Templates for In-Context Content Editing" in the Sites Developer's Guide.
Home > | Contents > | Index > | ||
![]() |
Oracle JSP Tag Reference |