Home > Contents > Index >
Template Tags TOC | Alpha TOC | Tag Family TOC | Purpose TOC | Annotated TOC | Index
insite:calltemplate
Defines an editable slot. The slot can be either enabled for:
This tag behaves like
- presentation-editing, if
slotnameif specifeid- content-editing, if
fieldis specified- both, if
slotnameandfieldare specifiedrender:calltemplatewhen 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.
slotnameis 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
assetidandassettypeis 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_nameOfParentDefinitionManualRecs, if the edited asset is a static recommendation
assetid (optional)- When
fieldis specified, indicates the id of the edited asset. By default, set the value of thecidSites attribute.
assettype (optional)- When
fieldis specified, indicates the type of the edited asset. By default, set the value of thecSites 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.
slotnameis 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,assetidandassettypeare 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
siteattribute ofrender:calltemplate
tid (optional)- see
tidattribute ofrender:calltemplate
ttype (optional)- see
ttypeattribute ofrender:calltemplate
context (optional)- see
contextattribute ofrender:calltemplate
style (optional)- see
styleattribute ofrender:calltemplate
packedargs (optional)- see
packedargattribute ofrender:calltemplate
d (optional)- see
dattribute ofrender:calltemplate
resolvetemplatefordevice (optional)- see
resolvetemplatefordeviceattribute 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:calltemplaterenders an asset field containing one or more asset references.Thefieldattribute 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
slotnameattribute has to be specified to enable presentation editing mode.- the
varianthas 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
slotnameandfieldare 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:calltemplateorinsite:calltemplateupdates 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
contextvariable 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"%>' />The default behavior can be modified by using the
contextattribute ofinsite:calltemplateto override the context value. For example, assume that a layout template calledMyLayoutcontains the following code:<insite:calltemplate slotname="MySlot" context="Global" ... />Sincecontextis 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 renders a droppable area. --%> <insite:calltemplate tname="Summary" c='Article' cid='<%=ics.GetVar("articleId")%>' field="relatedArticle" />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, Oracle and/or its affiliates. All rights reserved.