Hey guys. I'm trying to add a new htmlblock hook to BELOW the image slider and above featured products on the niara theme homepage. I've spent 2 days trying out and putting echo exit breaks on checkpoints to see where and what i'm outputting, but to no avail.
What i've done so far is
1. add a new entry to the tb_hooks section and calling it displayHomeStaticContent
2. inside tbhtmlblock.php i've modified
// List of hooks
$this->hooksList = [
...
'displayHomeTabContent',
'displayHomeStaticHTML',
];
#line 537
public function hookDisplayHomeStaticHTML($params)
{
return $this->hookCommon('displayHomeStaticHTML', $params);
}
4. finally at themes/niara/index.tpl i've adjusted
{if !empty($HOOK_HOME_STATIC_HTML)}
<divclass="tab-content">
{$HOOK_HOME_STATIC_HTML}
</div>
{/if}
{* the rest of the index code below the image slider}
I've put in a lot echos inside the relevant function code areas, and I've found out that
Hook::exec('displayHomeStaticHTML') is being called but is not triggering the PHP function, and that
public function hookDisplayHomeStaticHTML($params) isn't being called also
What am I missing or doing wrong, in trying to create a new hook,solely to be used on the homepage only?
Question
urban
Hey guys. I'm trying to add a new htmlblock hook to BELOW the image slider and above featured products on the niara theme homepage. I've spent 2 days trying out and putting echo exit breaks on checkpoints to see where and what i'm outputting, but to no avail.
What i've done so far is
1. add a new entry to the tb_hooks section and calling it displayHomeStaticContent
2. inside tbhtmlblock.php i've modified
// List of hooks $this->hooksList = [ ... 'displayHomeTabContent', 'displayHomeStaticHTML', ]; #line 537 public function hookDisplayHomeStaticHTML($params) { return $this->hookCommon('displayHomeStaticHTML', $params); }
3. at front/IndexController.php i've modified
$this->context->smarty->assign( [ 'HOOK_HOME' => Hook::exec('displayHome'), 'HOOK_HOME_TAB' => Hook::exec('displayHomeTab'), 'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayHomeTabContent'), // NEW HOOK ENTRY HERE 'HOOK_HOME_STATIC_HTML' => Hook::exec('displayHomeStaticHTML'), ] );
4. finally at themes/niara/index.tpl i've adjusted
I've put in a lot echos inside the relevant function code areas, and I've found out that
Hook::exec('displayHomeStaticHTML') is being called but is not triggering the PHP function, and that
public function hookDisplayHomeStaticHTML($params) isn't being called also
What am I missing or doing wrong, in trying to create a new hook,solely to be used on the homepage only?
Thanks for all your help!
Alan
3 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now