I’m using variable modifiers but need to use more than one.
For example, {title:replace find=‘word’ replace=‘something’}, but I would also like to use attr_safe or limit or spellout. What would be the best way to use 2 of these modifiers? I know I can apply one, then if there is an embed, I can apply the next. Is there a way to chain them without an embed?
Interested in learning more solutions or want to get to know other EE users? Read more about joining the slack here! Join Our Slack!
You can chain some modifiers like this: {var:mod1:mod2 parameter="whatever"}
See the video here explaining: https://docs.expressionengine.com/latest/templates/variable-modifiers.html
And for a clever option in some cases:
You can apply variable modifiers to layout variables, and work around the cases where you cannot combine two variable modifiers on the same variable.
Apply the first modifier to the variable in the first layout template and save it to a layout variable, then on a later template recall that layout variable and apply the second modifier.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.