Jump to content

[SOLVED] Transplant horizontal menu to TopColumn


Recommended Posts

Hi guys,

 

I would like to move the horizontal top menu just below the slider like the design in the attached image. Apparently it can't be transplanted to the hook displayTopColumn.
I found this post but there's no reaction (yet).The Vekia solution is for transplanting the module to displayHeader section.

 

Anyone?

Thanks in advance!

Cheers,

Steven

post-40555-0-12532300-1428417635_thumb.jpg

Edited by steviger (see edit history)
Link to comment
Share on other sites

Hi,

 

Thanks for your reply. I read your article and I think I do understand the override principle but since I'm not really (or rather really not..) a coder, could you help me with an example for my situation?

It will be much appreciated!

Link to comment
Share on other sites

Try to add this code in override/modules/blocktopmenu:

class BlocktopmenuOverride extends Blocktopmenu
{
	public function __construct()
	{
		parent::__construct();

		if($this->id && !$this->isRegisteredInHook('displayTopColumn'))
			$this->registerHook('displayTopColumn');
	}

	public function install($delete_params = true)
	{
		$this->registerHook('displayTopColumn');
		return parent::install();
	}

	public function hookDisplayTopColumn($params)
	{
		return $this->hookDisplayTop($params);
	}
}
  • Like 1
Link to comment
Share on other sites

Thanks man, works like a charm!

 

For those who want the same thing, here's what I did:

 

In the folder override I made a folder called blocktopmenu. Inside that folder I put a blocktopmenu.php with this code:

<?php
class BlocktopmenuOverride extends Blocktopmenu
{
	public function __construct()
	{
		parent::__construct();

		if($this->id && !$this->isRegisteredInHook('displayTopColumn'))
			$this->registerHook('displayTopColumn');
	}

	public function install($delete_params = true)
	{
		$this->registerHook('displayTopColumn');
		return parent::install();
	}

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

Next I transplanted the module to displayTopColumn section. Go to modules > positions tab in the back office. On the top right window part you can see anchor icon with "transplant a module" text. Click on it and you will see form where you have to:

    from first dropdown named "Module" select: Top horizontal menu
    from second dropdown named "Hook into" select "displayTopColumn (Top column blocks)"

Finally, don't forget to change the order in the displayTopcolumn section in order to display the menu under or above the slideshow. You can find it here: modules > positions tab in the back office>bottom of the page.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...

I have tried both HorizontalTopMenu and Blockcmsinfo and got the message "This module is already transplanted to this hook".

Although I get this message, I have manage to hook a new position for HorizontalTopMenu but not for Blockcmsinfo.

Link to comment
Share on other sites

  • 1 month 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...