Syntax Guide

Article number: 300858

Functional place markers

The following are mainly used Sitekit page layouts .spl files, though again they can be applied in Content layout .scl files and within page bodies.

Breadcrumb

Syntax element

What it's for

<BREADCRUMB>

Root XML element encloses entire Breadcrumb Trail configuration.

<STARTPAGE>…</STARTPAGE>

The editorialID (same as StartLocID if home page) of the page on which you want the breadcrumb trail to start being displayed.

<CLASSNAME>…</CLASSNAME>

Classname is used in the site stylesheet to control the display of the text of the elements of the Breadcrumb Trail – both td and a elements of the class must be defined. Also used in the wrapper class for the div based version (based on the site-wide div toggle)

<DELIMITER>…</DELIMITER>

The character (or characters) used to separate the links displayed in the Breadcrumb Trail.

<NAVDEPTH>…</NAVDEPTH>

The number of levels of navigational hierarchy that the Breadcrumb Trail is displayed on.

<STARTPAGESHORTCUTID>…</STARTPAGESHORTCUTID>

The shortcutid of the start location of the page on which you want the Breadcrumb Trail to start being displayed. This overrides any value entered for STARTPAGE above  (added in 9.6.4)

</BREADCRUMB>

Closing Root XML element encloses entire Breadcrumb Trail configuration.

 

Example:

<BREADCRUMB> 
	<CLASSNAME>breadcrumb</CLASSNAME> 
	<DELIMITER>></DELIMITER>
	<NAVDEPTH>8</NAVDEPTH> 
	<STARTPAGESHORTCUTID>12345</STARTPAGESHORTCUTID>
</BREADCRUMB>

Generic header override

(Added in 10.5) There are new tags <addtohead></addtohead> that can be used to insert any markup into the head section of the page. Similar to <headoverride> used in XSLs but they can be used for anything. can be added to pages, templates or embedded XSL

Example:
Insert the following into any body block on a page...

<addtohead>
       <meta property="og:image" content="https://i.guim.co.uk/img/media/4cd3ebb0532dbdf95fbabb3fb2a5c2f8dab731de/0_117_5472_3286/master/5472.jpg?w=1200&q=55&auto=format&usm=12&fit=max&s=1ea5aeb7b224fd8a83f02983bda0a3fd"/>
       <meta property="og:type" content="article"/>
       <meta property="og:title" content=":::editorialtitle:::"/>
</addtohead>

...to insert Facebook OpenGraph meta tags into the head.

Sitekit server-side redirect

If you wish a page to redirect to another URL you can use a server-side 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>

Script manager includes

(Added in 10.2) The script manager provides a central resource to administer a site's scripts. Each Script is part of a 'script group' and a script group can be made up of several script files, blocks, and their related CSS and dependent jquery library. A script group is rendered using the following call:-

:::include-[script group name]:::

Calling this will render all the individual scripts groups component in the correct location (header, closing body tag, etc) where ever it is placed on a page.

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