Jump to content

How to make block_top_menu to full widh


rpeermohamed

Recommended Posts

Hello Rpeermohamed,

 

The easy way is to change the class container to container-fluid in the header.tpl

This will make your header (logo, search bar, cart and block top menu) full width.

 

If you only want to make the block top menu full width you should make a new hook that isn't inside a container class.

 

(1) Place this in your header.tpl at the place you want the block top menu to appear:

{hook h="myCustomHook"}

(2) In Modules > blocktopmenu > blocktopmenu.php extend the install function with this:

if (!parent::install() ||
            !$this->registerHook('header') ||
            !$this->registerHook('displayTop') ||
            !$this->registerHook('actionObjectCategoryUpdateAfter') ||
            !$this->registerHook('actionObjectCategoryDeleteAfter') ||
            !$this->registerHook('actionObjectCategoryAddAfter') ||
            !$this->registerHook('actionObjectCmsUpdateAfter') ||
            !$this->registerHook('actionObjectCmsDeleteAfter') ||
            !$this->registerHook('actionObjectCmsAddAfter') ||
            !$this->registerHook('actionObjectSupplierUpdateAfter') ||
            !$this->registerHook('actionObjectSupplierDeleteAfter') ||
            !$this->registerHook('actionObjectSupplierAddAfter') ||
            !$this->registerHook('actionObjectManufacturerUpdateAfter') ||
            !$this->registerHook('actionObjectManufacturerDeleteAfter') ||
            !$this->registerHook('actionObjectManufacturerAddAfter') ||
            !$this->registerHook('actionObjectProductUpdateAfter') ||
            !$this->registerHook('actionObjectProductDeleteAfter') ||
            !$this->registerHook('actionObjectProductAddAfter') ||
            !$this->registerHook('categoryUpdate') ||
            !$this->registerHook('actionShopDataDuplication') ||
            !$this->registerHook('myCustomHook')) { // <-- This is your new hook
            return false;
        }

(3) Then somewhere near line 745 paste this in blocktopmenu.php:

public function hookMyCustomHook($params)
{
    return $this->hookDisplayTop($params);
}

Now go to the modules page in your backoffice, search for block top menu and reset the module.

Unhook it from displayTop, so it won't be shown twice.

 

If you don't see any changes please make sure you have cleared your cache.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Hi!

 

In your global.css, around the line 5771, you should have this rules:

 

 header .row > .container {

      position: relative;

      }

Change it to:

 

header .row > .container {

      position: relative;

      width: 100%;

      }

  • Like 1
Link to comment
Share on other sites

  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...