Jump to content

New hook after Top hook


sanl

Recommended Posts

Hello,

 

I figure out that i cant use any module in Header cuz its only for js/css and if I use my module in Header I have it in perfect position but JS is not working. Is any way to make JS work?

 

Another way I tryed to add new hook:

 

1. In DB I add Top2

2. In theme/header.php :

'HOOK_TOP2' => Module::hookExec('Top2'),

 

3. Found hook menu and after this div I add my code:

 

<div class="blockadvmulti">{$HOOK_TOP2}</div> // class blockadvmulti - its ads module for banners

 

4. In module function install add:

if ( parent::install() == false
OR $this->registerHook('backOfficeHeader') == false
OR $this->_createTables() == false
OR $this->registerHook('header') == false
OR $this->registerHook('Top2') == false

 

And function to hook:

 

function hookTop2($params)
{
return $this->_processHook( $params, 1);
}

 

This module has 5 params, so I just change top to top2.

 

But I still cant see banner in this place. What did i do wrong?

Link to comment
Share on other sites

and you transplanted module to this hook? under modules > positions tab in back office?

It was not my shop, but I found that there is a new hook in DB: Top2 so I tryed to use it , but no effect. I created a new hook in DB, did the same things and it works! After this transplanted module and now im happy :)

 

So if somebody need something like this:

Register hook in module.php

Function to hook

Add your hook in tpl

Transplant to correct hook

be happy ;))

Link to comment
Share on other sites

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