1

I seem to be getting the same error as in this post, but in my case the problematic part of my condition is a plus symbol, which is pretty absurd!

{if '{caption}' != ''}data-caption="#caption-{row_id}"{/if}

In this case, if the caption includes a plus, it will result in:

Parse error: syntax error, unexpected T_STRING in /Users/danielhowells/Sites/Calvert/www.calvertadmin.com/web/content/expressionengine/libraries/Functions.php(683) : eval()'d code on line 28

It's a bit embarrassing explaining to my client that they can't use + in their captions. :-)

4
  • Try without quoting and bracing your conditional, please? ie: {if caption != ""}code{/if} Also, knowing your version for both EE and Matrix would help out here. Thank you!
    – Lisa
    Apr 10 '13 at 17:07
  • I tried that already - no dice. EE version v2.5.5 and Matrix 2.5.3
    – Daniel
    Apr 15 '13 at 9:28
  • Hi, Daniel - I can't reproduce this. I have an entry with a title Plus Sign, and I an RTE field, and in that I included a + sign. I then have this: {exp:channel:entries channel="pt_test_channel" limit="1"} <h1>{title}</h1> {pt_matrix}{matrix_cell_2} {if matrix_cell_2 != ""}{row_id} not empty{/if} {/pt_matrix} {/exp:channel:entries} and it outputs "12 not empty" on the front end, no parse errors. Can you post the rest of your template code please?
    – Lisa
    Apr 15 '13 at 22:08
  • Sorry for the delay on this - seems to be okay with 2.5.5 so let's close this for now.
    – Daniel
    Jun 26 '13 at 10:37
1

You could try low replace on the tag and turn the + into a word:

{if '{exp:low_replace find="+" replace="plus"}{caption}{/exp:low_replace}' != ''}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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