Text extracts in asset listing


(Wojciech Bronikowski) #1

Trying to figure out if Matrix allows for setting a character limit in asset listing. So for example, I would like to limit the number of characters of %asset_comment% or %asset_metadata_description% to let's say 140 characters to avoid text overflow (providing a link to the full text of course)


Has anyone managed to do that in Matrix Settings or using keywords? Some JavaScript would solve that of course but being able to do that natively in Squize would be better.



Would appreciate some help / ideas about that.


  • Voitek

(Dan Simmons) #2

You want to use the maxchars or maxwords keyword modifiers:
http://manuals.matrix.squizsuite.net/keyword-replacements/chapters/keyword-modifiers



Eg.:

%asset_metadata_description^maxwords:20%


(Wojciech Bronikowski) #3

Cool. I found it earlier but with the wrong sign ~ instead of ^ so it didn't work.


Works perfectly now: %asset_attribute_comment^maxwords:15%



thanks a lot.