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?

Newbie

Posts

Joined
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... ;)
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.


User avatar
Legendary Member

Posts

Joined
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.

Edwin

Newbie

Posts

Joined
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' %}

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 35 guests