Page 1 of 1

How to install "Home" button in oc-light theme?

Posted: Thu May 31, 2018 5:29 pm
by rzaprianov
I saw there is a module that install "Home" button for "default" theme, but I use oc-light theme. So I went to the code /catalog/view/theme/oc-light/template/common and I try to put the

Code: Select all

<li><a href="<?php echo $home; ?>">Home</a></li>
there just below

Code: Select all

 <ul class="list-unstyled">
in file "menu.twig", but there is no any effect. What's wrong?



Re: How to install "Home" button in oc-light theme?

Posted: Fri Jun 01, 2018 2:54 am
by sw!tch
Well its MVC you need to declare the home variable in the controller further if using 3.x you are using the wrong syntax in the twig file.


(e.g above $data['categories'] = array();

Code: Select all

$data['home'] = $this->url->link('common/home');
and then in your menu.twig template you need to use twig syntax.

Code: Select all

<li><a href="{{ home }}">Home</a></li>
Flush all caches and then try it, backup first try at your own risk. You should really create an OCMOD to do this and not edit core files.