My question requires some additional explanations
Here the tree structure of my site:
HomePage
|- Site 1
|- Theme 1.1 (folder)
|-- Document 1.1.1
|-- Document 1.1.2
|-- Document 1.1.3
|-- ...
|- Theme 2 (folder)
|-- Document 1.2.1
|-- Document 1.2.2
|-- Document 1.2.3
|-- ...
|- Theme 3 (folder)
|-- Document 1.3.1
|-- Document 1.3.2
|-- Document 1.3.3
|-- ...
...
|- Site 2
|- Theme 2.1 (folder)
|-- Document 2.1.1
|-- Document 2.1.2
|-- Document 2.1.3
|-- ...
...
In the document “Theme X”, I use Ditto to post the list of the summary.
Here the code which I use:
snippet ShowContent
<?php
/*
* Snippet : ShowContent
* Description : Affiche le contenu de la page en fonction dossier parent
*
*-- Parametres --
* &idPage : id de la page courante
* &idTopFolder : id du dossier principal
* &field : champ a retourner
*/
// ---------------------------------------------------
// Parameters
// ---------------------------------------------------
if (!isset($idPage)) return "No id of page!";
if (!isset($idTopFolder)) return "No id of principal folder!";
// ---------------------------------------------------
// ShowSummary
// ---------------------------------------------------
$parent = $modx->getParent($idPage,1,'id, pagetitle, longtitle, content');
if ($parent['id'] == $idTopFolder) {
$output ="[!Ditto? &startID=`[*id*]` &summarize=`99` &truncSplit=`true` &truncLen=`9999` &truncText=`En savoir plus...` &sortby=`menuindex` &sortdir=`ASC` &tpl=`ListArticle`!]";
}
else {
$output ="<h1>[*#longtitle*]</h1>";
$output .="[*#content*]";
}
return $output;
?>
chunk : ListArticle
<h2>[+title+]</h2>[+tvimagePreview+]
<div class="resume">
[+tvlegende+]<br />
[[HidenLink? &flg=`[+tvotherpage+]` &out=`<!--`]]
[+link+]
[[HidenLink? &flg=`[+tvotherpage+]` &out=`-->`]]
<br />
</div>
snippet : HidenLink
<?php
/*
* Snippet : HidenLink
*
* Parametre
* &flg : Flag autre page. Si vrai un lien est affich� pour permettre l'affichage du d�tail de l'article sur une autre page
* $out : Type de sortie
*/
$flg = isset($flg)? $flg : "Non";
$out = isset($out)? $out : "";
$output = ($flg=="Non")? $out:"";
return $output;
?>
and TV : otherpage
Type:
DropDown List Menu with value:
Non||Oui
The TV is to use to indicate the link “En savoir plus...” if necessary.
If no value is in the field sumarry, the link is not display even if the value of the TV is with “Oui”
On the other hand, if a value is contained in summary, the link is display.
I do not understand why I have this result.
Thank for your ideas.