Will not truncate
Permalink Browser Info Environment
Hi There,
I have your add-on working and it pulls through the first block in the main area. I need to truncate it to 200 chars or so. I have followed your instructions and selected custom template, and truncate afetr 200 xhars. I have cleared the cache but it pulls through the whole article.
Any ideas please..?
Thanks
I have your add-on working and it pulls through the first block in the main area. I need to truncate it to 200 chars or so. I have followed your instructions and selected custom template, and truncate afetr 200 xhars. I have cleared the cache but it pulls through the whole article.
Any ideas please..?
Thanks
Type: | Discussion |
---|---|
Status: | New |
Truncation only works on "Content" blocks. Is it possible that you have other kinds of blocks on the page?
Hi jordanlev
Is there a way of getting it working on another block, I have a Designer Content Pro block and need to get it to work on that.
Thanks
Dave
Is there a way of getting it working on another block, I have a Designer Content Pro block and need to get it to work on that.
Thanks
Dave
Hi Dave,
You can use C5's built-in truncation function on any text... so in this case you can take the "teaser" and then run the truncation on that. For example, copy /packages/page_list_teasers/blocks/page_list/templates/teasers.php to /blocks/page_list/templates/teasers.php, then modify the new copy of that file and find this line:
...and directly below that line insert a new line:
If you need more fine-grained control over what block types get included in the teaser, let me know because there are other methods that are more complicated but are more flexible. (Also, if you're a customer of Designer Content Pro, you can submit a support request over on the marketplace page for that addon and I will respond much quicker since I don't check emails for these free addons as often as I do for the paid addons).
Hope that helps!
-Jordan
You can use C5's built-in truncation function on any text... so in this case you can take the "teaser" and then run the truncation on that. For example, copy /packages/page_list_teasers/blocks/page_list/templates/teasers.php to /blocks/page_list/templates/teasers.php, then modify the new copy of that file and find this line:
$teaser = $plth->getPageTeaser($page, 'Main', $teaserBlockCount, $teaserTruncateChars);
...and directly below that line insert a new line:
$teaser = $th->shortenTextWord($teaser, 200);
If you need more fine-grained control over what block types get included in the teaser, let me know because there are other methods that are more complicated but are more flexible. (Also, if you're a customer of Designer Content Pro, you can submit a support request over on the marketplace page for that addon and I will respond much quicker since I don't check emails for these free addons as often as I do for the paid addons).
Hope that helps!
-Jordan