...
(Be sure to read the wiki on PHx about how to use the modifiers in templates that are internally processed by a snippet.)
i did have the placeholder issue with 1.4.1 but 1.4.2 fixed it for both Ditto 1.02 and 1.1.
At first load i didn;t see the placeholders also but I needed to empty the cache (depends on how you call Ditto) and after that it worked fine.
return <a href="'.$link.'">Dowload the file</a>';
[*imgnews:isnot=``:then=`[!LinkToFile? &link=`[*imgnews*]`!]`*]
return '<a href="'.$link.'">Dowload the file</a>';
[*imgnews:isnot=``:then=`[!LinkToFile? &link=`[*imgnews*]`!]`*]
[*imgvar:isnot=``:then=`[[LinkToFile? &link=`[*imgvar:*]`]]`*]
$linktext = ($options!='') ? $options : 'Download File'; return '<a href="'.$output.'">' . $linktext. '</a>';
[*imgvar:isnt:then=`[*imgvar:link*]`*]
[*imgvar:isnt:then=`[*imgvar:link=`My other link text`*]`*]
I’m wondering if the second [*imgnews*] tag is well understood by the parser
<?php # For example to include cutenews, you can use # [[includeFile?template=nicetemplate&phpfile=cutenews/show_news.php]]. # You can offcourse pass any variable to the snippet to use for the included file. if ( !isset($phpfile) || $phpfile == "" ) return "No file specified."; //check if there's a file given. //Start the buffer ob_start(); //include require_once $phpfile; //get contents from the buffer $ob_contents = ob_get_contents(); //and kill/delete the buffer ob_end_clean(); //return it to MODX. return $ob_contents; ?>
[[includeFile?&phpfile=`[*volPath:*]/template.php`]]
This discussion is closed to further replies. Keep calm and carry on.