Post by jorem » Thu Dec 17, 2020 9:01 pm

Me again. ::) OC 3.0.3.6, original theme and no third party extensions involved.
Have added my own menu items in the menu.twig, no only in OC:s theme editor but hardcoded in the file and reset in the theme editor. Works fine. Or should work fine. Because I have only one product category in the menu, not hard coded but attached by the data/top checkbox in the category itself. I actually don't want the category in the menu at all, but when I uncheck that "top" checkbox, the entire menu vanishes. How can I omit this category in the menu but still have the menu visible - with my custom links?

Danne
----------------------------
https://proformica.com


Active Member

Posts

Joined
Thu Oct 07, 2010 9:42 pm

Post by pprmkr » Thu Dec 17, 2020 9:52 pm

When the only category is un-checked, menu.php has no entries in array $data['categories'] and menu.twig will show nothing:

Code: Select all

{% if categories %}
You can add your items in controller/common/menu.php :

Code: Select all

				$data['categories'][] = array(
					'name'     => YOUR_CAT_NAME,
					'children' => array(),
					'column'   => 1,
					'href'     => YOUR_URL
				);

User avatar
Active Member
Online

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by jorem » Thu Dec 17, 2020 11:15 pm

Many thanks for quick and useful response! :banana: :-)
pprmkr wrote:
Thu Dec 17, 2020 9:52 pm
When the only category is un-checked, menu.php has no entries in array $data['categories'] and menu.twig will show nothing:

Code: Select all

{% if categories %}
You can add your items in controller/common/menu.php :

Code: Select all

				$data['categories'][] = array(
					'name'     => YOUR_CAT_NAME,
					'children' => array(),
					'column'   => 1,
					'href'     => YOUR_URL
				);

Danne
----------------------------
https://proformica.com


Active Member

Posts

Joined
Thu Oct 07, 2010 9:42 pm

Post by paulfeakins » Fri Dec 18, 2020 5:37 pm

jorem wrote:
Thu Dec 17, 2020 11:15 pm
Many thanks for quick and useful response! :banana: :-)
If that solves it, please add [SOLVED] to the start of the post title.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

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

Users browsing this forum: No registered users and 31 guests