Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to use a dynamic value to load template

Hi,

How can I use a dynamic value to load template eg.

{% include site['theme'].'/header' %}

I keep getting an error.

Thanks



78.1k
Accepted
answer

To concatenate strings in Volt you have to use the ~ sign.

{% include site['theme'] ~ '/header' %}


1.3k