How to limit length of update in Timeline Posts?

Deb W.
Deb W.
@deb-w
7 years ago
136 posts
I'd like to make sure that our members are not posting blog-length updates on their timelines. How do I limit the number of characters in their updates? (see attached) I think I've already the characters, but one of our members posted a very, very, VERY long update last week.
updated by @deb-w: 09/15/17 05:56:40PM
michael
@michael
7 years ago
7,714 posts
That "Max Update Length" will show in the textbox as they are typing counting down to the 0 for the number of characters they are allowed to use.

But its not enforced, so if they do go over it, it will still display by default. It just sets a config variable:
{$_conf.jrAction_max_length}
that can be used if desired. Most of the default skins don't use it.

If you want to enforce it, adjust the jrAction -> TEMPLATES -> item_list.tpl -> MODIFY

from this:
{$item.action_text|jrCore_format_string:$item.profile_quota_id}
to
{$item.action_text|jrCore_format_string:$item.profile_quota_id|truncate:{$_conf.jrAction_max_length|intval}}

That will force the sting to truncate at the set limit.

Docs: "Using the Template Editor"
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-admin-handbook/3183/using-the-template-editor
Deb W.
Deb W.
@deb-w
7 years ago
136 posts
Hi Michael -

I found this in the template code for item_list.tpl in the templates for the timeline module:
{$item.action_text|jrCore_format_string:$item.profile_quota_id|jrCore_strip_html|truncate:160}

Should I leave that? or replace it with the code you gave me:
{$item.action_text|jrCore_format_string:$item.profile_quota_id|truncate:{$_conf.jrAction_max_length|intval}}

Or do something else with it?

Again, I want to limit the amount they type into the timeline update to 140 characters.

Thanks!
Deb

michael:
That "Max Update Length" will show in the textbox as they are typing counting down to the 0 for the number of characters they are allowed to use.

But its not enforced, so if they do go over it, it will still display by default. It just sets a config variable:
{$_conf.jrAction_max_length}
that can be used if desired. Most of the default skins don't use it.

If you want to enforce it, adjust the jrAction -> TEMPLATES -> item_list.tpl -> MODIFY

from this:
{$item.action_text|jrCore_format_string:$item.profile_quota_id}
to
{$item.action_text|jrCore_format_string:$item.profile_quota_id|truncate:{$_conf.jrAction_max_length|intval}}

That will force the sting to truncate at the set limit.

Docs: "Using the Template Editor"
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-admin-handbook/3183/using-the-template-editor
michael
@michael
7 years ago
7,714 posts
Deb W.:.....I found this in the template code for item_list.tpl in the templates for the timeline module:
{$item.action_text|jrCore_format_string:$item.profile_quota_id|jrCore_strip_html|truncate:160} .....
so location is already limiting to 160, so its not the location you are interested in if your system is not limiting.

Made this video for Zach a while back about how to locate the location you're interested in changing. Should be relevant to locating the template you need to put that truncate:??? onto to.

Forum Question: How to adjust a template
updated by @michael: 06/06/17 09:48:36PM