Opened 10 years ago

Closed 10 years ago

#3963 closed (wontfix)

[patch] Add optional replacement for truncate filters

Reported by: Johan Bergström <bugs@…> Owned by: Adrian Holovaty
Component: Template system Version: master
Severity: Keywords: truncate optional replacement
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

This small patch adds support for an optional replacement when truncatewords or truncatewords_html is used. It defaults "..." for truncatewords, " ..." for truncatewords_html and returns input silently if comma should be used as a delimiter.

Attachments (3)

truncate_optional_replacement.patch (3.3 KB) - added by bugs@… 10 years ago.
truncate_optional_replacement_v2.patch (3.3 KB) - added by Johan Bergström <bugs@…> 10 years ago.
updated patch which fixes issues mentioned earlier
truncate_optional_replacement_v2_tests.patch (913 bytes) - added by Johan Bergström <bugs@…> 10 years ago.
test cases for latest patch (v2)

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by bugs@…

comment:1 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Needs tests: set
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 10 years ago by Johan Bergström <bugs@…>

Patch needs improvement: set

Please disregard this patch; i made a mistake and assumed that arg would be a string. Updated patch and test case will arrive shortly..

Changed 10 years ago by Johan Bergström <bugs@…>

updated patch which fixes issues mentioned earlier

Changed 10 years ago by Johan Bergström <bugs@…>

test cases for latest patch (v2)

comment:3 Changed 10 years ago by Johan Bergström <bugs@…>

Needs tests: unset
Patch needs improvement: unset

Updated properties to better reflect ticket status. Is there anything else that needs to be done here?

comment:4 Changed 10 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

I really can't see that is widely useful. If there is a realy big reason why a particular project cannot use three dots as the continuation marker, it's trivial to write a custom version of the truncatewords filter.

Addding endless customisation options might seem like an easy thing to do, but it increases the maintenance burden and isn't always really scratching more than just an isolated itch. I think in this case, it's not worth including.

Note: See TracTickets for help on using tickets.
Back to Top