Here is my code in a snippet. Basically what low_replace does is just to convert spaces to dashes.

{exp:low_replace find="SPACE" replace="-"}
    {related_entries id="foo"}
    {if bar != ''}-{bar}{/if}
    {related_entries id="test"}-

When I tried it, I got this error

Parse error: syntax error, unexpected T_STRING in /home/test/public_html/system/expressionengine/libraries/Functions.php(683) : eval()'d code on line 1

Any idea why this is the case?

1 Answer 1


Parse order strikes again. The conditional inside the tag is an advanced one and will be parsed after all the tags. That means it is still present when the replace tag is processed, creating code like this:


Which is likely to cause the template parser to choke when it tries to parse it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.