• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How to structure directory and using correct syntax when using liquid templates and "include"

Contributor ,
May 27, 2016 May 27, 2016

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

TOPICS
Newbie Corner

Views

460

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 28, 2016 May 28, 2016

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.

Votes

Translate

Translate
LEGEND ,
May 27, 2016 May 27, 2016

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:

Business Catalyst Support


Example is an include being:
{% include "/folder/folder/file.inc" -%}

And so on.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 28, 2016 May 28, 2016

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 28, 2016 May 28, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 29, 2016 May 29, 2016

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines