diff --git a/src/helpers/cms-content-helper.js b/src/helpers/cms-content-helper.js index babc83c25..b0aa9bed2 100644 --- a/src/helpers/cms-content-helper.js +++ b/src/helpers/cms-content-helper.js @@ -50,8 +50,15 @@ function mapStringToState(str) { } } + const stringWithReplacement = str.replace(match[0], storeState); + + // If we still have values we need to substitute, call this function again. + if(stringWithReplacement.includes('{globalState:')) { + return mapStringToState(stringWithReplacement); + } + // Concatenate the string. - stringBuilder = `${stringBuilder} ${storeState}`; + stringBuilder = `${stringBuilder} ${stringWithReplacement}`; } return stringBuilder.trimStart();