3.7 Read-Only Variables

Read-only variables can be used to gather information about the current template, the user who is currently logged in, or other current settings. These variables are read-only and cannot be assigned a value.

3.7.1 Template Read-Only Variables

Template-related read-only variables make it possible to create conditional content in a template based on the identity of the template. These pre-defined variables allow you to display the class, file path, name, or type of any template on a Content Server web page. This is particularly useful while you are developing your Web site.

The following read-only variables are related to templates:

"TemplateType" Template Read-Only Variable Example

In this example, the internal name of the template appears under the Administration link in the left sidebar of all Content Server web pages. To accomplish this change, the pre-defined TemplateName variable (shown in bold below) was added to the pne_nav_admin_links include that defines the Administration links.

The following is an example of using the TemplateName pre-defined variable to display the internal template name on a web page:

<$if IsSubAdmin$>
        <a href="<$HttpCgiPath$>?IdcService=GET_ADMIN_PAGE&Action=
        <img src="<$HttpImagesRoot$>
           <$button_admin_grey_ish_image$>" width="<$navImageWidth$>"         height="<$navImageHeight$>" name="admin" border="0"         alt="<$lc("wwProductAdministration", ProductID)$>"></a>
        <a class=pneHeader href="<$HttpCgiPath$>?IdcService=GET_ADMIN_
    <td colspan=2><font color=#FFFFFF style="Arial"

3.7.2 User Read-Only Variables

User-related read-only variables make it possible to gather information about the current user.

The following read-only variables are related to users:


3.7.3 Content Read-Only Variables

One content-related read-only variable, "SourceID", makes it possible to retrieve the Content ID of the current dynamic server page.

This variable returns the same value as ref:dID. See "Referencing Metadata in Dynamic Server Pages".

3.7.4 Other Read-Only Variables

The following variable is set only as internal flags, so it can be retrieved but not set directly.