- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我是 OpenCart 的新手,我想在以下位置添加更多列:
扩展 --> 模块 --> 横幅
例如我想添加:
在位置字段中:
列顶部
栏底
剩下的内容
内容权
列/内容自定义* <---
并希望将此横幅放置在所需页面上的自定义位置。请帮助...!
最佳答案
首先,您需要打开模块的语言文件; /admin/language/*/module/
并添加您的新职位。
$_['text_content_middle'] = 'Content Middle';
其次,您需要打开模块的管理模板文件; /admin/view/template/module/
并在第 50 行左右添加一个新的“if position is set”语句。
<?php if ($module['position'] == 'content_middle') { ?>
<option value="content_middle" selected="selected"><?php echo $text_content_middle; ?></option>
<?php } else { ?>
<option value="content_middle"><?php echo $text_content_middle; ?></option>
<?php } ?>
并在同一个文件中的第 140 行附近将选项添加到 javascript 函数:
html += ' <option value="content_middle"><?php echo $text_content_middle; ?></option>';
第三,您需要打开位于的模块的 Controller 文件; /admin/controller/module/
并在第 35 行附近的任意位置添加新行。
$this->data['text_content_middle'] = $this->language->get('text_content_middle');
您现在应该能够在模块设置中看到新位置。还要确保模块的布局设置为“主页”。
首先,您必须将位置添加到位于的数组中; /catalog/controller/common/home.php
第 20 行左右。
'common/content_middle',
其次,您需要在 /catalog/controller/common/
中创建相应的 PHP 文件(例如:“content_middle.php”)。添加以下代码,注意第 2、50、79、80 和 82 行)因为需要反射(reflect)您的职位名称:
<?php
class ControllerCommonHomeOne extends Controller {
public function index() {
$this->load->model('design/layout');
$this->load->model('catalog/category');
$this->load->model('catalog/product');
$this->load->model('catalog/information');
if (isset($this->request->get['route'])) {
$route = $this->request->get['route'];
} else {
$route = 'common/home';
}
$layout_id = 0;
if (substr($route, 0, 16) == 'product/category' && isset($this->request->get['path'])) {
$path = explode('_', (string)$this->request->get['path']);
$layout_id = $this->model_catalog_category->getCategoryLayoutId(end($path));
}
if (substr($route, 0, 15) == 'product/product' && isset($this->request->get['product_id'])) {
$layout_id = $this->model_catalog_product->getProductLayoutId($this->request->get['product_id']);
}
if (substr($route, 0, 23) == 'information/information' && isset($this->request->get['information_id'])) {
$layout_id = $this->model_catalog_information->getInformationLayoutId($this->request->get['information_id']);
}
if (!$layout_id) {
$layout_id = $this->model_design_layout->getLayout($route);
}
if (!$layout_id) {
$layout_id = $this->config->get('config_layout_id');
}
$module_data = array();
$this->load->model('setting/extension');
$extensions = $this->model_setting_extension->getExtensions('module');
foreach ($extensions as $extension) {
$modules = $this->config->get($extension['code'] . '_module');
if ($modules) {
foreach ($modules as $module) {
if ($module['layout_id'] == $layout_id && $module['position'] == 'home_one' && $module['status']) {
$module_data[] = array(
'code' => $extension['code'],
'setting' => $module,
'sort_order' => $module['sort_order']
);
}
}
}
}
$sort_order = array();
foreach ($module_data as $key => $value) {
$sort_order[$key] = $value['sort_order'];
}
array_multisort($sort_order, SORT_ASC, $module_data);
$this->data['modules'] = array();
foreach ($module_data as $module) {
$module = $this->getChild('module/' . $module['code'], $module['setting']);
if ($module) {
$this->data['modules'][] = $module;
}
}
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/home_one.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/home_one.tpl';
} else {
$this->template = 'default/template/common/home_one.tpl';
}
$this->render();
}
}
?>
第三,在/view/theme/your-theme/template/common/
中创建对应的TPL文件(例如:“content_middle.tpl”)。添加以下代码:
<?php foreach ($modules as $module) { ?>
<?php echo $module; ?>
<?php } ?>
现在您可以通过调用
在主题的 home.tpl 文件中的任意位置插入您的位置<?php echo $content_middle; ?>
我不鼓励在 OpenCart 中编辑核心文件,给 vQMod (1.5+) 或 OCMod (2+) 一个机会!
希望对您有所帮助!
关于php - 如何为横幅添加自定义列而不是右列、左列、顶部列和底部列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13194892/
如何在不使用垫片的情况下将 View 定位在底部。我知道我可以在 VStack 中放置一个间隔器和我的 View 来实现它,但我不想使用一个间隔器,因为我不希望我的 View 占据所有的垂直空间。使用
我想让文本 float 到现有标签的右下角。 我仍在使用旧学校表(编辑现有代码)。我的代码是这样的:
我有一个包含文本的表格单元格,但我怎样才能使文本齐平到单元格的顶部或底部(上面没有填充)?我试过垂直对齐,但它仍然没有到达顶部“边缘”。 我的代码 3.2325
我想用 javascript 打印一个特殊的页面 div。 function printDiv(divName) { var printContents = document
我需要检查元素是否距离页面底部 x 像素,以动态加载新内容。目前,即使栏位于底部,scrollTop 和高度也不匹配。 jquery 是允许的,虽然基本的 javascript 会更有帮助。 最佳答案
我正在用 pygame 重新制作 flappy bird,但主题是星球大战。我已经完成了游戏的美术和一般格式设置,但现在我需要调整细节。我一直在改变数字,试图让光剑完全到达屏幕的顶部和底部,因为目前有
http://pastehtml.com/view/bfzerlo1m.html 如何将红色框放在橙色 div 底部的 CENTER + 中? 红框的高度和宽度都是动态的,每个框都不同.. (它需要在
我正在研究和测试表格。到目前为止,我成功地使用 following fiddle 将选择框列表中的项目一项一项地向上和向下移动。 . 代码实例(向上移动): function moveUp() { $
在设计 IOS 应用程序时,我可以在页脚放置“后退”按钮功能吗? 最佳答案 我认为指南中没有任何内容禁止这样做,但是您的潜在用户习惯于将后退按钮放在左上角,因此除非您有充分的理由将后退按钮放在底部,并
你可以只在顶部/底部而不是所有(T、B、L、R)设置单元格填充或间距吗? 最佳答案 CSS? td { padding-top: 2px; padding-bottom: 2px; } 关于H
我正在为我的 React 应用程序使用无限滚动,并具有检测我何时恰好位于页面底部的功能: const [isFetching, setIsFetching] = useState(false); //
所以我有一个页面,其中有一个类似聊天的 div,里面充满了文本。它具有固定的高度和宽度(由 css 定义)。 我需要它在每次更新时滚动到底部,这是我到目前为止使用的 JS: $("#div1").an
我遇到了与此处描述的相同的问题:UIWebView doesn't scroll to the bottom of the webpage loaded/created (不幸的是没有人回答) 我有一
我有一个溢出设置为滚动的 div,它本质上是逐行从文件中流式传输数据。我想在流溢出时自动滚动到 div 的底部,但不使用“单击此处滚动到底部”按钮。 我已经知道 scrollTop = scrollH
我正在 Android studio 中构建一个应用程序,但遇到了一些问题。我在 main_activity.xml 中有一个 ImageView
我有一个扩展 Jpanel 的类,里面有一个动画。我有两个操作按钮可以停止和启动它,但是我需要这些按钮出现在 Jpanel 的底部。我已经尝试过: add(go,BOTTOM_ALIGNMENT);
嗨,我正在为ios设备(ipad)开发phonegap / cordova项目。该应用程序通过蓝牙键盘接收输入文本(因为我不想在屏幕上显示键盘)。到目前为止,应用程序可以按预期接收输入。但是关于外观,
我想在底部放置一个页脚。 出于某种原因,它会像这样出现。 在 index.html 中,我有:
我得到了一个带有内联编辑功能的 jqgrid,并且可以添加新行。 目前,新行以“编辑”模式显示在网格顶部。我想要的是将新行添加到网格底部,因为我的“添加新行”按钮位于自定义底部分页器中... 有人知道
在 Swift 3 中,我以编程方式创建了一个(底部)工具栏,其中包含自定义按钮,中间用灵活的垫片分隔自定义按钮,将一个(“上一个”)推到左边缘,另一个(“下一个”)到 View 的右边缘。但我无法显
我是一名优秀的程序员,十分优秀!