Post by rzaprianov » Thu May 31, 2018 5:29 pm

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?

Regards,

Rumen

Newbie

Posts

Joined
Fri Feb 23, 2018 5:16 pm

Post by sw!tch » Fri Jun 01, 2018 2:54 am

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.

catalog/controller/common/menu.php

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

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Who is online

Users browsing this forum: No registered users and 119 guests