Home > Contents > Index >
insite:calltemplate
Defines an editable slot. The slot can be either enabled for:
This tag behaves like
- presentation-editing, if
slotname
if specifeid- content-editing, if
field
is specified- both, if
slotname
andfield
are specifiedrender:calltemplate
when executed outside of the editing UI.Syntax
<insite:calltemplate [cid="id of the asset rendered in slot"] [c="type of the asset rendered in slot"] [tname="rendering template name"] [slotname="name of slot"] [variant="regular expression"] [field="name of the edited asset reference field"] [assetid="id of the edited asset"] [assettype="type of the edited asset"] [context="context override"] [style="pagelet|element|embedded"] [packedargs="packed arguments"]> [args="variable1,variable2,..."]> [site="site name"] [tid="caller Template or CSElement id"] [ttype="Template|CSElement"] [clegal="comma-separated list of allowed types and subtypes"] [cssstyle="CSS class name(s) to add to the slot"] [emptytext="Text displayed when the slot is empty"] [roles="List of roles allowed to edit this slot"] [title="overrides the default slot title"] [index="for multivalued fields, index of the edited item"] [d="Device group suffix"] [resolvetemplatefordevice="A boolean value indicating whether parameter 'd' should be ignored or not."] [<insite:argument name="variable3" value="value3"/>] </insite:calltemplate>
Parameters
c (optional)
- The asset type to be rendered by the called Template. Unlike
<render:calltemplate>
this value can be empty, in which case an empty slot is rendered
cid (optional)
- The id of the asset to be rendered by the called Template. Unlike
<render:calltemplate>
, this value can be empty, in which case an empty slot is rendered
tname (optional)
- The name of the Template to be called. Unlike
<render:calltemplate>
, this value can be empty, in which case the slot data has to specify a template name for the asset to be rendered
variant (optional)
- When presentation editing mode is enabled (i.e.
slotname
is set), this attribute allows to restrict which templates can be selected by contributors as an alternative to the template specified in tname.
slotname (optional)
- When specified, enables presentation-editing mode. This attribute defines an identifier for the "slot" that is being filled with the called template. It should be unique across all templates.
field (optional)
- Indicates which field of the asset specified by
assetid
andassettype
is edited when an asset is dropped in the slot. The field has to be an asset reference field i.e.:
- a flex attribute of type 'asset'
- an asset association. In this case, the expected syntax is
Association-named:nameOfAssociation
- a flex parent asset field. In this case, the expected syntax is
Group_nameOfParentDefinition
ManualRecs
, if the edited asset is a static recommendation
assetid (optional)
- When
field
is specified, indicates the id of the edited asset. By default, set the value of thecid
Sites attribute.
assettype (optional)
- When
field
is specified, indicates the type of the edited asset. By default, set the value of thec
Sites attribute.
clegal (optional)
- A comma-separated list of asset types which are allowed to be dropped in this slot. Subtypes can be specified using the following syntax:
assetType:subtype
, orassetType:*
title (optional)
- Indicates the slot title rendered in slot overlays.
roles (optional)
- Contains a comma-separated list of roles allowed to modify slot presentation. Only applicable when presentation editing is enabled (i.e.
slotname
is specified). For content editing, normal asset privileges apply.
emptytext (optional)
- The text to be rendered inside empty slots
index (optional)
- indicates the 1-based index of the edited item. Applicable only in content editing mode, i.e. when
field
,assetid
andassettype
are specified
cssstyle (optional)
- additional css classes to add to the slot (in editing mode only), whenever css rules need to be adjusted
site (optional)
- see
site
attribute ofrender:calltemplate
tid (optional)
- see
tid
attribute ofrender:calltemplate
ttype (optional)
- see
ttype
attribute ofrender:calltemplate
context (optional)
- see
context
attribute ofrender:calltemplate
style (optional)
- see
style
attribute ofrender:calltemplate
packedargs (optional)
- see
packedarg
attribute ofrender:calltemplate
d (optional)
- see
d
attribute ofrender:calltemplate
resolvetemplatefordevice (optional)
- see
resolvetemplatefordevice
attribute ofrender:calltemplate
insite:argument (optional)
- Nested parameter tag. The insite:calltemplate tag allows arbitrary argument tags to be added in order to pass name/value pairs to the called Template.
Description
This tag can replace render:calltemplate in order to allow content contributors to:
- edit content, i.e. whenever
insite:calltemplate
renders an asset field containing one or more asset references.Thefield
attribute must be specified to enable content editing mode- edit presentation, i.e. allowing to select alternate templates to the ones specified by developers and/or allowing to specify template arguments from the in-context UI.
- the
slotname
attribute has to be specified to enable presentation editing mode.- the
variant
has to be specified in order to specify acceptable alternate templates.- the template arguments which are editable by contributors must be registered as legal arguments (see admin guide for more details)
- both, if
slotname
andfield
are specifiedFor more details, see "Coding Template for Presentation Editing" and "Coding Templates for In-Context Content Editing" in the Sites Developer's Guide.
Context
By default, presentation changes are context-sensitive.
The context is determined by a Sites variable calledcontext
, which is automatically managed by Sites, i.e. every call torender:calltemplate
orinsite:calltemplate
updates the current context by appending:(they are separated by a semi-colon).
- the parent context
- the asset being rendered and the template used to render it, as a string of the form
<c>:<cid>:<tname>
Note that the
context
variable is initially empty, and must be properly initialized in layout templates. For example:<ics:setvar name="context" value='<%=ics.getvar("c") + ":" ics.getvar("cid") ":sectionlayout"%>' /> %=ics.getvar("c")>The default behavior can be modified by using the
context
attribute ofinsite:calltemplate
to override the context value. For example, assume that a layout template calledMyLayout
contains the following code:<insite:calltemplate slotname="MySlot" context="Global" ... />Sincecontext
is set to a constant string, the slot shows the same presentation data across all web pages generated usingMyLayout
.Example 1
This example allows the relatedArticle field of the current asset to be editable in-context (the area delimited by the pagelet becomes a droppable area in the in-context editing UI).<assetset:setasset name="myAsset" type='<%=ics.GetVar("c")>' id='<%=ics.getvar("cid")%>' > <assetset:getattributevalues name="myAsset" attribute="relatedArticle" listvarname="related" <ics:listget listname="relatedStory" fieldname="value" output="articleId" <%-- - renders the related article asset with its summary template. in in-context editing mode, this a droppable area. --%> <insite:calltemplate tname="Summary" c='Article' cid='<%=ics.GetVar("articleId")%>' field="relatedArticle" /> %=ics.getvar("cid")%>'>Example 2
This example builds on the previous code snippet by showing how to enable content contributors to select alternative variants to Summary (which now behaves as default template):<%-- - we now specify the slotname and variant attributes. --%> <insite:calltemplate slotname="MySlot" tname="Summary" variant="Summary1|Summary2" c='Article' cid='<%=ics.GetVar("articleId")%>' field="relatedArticle" /> %-->See also
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.