I have an Attribute.text name "Cushion Modified" and i am passing the same dynamically
{% if attribute.name=="Shape" %} {% set image = 'image/catalog/Products/shapes/sample/' ~ attribute.text ~ '.png' %} {% endif %}
After executing it the image src looks like src="image/catalog/Products/shapes/sample/Cushion" modified.png=""
I want to make it like image/catalog/Products/shapes/sample/Cushionmodified.png
Any help
I was reading and you would need to create your own Twig extension to do this, so the previous suggestion is not possible to implement, however, inside your extension you should be able to run that PHP code.
You can also refer to where they explain you would need an extension for this :
Call PHP function from Twig template
For reference, the PHP code to remove spaces from a string :
str_replace(' ','',$string_var_containing_spaces)