Checking if a variable exists with strict_variables set


#1

Hi guys,

I have a layout that sets some headers dependent on the page variables.
Now, the <title> header should be set to page.title by default, but if the page has name defined in the front matter, this should be used instead. I already found out how to check if a variable exists, but this doesn’t work for me when strict_variables ist set to true.
I don’t want to disable this flag, because it’s really helpful to find mistakes while developing.

How can I solve this?

Edit: I’ve created an Issue on Github where I’ve shown the use case and a workaround for this case: https://github.com/Shopify/liquid/issues/1034