Quote from: modx_user at Aug 27, 2010, 08:07 AM
Quote from: LEONeso at Aug 26, 2010, 02:06 PM
Почитал форум... попытался указать дитто шаблон, вывод названия папки содержащий данный дочерний ресурс.
Получилось: [+pagetitle:descendentDepth=’1’+]
но не работает, как сделать верно?
Мне бы тоже хотелось вывести название родительского документа. А где Вы прочили на форуме, что это возможно?
В библиотеке phx в комплекте ditto имеем:
Conditional Modifiers
input или if
equals или is или eq
notequals или isnot или isnt или ne
isgreaterthan или isgt или eg
islowerthan или islt или el
greaterthan или gt
lowerthan или lt
isinrole или ir или memberof или mo // Is Member Of (same as inrole but this one can be stringed as a conditional)
or
and
show
then
else
select
String Modifiers
lcase
ucase
ucfirst
htmlent
esc
strip
notags
length или len
reverse
wordwrap // default: 70
limit // default: 100
Special functions
math
ifempty
nl2br
date
set
value
md5
userinfo
inrole // deprecated
составление:
[+myplaceholder:modifier1:modifier2+]
[+phx:input=`[+myplaceholder+]`:modifier1:modifier2+]
Для более изощренных действий необходим плагин PHx и его модификаторы/
Вот тут и спасет модификатор
phx:parent
<?php
// description: get specified document field from parent document (id)
// usage: [+variable:parent=`field`+]
// defaults to pagetitle
$field = (strlen($options)>0) ? $options : 'pagetitle';
$parent = $modx->getParent($output,1,$field);
return $parent[$field];
?>
По-умолчанию выдаст заголовок родителя.