Home > Contents > Index >
Template Tags TOC   |    Alpha TOC   |    Tag Family TOC   |    Purpose TOC   |    Annotated TOC   |    Index 

 

render:gettemplateurlparameters

Looks up all of the URL parameters that would have been set into a URL and returns them in the form of a List instead of as a URL.

Syntax

<render:gettemplateurlparameters
       [c="asset type"]
       [cid="asset id"]
       [context="context override"]
       [deptype="exists|none"]
        outlist="name of list to contain output"
       [packedargs="stringFromPACKARGStag"]
        site="site name"
        slotname="name of slot"
        tid="caller Template or CSElement id"
       [tname="target Template or CSElement name"]
       [ttype="caller Template or CSElement"]
       [variant="template variant name"]
       [wrapperpage="name of uncached wrapper page"]
        />

   [<render:argument name="variable1" value="value1"/>]

</render:gettemplateurlparameters>

Attributes

c (optional)
The asset type which will be rendered using the referenced template, that will be the target of the URL generated. The value of this attribute will be specified on the URL. If c, cid, and tname are set, then context data is ignored.
cid (optional)
The asset id which will be rendered using the referenced template, that will be the target of the URL generated. The value of this attribute will be specified on the URL. If c, cid, and tname are set, then context data is ignored.
context (optional)
This attributes contains a context override parameter. If c, cid, and tname are not specified, then this attribute value will be examined to determine which template will be used and which asset for which a URL will be generated. If this value is not specified, then an ICS variable of the same name will be examined for the same purpose. If no context value can be located, then the URL will not be generated, and this tag will do nothing. Future versions of CS Direct will provide an interface that allows the context data to be set automatically. Manually overriding this value should be considered an advanced technique.
deptype (optional)
Input. This attribute specifies whether approval dependency is exists, or none. exists (default) specifies that any version of the asset satisfies the dependency condition; none specifies no approval dependency on the asset.
outlist (required)
Input. Name of the list to contain the parameters. The output list has two columns: name and value, corresponding to the variable name and variable value, respectively.
packedargs (optional)
This attribute contains a series of arguments (name-value pairs) URL-encoded as a string.
site (required)
The name of the site containing the Template to be referred to by the URL.
slotname (required)
This attribute defines an identifier for the "slot" that this URL represents. The concept of a URL as a slot is slightly unintuitive, but as it refers to an asset-template combination, it can therefore be changed to refer to any other asset-template combination. It should be reasonably easy to understand for humans and should be unique across all templates. Future versions of CS Direct will make extensive use of the slotname attribute.
tid (required)
The id of the template in which this tag is located. If this tag is located in a CSElement, then the value of this attribute should be the id of the CSElement, and ttype should be set to CSElement.
tname (optional)
The name of the Template to be called. This is required if c and cid are set. If these three attributes are not set, the called template will be determined by looking at context data.
ttype (optional)
This attribute identifies whether the code that contains this tag is a Template or a CSElement. The default value is Template, and CSElement is the other legal value. See tid.
variant (optional)
This attribute specifies the name of the Template variant to render. Template variants enable multiple code implementations of a Template (for example, WEP vs XHTML). Future versions of CS Direct may implement this feature; as of the current release it is not yet supported.
wrapperpage (optional)
Input. If the target uses an uncached wrapper page, supply this argument with the name of that SiteCatalog page. The pagename argument will be passed as "childpagename". c, cid, and p will be preserved. All other arguments are passed as packedargs to allow for easy wrapperpage creation.

Parameters

render:argument (optional)
Nested parameter tag. The render:gettemplateurlparameters tag allows arbitrary argument tags to be added in order to add name/value pairs to the URL to be generated.

Description

This tag returns a list of all of the parameters that would have been present in the URL when generated using the render:gettemplateurl tag. In some cases, the parameters are more important than the actual URL, and this tag provides access to them. It follows through the same variable resolution as the gettemplateurl tag, so details about how the attribute interact can be found in the gettemplateurl documentation.

errno

The possible values of errno include:

Value
Description
-10004
A required parameter is missing .

Example

The following example contains an excerpt from the FirstSite Mark II Product_C AddToCart template. It constructs a form which contains all of the parameters that would ordinarily have occurred in the URL as hidden input fields.

In this tag, most of the attribute values are set from other variables in the variable space, either because they have been passed in, or because they have been explicitly looked up. The following table describes the origin of the ICS variables referenced below.

Variable origins
Variable name Origin
site The site variable is set as a resarg in all of the templates and SiteEntry assets. As such, it can be expected to be set correctly to the name of the current site.
tid The tid variable is set in the resargs of the called template. Because this code is in a Template, the tid attribute is set to the value of the tid variable. If this code had been located in a CSElement, this attribute would have been set to the value of the eid variable and the ttype attribute would also have been set to CSElement. See above for details.
c The c variable is specified on the URL and is passed unchanged into the Layout template.
cid The cid variable is specified on the URL and is passed unchanged into the Layout template.
p The variable p is specified on the URL and is passed unchanged into the layout template.
LayoutVar This variable is looked up from the template's map.
WrapperVar This variable is looked up from the template's map.
<%-- Look up the parameters --%>
<render:gettemplateurlparameters 
        outlist="args" 
        tid='<%=ics.GetVar("tid")%>' 
        slotname="AddToCart" 
        site='<%=ics.GetVar("site")%>' 
        c='<%=ics.GetVar("c")%>' 
        cid='<%=ics.GetVar("cid")%>' 
        tname='<%=ics.GetVar("LayoutVar")%>' 
        wrapperpage='<%=ics.GetVar("WrapperVar")%>' 
        >
    <render:argument name="p" value='<%=ics.GetVar("p")%>'/>
</render:gettemplateurlparameters>

<%-- create a form, note the method is POST --%>
<satellite:form method="post" id="AddToCartForm">

    <%-- Loop through all of the url parameters and set them
         into the form as hidden fields so the data is sent 
         back to CS as needed.  These variables will include
         pagename, wrapperpage, c, cid, p, possibly rendermode
         and possibly others. --%>
    <ics:listloop listname="args">
        <input type="hidden" 
               name="<string:stream list="args" column="name"/>" 
               value="<string:stream list="args" column="value"/>"
        />
    </ics:listloop>

    ...

</satellite:form>

See Also

render:lookup

render:gettemplateurl

  Home > Contents > Index >

FatWire JSP Tag Reference
Copyright 2005,2006,2007 by FatWire Software
All rights reserved.