Copy link to clipboard
Copied
Hi,
I've the following question on how to structure my directory when I want to make use of liquid templates with "include"
If I place i.g this code on a liquid template "layout-test.tpl"
{% include 'header' %}
<section>
{% block content %}{% endblock %}
</section>
{% include 'footer' %}
The templates renders without the includes. (On my desktop its works ok, because the code compiles through a "interpreter" and will be shown in plain HTML.)
The directories look like this (within the developer section of the admin console):
Layouts
---Custom
---------includes
...............header.liquid
...............footer.liquid
---------templates
...............layout-test.tpl
Obviously there's something wrong with my code to work in BC.
The main question is, what is the correct syntax to make it work?
Thanks,
Kind regards,
Carla
You can not use Mixture to compile BC locally. BC is SAAS - Software as a solution and you can not compile it and its data locally. Simple as that really.
You can use a few file extensions for includes in BC. A common community set is inc for includes, .tpl for templates for example.
I think the main thing your missing though is your not implementing BC liquid, your syntax use is incorrect and your trying to develop locally which you will not be able to do.
Copy link to clipboard
Copied
Hi Carla,
BC does not work locally so I am not sure what you think you are doing with liquid and compiling.
Your code as well is not BC liquid markup etc, not sure where you have based your above from. All the BC documentation can be found here:
Example is an include being:
{% include "/folder/folder/file.inc" -%}
And so on.
Copy link to clipboard
Copied
Hi Liam,
I'm aware that BC doesn't compile locally. For locally use I use Mixture.
With BC use I would like to know how to set things up.
In your example you are using .inc as a file extension.
So I have to use .inc for every part that I want to include in my template and the path?
Copy link to clipboard
Copied
You can not use Mixture to compile BC locally. BC is SAAS - Software as a solution and you can not compile it and its data locally. Simple as that really.
You can use a few file extensions for includes in BC. A common community set is inc for includes, .tpl for templates for example.
I think the main thing your missing though is your not implementing BC liquid, your syntax use is incorrect and your trying to develop locally which you will not be able to do.
Copy link to clipboard
Copied
Hi Liam,
In my post I forgot to mention when I use Mixture it is for other projects than BC. (Sorry for the confusion).
But, thanks for pointing out how to use the syntax in BC.