I've encountered a rather strange problem with custom fields. I have multiple fields named like "image-m1", "image-m2", "image-l". I'm iterating over the product array with
If I use
The url stored in the custom field shows up. However, if I use
It never works. After spending far to long playing around with this, I eventually decided that maybe, just maybe, the hyphen was causing problems... After some googling, I found one other post on a mailing list documenting this same issue. Sure enough, if I change all the formats to "imagem1", "imagem2", "imagel", my code works find and outputs "Working!".
Is there a way to escape the hyphen in the if expression? I tried using the standard \ escape, but that gave me an error.
Code:
<mvt:foreach iterator="product" array="category_listing:products">
Code:
&mvte:product:customfield_values:image-m1;
Code:
<mvt:if expr="NOT ISNULL l.settings:product:customfield_values:image-m1"> Working! </mvt:if>
Is there a way to escape the hyphen in the if expression? I tried using the standard \ escape, but that gave me an error.
Comment