We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How do I use more than 1 variable modifier on a variable?

How Do I?

From EE Slack's avatar
From EE Slack
185 posts
8 months ago
From EE Slack's avatar From EE Slack

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!

       
From EE Slack's avatar
From EE Slack
185 posts
8 months ago
From EE Slack's avatar From EE 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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.