Syntax Guide

Article number: 305393
Last updated: 01 February 2017

Sitekit: syntax

This page summarises all instances of the Sitekit Namespace specific markup that uses the '<sitekit:attribute />' syntax. All of the following elements are listed elsewhere but this page brings them together in a single summarised list. The list includes:

 

 

Sitekit editable zones

<sitekit:zone id="zone-name"/>

Place marker for an editable zone on page titled 'zone-name'. This can be added to page or content layouts to replace body fields and images fields below. Allows multiple editable text, image, form, variable block and data islands to be dragged into it on the editing screen. Other option include attributes like hidden, class and title, the latter two only accessed in admin See zone editing. Added in 11.0

Sitekit type 6 Navigation

Sitekit 9.2 introduced a new method of navigation, referred to as Type 6 Navigation. The syntax is entirely different from the earlier 1-5 navigation types.

Syntax

<sitekit:navigation id="myNav" class="myCSSClass" />

or

<sitekit:navigation id="myNav" class="myCSSClass"></sitekit:navigation>

Attributes

Nine attributes can be specified, as listed below.

Attribute Name

Type

Default Value

Description

includeancestorsiblings

True/False

True

If "true", siblings of ancestors to the current page are included in the navigation.

includesiblings

True/False

True

If "true", siblings of the current page are included in the navigation.

maxincludechildlevels

Integer

1

If "0" then no children of the current page are shown.
If "1" then the children are shown.
If "2" then children and grandchildren are shown

… etc.

maxincludedancestorlevels

Integer

100

If "0" then no ancestors are shown.
If "1" then then the Parent is shown.
If "2" then the Parent and Grandparent are shown

.… and so on, up to 100 levels.

includesummaries

True/False

False

10.2 and above - If "true", page summaries will be included in the navigation. If the page has no summary then the auto-summary will be used instead.

includeeditprofile

True/False

True

If "true", then the user's profile is shown, if he or she is logged in.

includelogout

True/False

True

If "true" then a logout link is included in the navigation, if the user is logged in.

accesskeystart

Single Character

(off)

If no value is specified, then access keys are turned off.

If you enter "H", for example, then access keys are turned on, starting with the letter H.

absstartlevel

Integer

0

Specifies the absolute level at which the Navigation will start. No pages above this level will be included in Navigation.

Note that Level 0 is the root.

absendlevel

Integer

100

Specifies the absolute level at which the Navigation will end. No pages below this level will be included in Navigation.

Note that Level 0 is the root.

start

Integer

Specifies the shortcutID specifying the level of the nav to start on. Useful for megamenus (Added in v9.6.4)

Sitekit conditional if


<sitekit:if op1="operand-value" operator="operator-value" op2="operand-value">

...any HTML markup or sitekit placeholders go here...

</sitekit:if>

Operand-values can be any of the sitekit magic words, any text string or a http request (see below).

Operator-values can be:

  • = or == (equals);
  • != or !== or <> (not equal);
  • in (op2 contains op1);
  • not in (op2 does not contain op1); or
  • overlaps (see example 4, op1 is a subset or full set of op2)

Sitekit server side redirect

If you wish a page to redirect to another you can use a server redirect by adding;

<sitekit:redirect url="http://the.url.to/redirect.to" type="301" />

… to a page layout, or a variable block, or within a BODY block.

This defaults to a 302 unless the optional type declaration says 301. Only 301 and 302 are supported. This can be nested within Sitekit 'if' statements to provide logic, and the redirect will not be followed when the if statement returns false.

Because of the page parse order the redirection can also be embedded in XSL (where it needs to be encoded) to capture or deal with null results for example;

XSL extract

<xsl:template match="Holiday"> 
	<xsl:choose> 
		<xsl:when test="Visible='false' or Visible=''"> 
			<xsl:text disable-output-escaping="yes"><sitekit:redirect url="/holiday-not-found.htm"/></xsl:text> 
		</xsl:when> 
		<xsl:otherwise> 
			<xsl:if test=" HolidayTestimonial!=''"> 
				<div id="customer-letters" class="content-box-outer">…</div> 
			</xsl:if> 
		</xsl:otherwise> 
	</xsl:choose> 
</xsl:template>

Recursive downloads library

Displays a navigable document library in page allowing navigation down through nested folders. Simplest example is below

<sitekit:docfinder url="/downloads" />

Configuration options are available below. The specific script required are handled by the script manager (10.2)

<sitekit:docfinder id="docfinder1" css="/css/mystyles.css" filter="downloadfiles" url="/downloads/" onassetclick="clickhandler"/>

Options:

  • id - [optional] id for the doc-finder container div.
  • css - [optional] allows a specific stylesheet to be used for doc-finder styles.
  • filter - [optional] can take the following options : 'downloadfiles', 'images', 'editorialpages', 'none'.
  • url - [optional] the url of the root folder for the doc finder assets
  • onassetclick – optional customisable click handler This allows full control over the content of the summary panel or allows the summary panel to be removed entirely.

Sitekit page information

If bodyX exists on the specified page (specified by editorialid and lang or pageParentlevel) then it is returned (or else a blank string is returned). The presence of text can also be checked by testing whether bodylengthX>0 The attributes and attribute vales are all case sensitive. If the summary field is blank autosummary is used. For example

<sitekit:info pageEditorialid="009001" lang="EN" fielddisplayed="navtitle" />

<a href="<sitekit:info fielddisplayed="absurl" pageParentlevel="1" />">Home page</a>

<a href="<sitekit:info fielddisplayed="absurl" pageParentlevel="2" />">Ians page</a>

Indexed Search Widget Syntax

Once created, an Indexed Search is deployed as a search form UI on a web page. It requires two elements. the search widget and the results widget

The search widget can be added to a Page Layout, Content Layout, or a Variable Block.

This bit outputs the form to use

<sitekit:search id="Search1" class="Search" action="/search-results.htm" indexname="Search" labeltooltip="" labeltext=" " textboxtooltip="" textboxtext="" textboxplaceholder="" buttontooltip="" buttontext="" />

Parameter

What it's used for

id

Sets html form element id.

class

Sets html form element class.

action

Sets html form element action. This is where the form is posted to.

indexname

Specifies the search index to be searched.

labeltooltip

Sets tooltip of label or in html label title.

labeltext

Sets text of label or in html label value.

textboxtooltip

Sets tooltip of text or in html input type text title.

textboxtext

Sets text of textbox or in html input type text value.

textboxplaceholder

Sets the html input type text placeholder.

buttontooltip

Sets tooltip of button or in html input type submit title.

buttontext

Sets text of button or in html input type submit value.

Indexed Search Result Widget Syntax

Once created, an Indexed Search is deployed as a search form UI on a web page. It requires two elements. the search widget and the results widget

The Result widget can be added to a Page Layout, Content Layout, or a Variable Block.

This bit outputs the list of results

<sitekit:searchresults id="SearchResults1" class="SearchResults" indexname="SiteSearch" />

Parameter

What it's used for

id

Sets html form element id.

class

Sets html form element class.

indexname

Searches this index with term posted in corresponding search widget with the same index name.

show (optional)

Set to a comma-separated list of selections [summary, context, description, keywords, link, all, none]

If you select context then the data returned will be taken from the page title, keywords, metadata and content text. If you select summary, the returned data will be taken from the page's metadata description alone. Selecting description, keywords or link will display these specific elements. Option all and none are obvious.

Related questions


This article was last updated on 01 February 2017. Did you find it helpful?