Plugin

Archived
Forum
(read-only)

CE String

ExpressionEngine 2, ExpressionEngine 3

Back to this add-on's main page
View Other Add-ons From Causing Effect

     

Truncate with parameter exact not working

Support (Resolved)

aelvan
aelvan

I’m trying to truncate some text, and I want it truncated exactly to 130 characters, here’s what I got:

{exp:ce_str:ing truncate="130" exact="yes" ending="…" remove_html} text {/exp:ce_str:ing} 

But, it still truncates to the previous whole word, like it should when exact=“no”.

Using EE 2.4 and CE String 1.2.

Causing Effect - Aaron Waldon
# 1
Developer
Causing Effect - Aaron Waldon

Hi aelvan!

I think this works fine. I believe you’re getting confused on syntax. With CE String, each method is it’s own parameter, and each argument is pipe delimited.

So instead of:

{exp:ce_str:ing truncate="130" exact="yes" ending="…" remove_html} text {/exp:ce_str:ing} 

You would simply write:

{exp:ce_str:ing truncate="130|…|yes" remove_html} text {/exp:ce_str:ing} 

Let me know if you have any questions!

Lulu
# 2
Lulu

Hi Aaron,
Thanks for this! I was confused too but now I get it :)