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?
well, the only wrongdoing could possibly be, that you're talking in too bigWhat am I doing wrong?
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...

Ernie
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
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"> {{ 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.
Edwin
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"> {{ 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.
Edwin
Did you try:
Code: Select all
{% include 'chunk.twig' %}
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Who is online
Users browsing this forum: No registered users and 35 guests