pegasus
Well-known member
I have a style property that sets the names of CSS images, based on the admin's selection (using templates to create the fields, etc). I have had no problems doing that, getting the values saved, validated, and recalled properly.
But when I try to use that in a specific CSS configuration, I encounter a problem:
As you can see the image path is constructed using multiple properties.
As far as I know, there's no way to escape out of a property name. Wrapping it in brackets outputs the brackets around the property value.
Particularly, properties like the . character. Even though @myImageVariant exists, the parser sees instead a sub-property @myImageVariant.png which doesn't exist. Because of the dynamic nature of these paths and the number of them, it's also not practical to include the .png as part of the property value. I've considered renaming the files, putting a garbage character like _ before the .png, but again, I'm unaware of a way to escape the property name, so we would still have @myImageVariant_.png
I've tried using {xen:property myImageVariant} directly instead. This causes the template to parse correctly, but if I open the editor again, it's changed back to @myImageVariant, so anyone who edits the template would just get the original problem again.
But when I try to use that in a specific CSS configuration, I encounter a problem:
Code:
.cssClass {
background-image: url(@myImageFolder/@myImagePrefix@myImageVariant.png);
}
As far as I know, there's no way to escape out of a property name. Wrapping it in brackets outputs the brackets around the property value.
Particularly, properties like the . character. Even though @myImageVariant exists, the parser sees instead a sub-property @myImageVariant.png which doesn't exist. Because of the dynamic nature of these paths and the number of them, it's also not practical to include the .png as part of the property value. I've considered renaming the files, putting a garbage character like _ before the .png, but again, I'm unaware of a way to escape the property name, so we would still have @myImageVariant_.png
I've tried using {xen:property myImageVariant} directly instead. This causes the template to parse correctly, but if I open the editor again, it's changed back to @myImageVariant, so anyone who edits the template would just get the original problem again.