solved Continuing truncate issues

blindmime
@blindmime
10 years ago
772 posts
I continue to have issues with the truncate modifier in a {jrCore_list. I'm having difficulty making it account for a couple things I've noticed lately.

If text is italicized at a truncation point, text will continue to be italicized throughout not only the remainder of the list, but into subsequent columns as well. See screen shot.

This is currently what I'm using:

{$row.blog_text|jrCore_format_string:$item.profile_quota_id:null:nl2br|truncate:150}

I've tried many different variations without much luck.

Another thing I've encountered is when the very first word(s) in blog_text are a link, it will throw off subsequent
's and blocks get thrown around.
screenshot_244.jpg
screenshot_244.jpg  •  38KB


updated by @blindmime: 02/25/15 04:42:18PM
brian
@brian
10 years ago
10,149 posts
Whenever you truncate you have to also strip HTML or you'll get issues - i.e. change it to this:

{$row.blog_text|jrCore_format_string:$item.profile_quota_id|jrCore_strip_html|truncate:150}

You also no longer need to have the "nl2br" in the jrCore_format_string white list either as of JR 5.2.21.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 01/17/15 10:56:15AM
blindmime
@blindmime
10 years ago
772 posts
Thanks, much better.

Where is the jrCore_format_string white list?
brian
@brian
10 years ago
10,149 posts
jrCore_format_string takes up to 3 parameters

jrCore_format_string:(profile_id):(exclude list):(white list)

so:

- profile_id - the profile_id of the profile the item belongs to
- exclude list - a comma separated list of string formatters to purposefully exclude
- white list - if defined at ALL, only these formatters will be run.

The exclude list and white list use the "whitelist" name as found in the Help section of the Core -> Quota Config -> Active Text Formatters section.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 01/17/15 11:39:58AM

Tags