Post by Edenka » Wed Oct 03, 2018 7:44 pm

I have taken a chunk of code from header.twig and put it in a new twig file called chunk.twig
Then I put {{ chunk }} in header.twig where the original code used to be.
But nothing gets inserted. What am I doing wrong?



Mon Oct 01, 2018 5:12 pm

Post by IP_CAM » Thu Oct 04, 2018 3:25 am

What am I doing wrong?
well, the only wrongdoing could possibly be, that you're talking in too big
numbers, by mentioning 'chunk's of code, in an Environment, where every
single Bit might be decisive, if a Software further works. ::) :-\

So, better talks figures & facts, to enable someone, to honestly reply.
Sorry for the harsh words, but it does not work here like this... ;)

Please don't send Personal OC Forum Messages, contact:
Test Site:
Github OC Downloads:
2'200+ FREE OC Extensions from the World's largest Github OC Repository Archive.

User avatar
Legendary Member


Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Edenka » Thu Oct 04, 2018 1:56 pm

Hi Ernie,

For this question it is not relevant what the chunk is. Replace the word "chunk" in my post with "line" and it still does not work. This question is not about coding, it is about the principle of inserting a new .twig file which does not work.

Just as an example, I took the line:
<button type="button" data-toggle="dropdown" class="btn btn-inverse btn-block dropdown-toggle"><i class="fa fa-user"></i><span id="{{ account }}" class="hidden-xs">&nbsp;{{ text_account }}</span></button>

from header.twig and put it in a file called oneline.twig. Then I put {{ oneline }} in header.twig.

Result: the button has disappeared from the site.




Mon Oct 01, 2018 5:12 pm

Post by paulfeakins » Thu Oct 04, 2018 5:30 pm

Did you try:

Code: Select all

{% include 'chunk.twig' %}

For quick, professional OpenCart support please email

User avatar
Expert Member


Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom
Who is online

Users browsing this forum: AndreyPopov and 17 guests