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 render: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 and assettype 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 the cid Sites attribute.

assettype (optional)
When field is specified, indicates the type of the edited asset. By default, set the value of the c 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, or assetType:*

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 and assettype 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 of render:calltemplate

tid (optional)
see tid attribute of render:calltemplate

ttype (optional)
see ttype attribute of render:calltemplate

context (optional)
see context attribute of render:calltemplate

style (optional)
see style attribute of render:calltemplate

packedargs (optional)
see packedarg attribute of render:calltemplate

d (optional)
see d attribute of render:calltemplate

resolvetemplatefordevice (optional)
see resolvetemplatefordevice attribute of render: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:

For 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 called context, which is automatically managed by Sites, i.e. every call to render:calltemplate or insite:calltemplate updates the current context by appending:

(they are separated by a semi-colon).

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"%>' />

The default behavior can be modified by using the context attribute of insite:calltemplate to override the context value. For example, assume that a layout template called MyLayout contains the following code:

  <insite:calltemplate slotname="MySlot" context="Global" ... />
Since context is set to a constant string, the slot shows the same presentation data across all web pages generated using MyLayout.

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

insite:slotlist

   Home > Contents > Index >

Oracle JSP Tag Reference
Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.