[На главную] [К оглавлению раздела]

childrens, childrenscount

childrens - вывод дочерних записей

childrenscount - вывод количества дочерних записей

Возможные атрибуты:

В качестве идентификатора используйте либо атрибут parent_id либо parent_link. Использование в качестве идентификатора атрибута parent_link опасно тем что ссылка в будущем может быть изменена.

Во всех атрибутах применяются специальные замены
<?xml version="1.0" encoding="utf-8"?>
<t:templates xmlns:t="/templates/ns" xmlns="http://www.w3.org/1999/xhtml">

<t:template id="index">
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<t:head />
	<link type="text/css" rel="stylesheet" href="/style.css" />
	<script type="text/javascript" src="/script.js"> </script>
</head>
<body>
	[внешнее оформление]
	[Всего статей: <t:childrenscount />]<br />
	<!-- вывод во внешнем оформлении описания трех последних статей -->
	<t:childrens parent_link="/articles" template="articles_list" length="3" page="1" />
	[внешнее оформление]
	<t:main />
	[внешнее оформление]
</body>
&lt;/html>
</t:template>

<t:template id="articles_list">
	<div>
		<t:a><t:var name="title" /></t:a><br />
		<t:var name="description" />
	</div>
</t:template>

</t:templates>
<?xml version="1.0" encoding="utf-8"?>
<t:templates xmlns:t="/templates/ns" xmlns="http://www.w3.org/1999/xhtml">

<t:template id="index">
	<h1><t:var name="title" /></h1>
	<t:if expr="{PARENT_TEMPLATE_SRC_DEEP}==0">
		<t:childrens template="articles_list" length="10" />
	</t:if>
	<t:if expr="{PARENT_TEMPLATE_SRC_DEEP}==1">
		<t:block template="article" />
	</t:if>
</t:template>

<t:template id="articles_list">
	<div>
		<t:a><t:var name="title" /></t:a><br />
		<t:var name="description" />
	</div>
	<t:last><t:rule /></t:last>
</t:template>

<t:template id="articles">
	<t:var name="content" />
</t:template>

</t:templates>

[На главную] [К оглавлению раздела] [Вверх]