zencart单独屏蔽左右边栏代码

1.屏蔽左栏:打开模板目录下的tpl_main_page.php文件,找到以下代码

if (!isset($flag_disable_left) || !$flag_disable_left) {

在以上代码前面一行,有选择的加入以下代码即可。

if($current_page_base == ‘product_info‘){ //让产品页不显示左边栏
$flag_disable_left = true;
}

if($current_page_base == ‘shopping_cart‘){ //让购物车页不显示左边栏
$flag_disable_left = true;
}

if($current_page_base == ‘create_account‘){ //让注册页不显示左边栏
$flag_disable_left = true;
}

if($current_page_base == ‘site_map‘){ //让网站地图页不显示左边栏
$flag_disable_left = true;
}

if($current_page_base == ‘login‘){ //让登录页不显示左边栏
$flag_disable_left = true;
}

if($current_page_base == ‘contact_us‘){ //让联系我们页不显示左边栏
$flag_disable_left = true;
}

2.屏蔽右栏:打开模板目录下的tpl_main_page.php文件,找到以下代码

if (!isset($flag_disable_right) || !$flag_disable_right) {

在以上代码前面一行,有选择的加入以下代码即可。

if($current_page_base == ‘product_info‘){ //让产品页不显示左边栏
$flag_disable_right = true;
}

if($current_page_base == ‘shopping_cart‘){ //让购物车页不显示右边栏
$flag_disable_right = true;
}

if($current_page_base == ‘create_account‘){ //让注册页不显示右边栏
$flag_disable_right = true;
}

if($current_page_base == ‘site_map‘){ //让网站地图页不显示右边栏
$flag_disable_right = true;
}

if($current_page_base == ‘login‘){ //让登录页不显示右边栏
$flag_disable_right = true;
}

if($current_page_base == ‘contact_us‘){ //让联系我们页不显示右边栏
$flag_disable_right = true;
}

或者直接将要屏蔽的页面写入数组

if(in_array($current_page_base,explode(",", ‘product_info,shopping_cart,create_account,site_map,login,contact_us‘))){
    $flag_disable_left = true;//上面数组中的页面屏蔽左边栏
    $flag_disable_right = true;//上面数组中的页面屏蔽右边栏
}

注意:页面名称对应目录includes\modules\pages下各个文件夹的名称,当不知页面名称时可以到该目录下查看。例如,产品页面名称对应的文件夹名为product_info。

3.单独屏蔽首页或分类页左右边栏的方法:

if($this_is_home_page){ //让首页不显示左右边栏
    $flag_disable_left = true;
    $flag_disable_right = true;
}

if($body_id == ‘index‘ && $cPath != ‘‘){ //让分类页不显示左右边栏
    $flag_disable_left = true;
    $flag_disable_right = true;
}

打完收工。

时间: 2024-12-30 03:59:42

zencart单独屏蔽左右边栏代码的相关文章

jQuery插件PageSlide实现左右侧栏导航

jQuery左右侧栏导航菜单插件PageSlide,目前比较流行的导航菜单展现形式,特别是在手机端或者触屏页面,效果还是不错的,支持自定义展现的方向,菜单内容可自行定义,支持加载页面,或者模态的窗格中显示此页的隐藏的内容,推荐使用. 使用方法: 1.加载插件和jQuery <link rel="stylesheet" type="text/css" href="../jquery.pageslide.css" /> <scrip

编程算法 - 左旋转字符串 代码(C)

左旋转字符串 代码(C) 本文地址: http://blog.csdn.net/caroline_wendy 题目: 字符串的左旋转操作是把字符串前面的若干个字符转移到字符串的尾部. 请定义一个函数实现字符串左旋转操作的功能. 编程珠玑, 首先翻转前部分, 再翻转后部分, 最后全部翻转. 代码: /* * main.cpp * * Created on: 2014.6.12 * Author: Spike */ /*eclipse cdt, gcc 4.8.1*/ #include <stdio

许多博客都过滤或屏蔽alexa的widget代码script标签,有办法解决么

许多博客都过滤或屏蔽alexa的widget代码script标签,有办法解决么,如下: <a href="http://www.alexa.com/siteinfo/gmb2b.com"><script type="text/javascript" src="http://xslt.alexa.com/site_stats/js/s/a?url=gmb2b.com"></script></a> 代码

基于jQuery右侧弹出侧边导航栏代码

基于jQuery右侧弹出侧边导航栏代码.这是一款点击按钮弹出侧边导航栏样式特效代码.效果图如下: 在线预览   源码下载 实现的代码. html代码: <div class="box-bj"><img src="images/wd011.jpg" /></div> <div id="mintbar"><a id="closebtn" href="#"&g

最左/右边的数-hd1060/1061

左边: http://acm.hdu.edu.cn/showproblem.php?pid=1060 1 #include <iostream> 2 #include <math.h> 3 using namespace std; 4 5 int main() 6 { 7 int n,m,d,i; 8 double l; 9 while(cin>>n) 10 11 { 12 for(i=1;i<=n;i++) 13 { 14 cin>>m; 15 l=

有用的导航栏代码

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body><style type="text/css"> *{ list-style: none; padding: 0; margin: 0; }.aaa

css下拉导航栏代码

<!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <!--<link href="test3.css" rel="stylesheet" type="text/css"/>--> <style type=&

破解&amp;屏蔽防止嵌入框架代码 top.location != self.location

<script type="text/javascript"> if (top.location != self.location) top.location = self.location; </script>

IntelliJ IDEA 2017.3 创建多Module项目时,右边栏出现多个root模块的问题。如图。

我新建了一个项目,里面有三个模块(Module),结果建好后,出现了三个root.然后我发现主模块的pom文件,包含这样一段配置 <modules> <module>design_pattern</module> </modules> 我抱着试试的态度加上了另外两个module,现在只剩一个root了 哎,小弟又是不知道具体什么原因,反正解决了一个疑问.java工程师路漫漫,自己要努力啊. 原文地址:https://www.cnblogs.com/BaleW