Hey all! Still pretty new with this whole deal and wondering what the best way to trim a string. I saw another post about limiting the summary field via the private.config.php file, but what I’d like to do is just enforce it on a specific widget. For example, our Emeritus College page (Emeritus College Home) - those summaries are just a bit long. I’d like to do something to limit that character count from the HTML format in the widget setup.
Anyone have luck with string manipulation in there?
Good find, Jon! Yes that’s a very straightforward way to do that–pretty much any of the XPHP Tools can be used with <field var=""/> instead of <xphp var=""/> when working inside a widget format.
If you needed something a bit more conditional using PHP logic, an onWidgetFormat handler in a custom module could also do the trick, but I think you’ve already found the most succinct way of accomplishing this here.