dongmou1964 2015-06-05 05:43
浏览 76
已采纳

在opencart中实现新模板后,主页幻灯片显示无法查看

In default theme all are fine and showing the homepage slideshow,but implementing other theme not showing the homepage slideshow.Checked the admin panel,there are all exactly same as default theme.How to show the slider?

theme/module/Slideshow.tpl

<div class="slideshow">
  <div id="slideshow<?php echo $module; ?>" class="nivoSlider">
    <?php foreach ($banners as $banner) { ?>
    <?php if ($banner['link']) { ?>
    <a href="<?php echo $banner['link']; ?>"><img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" /></a>
    <?php } else { ?>
    <img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" />
    <?php } ?>
    <?php } ?>
  </div>
</div>
<script type="text/javascript"><!--
$(document).ready(function() {
    $('#slideshow<?php echo $module; ?>').nivoSlider();
});
--></script>

slideshow modules are not viewed any kind of images.when <?php echo $slideshow;?>.its showing array().

header.tpl

<?php $slideshow = $modules->getModules('slideshow'); ?>
            <?php if(count($slideshow)) { ?>
            <!-- Slider -->
            <div id="slider" class="<?php if($theme_options->get( 'slideshow_layout' ) == 2) { echo 'fixed'; } else { echo 'full-width'; } ?>">
                <div class="background-slider"></div>
                <div class="background">
                    <div class="shadow"></div>
                    <div class="pattern">
                        <?php foreach($slideshow as $module) { ?>
                        <?php echo $module; ?>
                        <?php } ?>
                    </div>
                </div>
            </div>
            <?php } ?>
  • 写回答

1条回答 默认 最新

  • dream04110 2015-06-17 12:42
    关注

    Thanks for share code with me, You are missed to define content_top area in your theme, you have to go here

    catalog/view/theme/yourtheme/template/common/home.tpl
    

    go to line no 18 & add this line just below the line 18

    <?php echo $content_top; ?>
    

    and your slider will come on your home page.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有没有整苹果智能分拣线上图像数据
  • ¥20 有没有人会这个东西的
  • ¥15 cfx考虑调整“enforce system memory limit”参数的设置
  • ¥30 航迹分离,航迹增强,误差分析
  • ¥15 Chrome Manifest扩展引用Ajax-hook库拦截请求失败
  • ¥15 用Ros中的Topic通讯方式控制小乌龟的速度,走矩形;编写订阅器代码
  • ¥15 LLM accuracy检测
  • ¥15 pycharm添加远程解释器报错
  • ¥15 如何让子窗口鼠标滚动独立,不要传递消息给主窗口
  • ¥15 如何能达到用ping0.cc检测成这样?如图