Jump to content

如何显示自己的模块内容在某个页面的特定的DIV里。


jet_dong

Recommended Posts

Hi,大家好。

一、我修改了prestashop 默认的 editorial 模块重新命名为:peditorial.php,
关键修改两处:


①function install()
{
if (!parent::install())
return false;
return $this->registerHook('myPage');
}


② function hookmyPage($params){ ..... }





二、修改了header.php

$smarty->assign(array(
'HOOK_HEADER' => Module::hookExec('header'),
'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'),
'HOOK_MYPAGE' => Module::hookExec('myPage'),
'HOOK_TOP' => Module::hookExec('top'),
'static_token' => Tools::getToken(false),
'token' => Tools::getToken(),
'priceDisplayPrecision' => _PS_PRICE_DISPLAY_PRECISION_,
'content_only' => intval(Tools::getValue('content_only'))

));




成功安装该模块。




三、自定义的页面: productsss.tpl 内容如下:


{include file=$tpl_dir./breadcrumb.tpl}
<!-- Left -->


{$HOOK_LEFT_COLUMN}




{$HOOK_LEFT_COLUMN}
{$HOOK_myPage}





四、然后运行相关的页面, 无法显示{$HOOK_myPage} 的内容,{$HOOK_LEFT_COLUMN}显示正常




谢谢,请大家不吝赐教。。。
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...