Conditional include

Since there doesn’t seem to be any comprehensive Hubl syntax documentation, I’ve been referencing the Jinja 2.10 docs. Jinja includes the ability to include an array of templates, where the first template that exists gets pulled in (see Template Designer Documentation — Jinja Documentation (3.1.x)

{% include ['../../custom/header.html', 'header.html'] ignore missing %}

I’m attempting to develop a system for a custom HubSpot theme I’m building where a special html file can be added in a particular place to override a section of a template, such as the header, and the above would be perfect for this. However, this syntax does not seem to be compatible with Hubl. I get this output in the HTML:

<!-- Missing Template at Path: '['../../custom/header.html',' -->

It appears that it’s including the ‘[’ in the include statement.

If this syntax is not supported, is there a way to check for the existence of a file before including it?

Hey @cory-blackbird

I think the closest thing you can get to that would be the block technique and the super function.