Home > Contents > Index >
Template Tags TOC | Alpha TOC | Tag Family TOC | Purpose TOC | Annotated TOC | Index
insite:edit
Edits assets from the user interface.
Syntax
<insite:edit assetid="ID of asset" assetfield="Attribute_name of asset's field" assettype="type of asset" [ewebeditpro="true|false"] (deprecated) [mode="text|html"] [editor="type of editor"] [params="editor parameters"] [width="pixels or percentage"] [height="pixels"] [assetfieldvalue="field value to be edited"] [variable="variable name"] [ssvariable="session variable name"] [property="property name"] [list="list name"] [column="column name"] />Parameters
assetid (required)
- ID of the asset to be edited.
assetfield (required)
- Name of the field of the asset to be edited.
assettype (required)
- Type of asset to be edited.
mode (optional)
- Legal values are
html
ortext
. The default value ishtml
. When choosingtext
, Content Server will encode characters such as <, >, &, etc.
ewebeditpro (deprecated)
- Deprecated. Use
editor
parameter instead.
editor (optional)
- The name of the editor to use for the attribute. Valid values are:
fckeditor
- uses the FCKeditor rich text editorewebeditpro
- uses the EWebEditPro rich text editortext
- the old inline text editor; works only in Internet Explorerdojotext
(default) - liketext
, but works in both Internet Explorer and Firefoxnumber
(for numeric fields) - likedojotext
, but can impose numeric restrictions on valuesspinner
(for integer fields) - likenumber
, but adds up/down arrows to increment/decrement the valuecurrency
(for money fields) - likenumber
, with some additional restrictionscalendar
(for date fields) - displays a calendar to select a date
params (optional)
- when
editor
is specified as"dojotext"
,"number"
,"spinner"
,"currency"
, or"calendar"
, this specifies, in JSON format, the parameters that should be passed to the underlying Dojo widgets. See The Dojo Toolkit for more information about the widgets.
width (optional)
- Width of the asset in percentage or pixels. The default value is
100%
for eWebEditPro or450
pixels for FCKEditor. When combined witheditor="dojotext"
, specifying a value (in pixels) for the width attribute will display a fixed-size edit box, instead of an autoresizable edit box.
height (optional)
- Height of the asset in pixels only. The default value is
200
pixels. Percentage values are unsupported. Height only works for FCKEditor.
Additionally, one of the following must be specified:
assetfieldvalue
- Literal value to initially fill in the field.variable
- Name of the Content Server variable that you want to stream to a page. For example, for a variable called foo, set the parameter equal to foo rather than toVariables.foo
.ssvariable
- Name of the Content Server session variable that you want to stream to a page.property
- A Content Server property from the futuretense.ini property file.list
andcolumn
- Specifies the name of a list, and the field within the list, respectively, to use for the value of this field.Description
This tag allows you to edit assets from the Insite Editor UI. When viewed outside of the InSite Editor UI, this tag behaves exactly like
render:stream
whenmode="html"
, or likestring:stream
whenmode="text"
.When editing flex assets, the attribute name should be preceded by the prefix
Attribute_
in the value ofassetfield
; for example, theFSIIBody
attribute should be specified asAttribute_FSIIBody
. For more information about editing assets, see the CS Developer's Guide.Examples
The following example facilitates editing a string field, using the default dojotext field editor (which supports both Internet Explorer and Firefox).
<%-- The code sample assumes the initial value of the FSIIHeadline attribute is stored in a CS variable called "Headline". --%> <insite:edit assetid='<%=ics.GetVar("cid")%>' assettype='<%=ics.GetVar("c")%>' assetfield="Attribute_FSIIHeadline" variable="Headline" />The following example facilitates editing a string field, using the formerly-default inline text field editor (which only supports Internet Explorer). It also illustrates initializing the value from a field in a list.
<%-- The code sample assumes the initial value of the FSIIHeadline attribute is stored in a list called "Articles", in a column called "Headline". This will only work on Internet Explorer, since the text editor type uses the WYSIWYG editing capabilities provided by this browser. --%> <insite:edit assetid='<%=ics.GetVar("cid")%>' assettype='<%=ics.GetVar("c")%>' assetfield="Attribute_FSIIHeadline" list="Articles" column="Headline" editor="text" />The following example facilitates editing a blob field with FCKEditor.
<%-- The code sample assumes the initial value of the FSIIBody attribute is stored in a CS variable called "Body". --%> <insite:edit assetid='<%=ics.GetVar("cid")%>' assettype='<%=ics.GetVar("c")%>' assetfield="Attribute_FSIIBody" variable="Body" editor="FCKEditor" width="400" height="300" />The following example facilitates editing a date field with Dojo's calendar widget.
<%-- The code sample assumes: 1) the initial value of the FSIIPostDate attribute is stored in a CS variable called "FormattedPostDate". 2) the date format is "MM/dd/yy" --%> <insite:edit assetid = '<%=ics.GetVar("cid")%>' assettype = '<%=ics.GetVar("c")%>' assetfield = "Attribute_FSIIPostDate" variable = "FormattedPostDate" editor = "calendar" params = "{constraints:{datePattern: 'MM/dd/yy'}}" />The following example facilitates editing an 'int' flex attribute with dojo's NumberSpinner widget.
<%-- The code sample assumes: 1) a flex attribute called "MyIntAttribute", with data type 'int' has been defined 2) the initial value of the attribute is stored in a CS variable called "MyIntAttribute". The number spinner will warn the user if the value is not in the 0-100 range. --%> <insite:edit assetid = '<%=ics.GetVar("cid")%>' assettype = '<%=ics.GetVar("c")%>' assetfield = "Attribute_MyIntAttribute" variable = "MyIntAttribute" editor = "spinner" params = "{constraints:{min: 0, max: 100, places: 0}}" />
The following example facilitates editing a 'money' flex attribute with dojo's CurrencyTextBox widget.
<%-- The code sample assumes: 1) the initial value of the FSIIPrice attribute is stored in a CS variable called ‘Price’. 2) the number is formatted using the default currency format for the en_US locale --%> <insite:edit assetid = '<%=ics.GetVar("cid")%>' assettype = '<%=ics.GetVar("c")%>' assetfield = "Attribute_FSIIPrice" variable = "Price" editor = "currency" params = "{lang: 'en-us'}" />
Home > Contents > Index > ![]()
FatWire JSP Tag Reference
Copyright 2005 - 2011 by FatWire Corporation
All rights reserved.