modx-pro / pdoTools

Library for creating fast snippets for MODX Revolution.
95 stars 87 forks source link

How to use MODX input/output modifiers with Fenom? #143

Closed adamwintle closed 9 years ago

adamwintle commented 9 years ago

Is it possible to use the standard MODX output modifiers on the Fenom template tags?

For example how can I apply this

[[+introtext:ellipsis=50]]

To this?

{$introtext}

bezumkin commented 9 years ago

No, standard MODX output modifiers are hardcoded in modOutputFilter.

You need to create your own snippet with this functionality and call it as

{$_modx->runSnippet('ellipsis', [
    'input' => $introtext,
    'length' => 50
])}

Maybe I will replace default filters somehow later.

bezumkin commented 9 years ago

By the way, some filters can be replaced by default Fenom functionality - read the docs.

{set $string = '1234567890'}

{$string|truncate:5:"..."}

It will output

12345...

The whole list of modifiers