Documentation

Nested Modifiers

Sometimes you want to use multiple modifiers to perform actions on the value of the Merge Tag before returning it to the context you’re in. You can do that with using nested modifiers inside an Advanced Merge Tags modifier.

Example gwp_replace

For example when using gwp_replace to replace part of string with another string, you normally use it like this:

{Example:1:gwp_replace search="GravityWP" replace="GWP"}

With this modifier, we can replace ‘GravityWP’ with the abbreviation ‘GWP’. When we have for example the string ‘GravityWP is cool!’, when using the above modifier, it will return ‘GWP is cool!’.

But what if we want to replace another part of the string with something else? You can do that with adding another nested modifier like this:

{Example:1:gwp_replace search="GravityWP" replace="GWP" modifier1='gwp_replace search="cool" replace="awesome"'}

As you see, we now replace with the nested modifier all instances of ‘cool’ with ‘awesome’. Our example ‘GravityWP is cool!’ will now return ‘GWP is awesome!’. You can use multiple nested modifiers, for example by adding modifier2=, modifier3=, etc.

modifier1='' modifier2='' modifier3=''

Make sure you start the nested modifier without the colon (punctuation) : and make sure the opening and closing apostrophes ‘ ‘ are different those used inside the nested modifier, using quotation marks ” “ or the other way around.

Advanced Merge Tagsv1.4

To use the functionalities described in this documentation, you'll need to get the GravityWP - Advanced Merge Tags add-on.

Read more