如何将模块挂接到 prestashop 中的新页面?
我尝试在 prestashop 中使用静态页面作为主页。我能想到的唯一方法是创建一个新页面(即shop.php),然后将当前在主页中挂钩的模型挂钩到新的shop.php。
我尝试遵循此 http://alvinjian。 blogspot.com/2011/01/prestashop-tips-how-to-create-complete.html 创建一个新页面,它确实可以显示静态文本,即“hello world” -但是我不知道将 homefeatured 模块(例如)连接到它。
你能以任何方式提供帮助吗?
谢谢
I am try to have a static page as the home page in prestashop. The only way I can think of dong this is by creating a new page (i.e. shop.php) then hook the models that are currently hooked in the home page to the new shop.php.
I tried to follow this http://alvinjiang.blogspot.com/2011/01/prestashop-tips-how-to-create-complete.html to create a new page, it does work up to the point of displaying static text i.e. "hello world" - however I don't know to hook the homefeatured module (for example) to it.
Can you help in any way?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要将模块挂钩到新页面,您可以按照以下步骤操作:
在我的示例中,挂钩名为 topSearch
创建新挂钩
允许您的模块链接这个新的钩子
你只需要编辑你的 module.php 来添加一个用钩子命名的函数,例如:
然后将相应的模块链接到你的新钩子
Backoffice ->;模块->位置->嫁接模块
在.tpl文件中执行你的钩子
你已经创建了一个新的page.php,它包含include(dirname(_FILE_).'/ header.php'); 因此,通过在 override/classes/ 中创建一个名为 FrontController.php 的新文件来覆盖 FrontController.php。
然后将您的钩子添加到 displayHeader 函数
将相应的 smarty var 添加到您的模板文件中
To hook a module to a new page you can make follow this steps :
In my example the hook was named topSearch
Create a new hook
Allow your module to link with this new hook
You simply need to edit your module.php to add a function named with the hook, example :
Then link corresponded module to your new hook
Backoffice -> Module -> Position -> Grafting a module
Execute your hook in the .tpl file
You have create a new page.php, it contain include(dirname(_FILE_).'/header.php'); so override your FrontController.php by creating a new file named FrontController.php in override/classes/.
Then add your hook to the displayHeader function
To finish add the corresponded smarty var to your template file
您可以在此处阅读如何在某个位置挂钩模块以及如何创建新挂钩。请注意,应为该特定挂钩安装该模块。
http://www.programmingtunes.com/creating-new-prestashop-hook/
You can read here that how you can hook a module at some place and also how you can create a new hook. Please note that the module should be installed for that particular hook.
http://www.programmingtunes.com/creating-new-prestashop-hook/