in reply to Splitting long text for Template
Yes, it's a common problem. The 'elegant' solution would be to have a function in the client code (i.e. Javascript) that does the formatting/truncating once handed the complete string by Perl. Or as you say you could enable PERL directives in your template; or you could write a custom filter in Perl which Template would use in the template. Or you could probably use simple conditional IF blocks in the template. None of these are what you might call elegant, but functionality trumps elegance, and I would personally use the last mentioned approach because I dislike programming in JavaScript so much. In my experience accepting a somewhat fuzzy boundary between C and V works best for me.
Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Splitting long text for Template
by choroba (Cardinal) on Feb 07, 2021 at 23:54 UTC | |
by LanX (Saint) on Feb 08, 2021 at 00:06 UTC | |
by Bod (Parson) on Feb 08, 2021 at 00:12 UTC |