Start page

Mykola Zharkikh (Kyiv)

Personal site

?

Attributes

This group of smeretags intended to insert in a web page specific text attributes of the node.

GetDescription

Module: smeretags/substfields.php (available by default)

Options: no.

Purpose: returns the Description attribute as a string – to create page meta tag with the same name.

Example call: <meta name="description" content="Reference guide for smeretags (lookup fields), designed to work with the attributes of nodes in CMS Smereka. This group of smeretags intended to insert in a web page specific text attributes of the node." />

Example result: <meta name="description" content="Short page description" />

GetDocTitle

Module: smeretags/substfields.php (available by default)

Options: [BreaksOff="1"] [TagsOff="1"].

Purpose: returns the document title as the result of DocTitle method invocation for a given node. By default, this method searches the DocTitle, Title, symbname attributes and returns the first attribute that is set. Nodes with other PHP classes can override this method to create a specific document title.

Optional BreaksOff forces to replace <br /> tags to spaces (to improve the appearance of the title).

Optional TagsOff removes all HTML tags from the resulting text. This option is recommended where the context disallows usage of HTML tags, for example, in the alt attribute. To prevent accidental "bonding" neighboring words separated tag <br />, it is recommended to use this parameter with BreaksOff.

Example call: <Smereka Func="GetDocTitle" />

Example result: Smeretags-attributes

GetLastUpdate

Module: smeretags/substfields.php (available by default)

Options: no.

Purpose: returns the last modification date of the page, formatted as dd.mm.yyyy.

Example call: <Smereka Func="GetLastUpdate" />

Example result: 21.05.2010

GetNodeAttr

Module: smeretags/substfields.php (available by default)

Options: AttrName="SomeAttrName" [NodeId="SomeNodeId"] [BreaksOff="1"] [TagsOff="1"].

Purpose: returns the value of attribute defined by required parameter AttrName or an empty string if there is no such attribute.

If the optional parameter NodeId is set, the calculation will be carried out for this node (if it exists). If this option is not set – the attribute will be searched for the context node. So this smeretag gives powerful way to add to the current page from other peaks.

Optional parameters BreaksOff, TagsOff act as for GetDocTitle smeretag.

Example call: <Smereka Func="GetNodeAttr" AttrName="symbname" />

Example result: Smereka

GetRobots

Module: smeretags/substfields.php (available by default)

Options: no.

Purpose: returns the robots header tag for a web page. This smeretag is controlled by Indexable attribute of the current node. When this attribute is set (by default) smeretag returns an empty string (meaning robots=all defined as a value by default in HTML standard). If this attribute is cleared, preventing value returned.

Example call: <Smereka Func="GetRobots" />

Example result: <meta name="robots" content="none" />

GetWinTitle

Module: smeretags/substfields.php (available by default)

Options: no.

Purpose: returns the window title as a result of WinTitle method invocation for a given node. By default, this method searches the attributes Title, symbname and returns the first attribute that is set. Nodes with other PHP classes can override this method to create a specific window title. Smeretag automatically reduces too long strings.

Example call: <title>Smeretags-attributes - Smereka CMS documentation</title>

Example result: <title>Window title for the page</title>