Jump to content

[solved] Hook Control With If In .tpl File


Recommended Posts

Hi everybody;

 

I don't know if it is possible but I want to ask.

 

for example: I use blockmyaccountfooter module in footer. I also want to use it in "top" with different design. I added this hook to module php folder and transplant the module to the "top". We know that module has a .tpl file and I want to divide it two part. First part will used by hookfooter second part will used by hooktop like below:

 

 

----blockmyaccountfooter.tpl----
{if $HOOK_FOOTER}
//some tpl codes
{/if}
{if $HOOK_TOP}
//some tpl codes
{/if}

 

Can I do this?

Link to comment
Share on other sites

  • 2 months later...

Hi all again :)

 

It's ok, I have the solution, and it is...easy.

 

You need to change in your PHP file (the PHP file in the module directory, of course). The change to do is to add a new block of lines with the hook you need to see your module.

 

For exemple, in my case, I want to have the module Newsletter on the left colomn AND the footer.

 

So, in the PHP file, I added this block :

 

public function hookFooter($params)

{

$this->_prepareHook($params);

return $this->display(__FILE__, 'blocknewsletter_footer.tpl');

}

 

So the module newsletter can be attached to this hook (footer) and you can see I changed the TPL file with a new one (duplicate the initial one, and then you can change all you want, class, div,...).

 

I hope I am enough clear in my explain ? :)

 

++

 

Fred

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...