M.Zharkikh's personal site logo
Mail to site
Print version
News (RSS)
Smereka / Smeretags / Aggregators

Smereka

Smeretags

Aggregators

Smeretags-aggregators are similar to cycle operators in program languages: they get the HTML code with smeretags and calculate it (do substitution of smeretags) for a list of nodes. The resulting HTML code is the sum of HTML codes calculated for the individual nodes.

Most aggregators are used to generate navigators – various lists of links to the nodes, but they can be used to form various reports, catalogs and other data for which you must combine information from multiple nodes.

Although the basic set of Smereka modules contains a lot of different aggregators, it is impossible to foresee all cases of their applications, and Smereka programmer often found the need to write their own aggregators.

SmerAgregator

Module: agregator.php

Options: SmerekaValue Node LimitToClass HideMode

Purpose: performs HTML code calculations transferred in the parameter SmerekaValue for child nodes of the base node. If the parameter Node specified, it defines the base node id and if it is not given, contextual node suggested to be base node. If the parameter LimitToClass defined as a class id, than only nodes of the given class are processed. If the parameter HideMode = 1, aggregator will skip the nodes, which attribute Hidden = True.

Example call. Displays a list of articles subjected to certain node:

<Smereka1 Module="agregator.php" Func="SmerAgregator"
Node="1…" HideMode="1">
<p class="BT">
 <Smereka Module="agregators/navigators.php"
Func="NavigatorItem" />
</p>
</Smereka1>

Example result:

Static smeretags

Attributes

Images

Links

Conditional smeretags

Aggregators

OneLineNavigator

Module: agregator/navigators.php

Options: Same as for SmerAgregator

Purpose: display a list of links for the child nodes as a single line.

Example call. Displays a list of articles subjected to certain node:

 <Smereka Module="agregators/navigators.php"
Func="OneLineNavigator" Node="1…" />

Example result:

Static smeretags | Attributes | Images | Links | Conditional smeretags | Aggregators

This method is best used when the names are short and the entire list can be displayed as one line.

TrackBar

Module: agregators/navigators.php

Options: IncludeRoot IncludeLeaf Separator MaxDocTitle

Purpose: create "breadcrumbs" – the way in the document tree from the root to the current node.

IncludeRoot = 0 – does not include the root node;

IncludeRoot = 1 – include a root node, but without link;

IncludeRoot = 2 – include the root node as a link (default);

IncludeLeaf = 0 – does not include leaf node;

IncludeLeaf = 1 – include leaf node, but without link (default);

IncludeLeaf = 2 – include leaf node as a link;

Separator – path separator (by default ' / ');

MaxDocTitle – the number of characters to include from DocTitle; by exceeding the title cropped at this position and symbol … added ; the default is not given – a reduction is not performed.

Example call: <Smereka Module="agregators/navigators.php" Func="TrackBar" />

Example result: You can see on this page below the title.

TableAgregator

Module: agregators/tablemaker.php

Options: Same as for SmerAgregator, + NumColumns Order Numbering NumberStr

Purpose: create a table with aggregate data.

NumColumns – number of columns for the table (default 2);

Order = 'column' – fill container table by columns:

1…	10…
2…	11…

Order = 'row' – fill container table by rows (default):

1… 2…
5… 6…

Numbering – initial values from which to start numbering items in the table, if not set – do not enumerate at all.

NumberStr – bar code in the template (SmerekaValue), which should be replaced with number. If do not set – do not enumerate at all.

Example call:

<table class="BTNoIndent" cellpadding="4">
<Smereka1 Module="agregators/tablemaker.php"
Func="TableAgregator" Node="1…" HideMode="1"
NumColumns="2" Order="column" Numbering="1"
NumberStr="As16Xz86">
<tr>
<td>
 As16Xz86. <Smereka Module="agregators/navigators.php"
Func="NavigatorItem" />
</td>
</tr>
</Smereka1>
</table>

Example result:

1.Static smeretags 3.Images 5.Conditional smeretags
2.Attributes 4.Links 6.Aggregators

Gallery

Module: agregators/tablemaker.php

Options: Same as for TableAgregator

Purpose: to form a gallery of images as a table with links.

Example call: <Smereka Module="agregators/tablemaker.php" Func="Gallery" />

Example result: You can see here.

TableOfContent

Module: agregator/articlenavigators.php

Options: Same as for SmerAgregator, + WithAuthors

Purpose: display hierarchical list of links for the child nodes all subordinate levels (to form table of contents for a hierarchical publication).

WithAuthors – if this parameter is 1, then for each node, which has an attribute Authors, it will appear before the title.

Example call.

 <Smereka Module="agregators/articlenavigators.php"
Func="TableOfContent" />

Previous section | Table of content | Next section

Please this page? Help us to develop this site!

© 1978 – 2018 N.I.Zharkikh

Reprinting of articles from site are encouraged while
reference (hyperlink) to my site is provided

Site powered by

Load count : 1714

Modified : 8.08.2017

If you look up the type error
on this page, please select it
by mouse and press Ctrl+Enter.