Hướng dẫn đưa module Slideshow lên Header
tìm đến dòng:
$this->data['text_content_top'] = $this->language->get('text_content_top');
paste vào sau đó đoạn code:
$this->data['text_content_header'] = $this->language->get('text_content_header');
2. Mở file admin\view\template\module\slideshow.tpl
tìm đến dòng:
<td class="left"><select name="slideshow_module[<?php echo $module_row; ?>][position]">
paste vào sau đó đoạn code:
<?php if ($module['position'] == 'content_header') { ?><option value="content_header" selected="selected"><?php echo $text_content_header; ?></option><?php } else { ?><option value="content_header"><?php echo $text_content_header; ?></option><?php } ?>
tìm đến dòng:
html += ' <td class="left"><select name="slideshow_module[' + module_row + '][position]">';
paste vào sau đó đoạn code:
html += ' <option value="content_header"><?php echo $text_content_header; ?></option>';
3. Mở file admin\language\english\module\slideshow.php
tìm đến dòng:
$_['text_success'] = 'Success: You have modified module slideshow!';
paste vào sau đó đoạn code:
$_['text_content_header'] = 'Header';
4. Mở file catalog\view\theme\default\stylesheet\stylesheet.css
tìm đến dòng:
/* header */
paste vào sau đó đoạn code:
.div222 .slideshow { }
Các nội dung như background, chiều cao-rộng,... các bạn tự thêm tùy ý.
5. Mở file catalog/controller/common/header.php
tìm đến
đoạn
: if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) {$this->template = $this->config->get('config_template') . '/template/common/header.tpl';} else {$this->template = 'default/template/common/header.tpl';}
Thêm vào trước đó đoạn code:
$layout_id = 1;$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'] == 'content_header' && $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;}}
6. Mở file catalog\view\theme\default\template\common\header.tpl
tìm dòng:
<script type="text/javascript" src="catalog/view/javascript/common.js"></script>
paste vào sau đó đoạn code:
<script type="text/javascript" src="catalog/view/javascript/jquery/nivo-slider/jquery.nivo.slider.pack.js"></script><link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $this->config->get('config_template'); ?>/stylesheet/slideshow.css" media="screen" />
Thêm vào cuối file đoạn code sau:
<div class="div222"><?php foreach ($modules as $module) { ?><?php echo $module; ?><?php } ?></div>
Xong các bạn save lại , vào admincp cài đặt slideshow chọn Vị trí: Header
Và thưởng thức thành quả nhé!
|
Bài liên quan
Home






Comments[ 0 ]
Đăng nhận xét
-HAHEINEKEN.BLOGSPOT.COM
- viết một nhận xét nếu thấy bài nào có ích