Hi PMS, prouve,
I’m trying to accomplish exactly the same, but can’t make up out of this thread if YAMS is already able to handle the PHx character_limit.
I’m using prouves improved the PHx truncate function. The codes I’m using:
Ditto call:
[!Ditto?extenders=`@FILE assets/modules/yams/yams.extender.inc.php` &id=`(yams_id)` &language=`(yams_mname)` &tpl=`tpl_news_list_home` &startID=`4` &orderBy=`menuindex ASC` &summarize=`2`!]
’tpl_news_list_home’ chunck:
<li><h3><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
<p class="news_date">[+createdon:date=`%d-%m-%Y`+]</p>
<p>[+content:character_limit=`50`+]</p></li>
’phx:character_limit’ snippet:
<?php
if (strlen($output) > $options) {
$output_cutted = substr($output, 0, $options);
$last_space = strrpos($output_cutted, " ");
$output = substr($output_cutted, 0, $last_space) . " [...]";
}
return $output;
?>
MODX 1.0.2
YAMS 1.1.7 alpha RC7
Ditto 2.1.0
PHx 2.1.3
This will only output the [..], with no content. If I change the [+content:character_limit=`50`+] in the ’tpl_news_list_home’ chunk to [+content_en:character_limit=`50`+], it works, but only for the language with ’en’ ID.
YAMS if functioning properly throughout my site.
Do you have any idea how to make YAMS work with the character_limit?