When module Enabled in Content left & right panel so I want to hide javascript code in OpenCart

倾然丶 夕夏残阳落幕 提交于 2019-12-25 08:55:11

问题


I have add small javascript code in featured.tpl module OpenCart. So, when, featured module Enabled in Content top & bottom part. so, I want to show(run) it javascript code. but, when featured module Enabled in Content left & right panel. so, I want to hide(not run) it javascript code.

Please guide me :)


回答1:


I have found solution.

in .tpl file

<?php if ($module['position'] == 'content_bottom' || $module['position'] == 'content_top') { ?>
//add your code Here
<?php } ?>

add in .php file

$this->data['module'] = $setting;


来源:https://stackoverflow.com/questions/23675545/when-module-enabled-in-content-left-right-panel-so-i-want-to-hide-javascript-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!