How do you change the datatype from a number to a string in liquid?
This could be used to create dynamic css classes within blocks. However, if it comes through as an integer it isn’t recognized as a class.
{{block.id}} // Integer
I have answered my own question below along with an example.
3
Answers
Add quotation marks...
I found a better solution, just cast it:
Seems to work well. 🙂
For me
| string
wasn’t working so I’ve used this