magento 模板--左边栏
来源:互联网 发布:淘宝收藏按钮怎么设置 编辑:程序博客网 时间:2024/04/28 20:00
边栏:左边栏,右边栏page.xml 定义:-------------------------------- <block type="core/text_list" name="left" as="left" translate="label"> <label>Left Column</label> </block>.................................................. <block type="core/text_list" name="content" as="content" translate="label"> <label>Main Content Area</label> </block>.................................................................................................... <block type="core/text_list" name="right" as="right" translate="label"> <label>Right Column</label> </block>=====================================================主页样式:1column.phtml,2columns-right.phtml,2columns-left.phtml,3columns.phtml,empty.phtml,popup.phtml,print.phtml 里定义------------------------------------------<div class="main-container col3-layout"> <div class="main"> <?php echo $this->getChildHtml('breadcrumbs') ?> <div class="col-wrapper"> <div class="col-main"> <?php echo $this->getChildHtml('global_messages') ?> <?php echo $this->getChildHtml('content') ?> </div> <div class="col-left sidebar"><?php echo $this->getChildHtml('left') ?></div> </div> <div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div> </div> </div>------------------------------------------------- 在catalog.xml 里重新定义left,right左边栏的banner---------------------------------------------------------- <reference name="left"> <block type="core/template" name="left.permanent.callout"template="callouts/left_col.phtml"> <action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action> <action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (555) 555-0123.</alt></action> <action method="setLinkUrl"><url>checkout/cart</url></action> </block> </reference>====================================================left_col.phtml 的内容:----------------------------------------------<div class="block block-banner"> <div class="block-content"> <?php if(strtolower(substr($this->getLinkUrl(),0,4))==='http'): ?> <a href="<?php echo $this->getLinkUrl() ?>" title="<?php echo $this->__($this->getImgAlt()) ?>"> <?php elseif($this->getLinkUrl()): ?> <a href="<?php echo $this->getUrl($this->getLinkUrl()) ?>" title="<?php echo $this->__($this->getImgAlt()) ?>"> <?php endif; ?> <img src="<?php echo $this->getSkinUrl($this->getImgSrc()) ?>"<?php if(!$this->getLinkUrl()): ?> title="<?php echo $this->__($this->getImgAlt()) ?>"<?php endif; ?> alt="<?php echo $this->__($this->getImgAlt()) ?>" /> <?php if($this->getLinkUrl()): ?> </a> <?php endif ?> </div></div>=============================================================getLinkUrl() 获得<action method="setLinkUrl"><url>的值,如果值是完整的URL,输出不完整, getUrl() 获得网站的地址,和<action method="setLinkUrl"><url>的值连在一起。getImgAlt() 获得<action method="setImgAlt" translate="alt" module="catalog"><alt>的值getSkinUrl 获得模板skin的完整路径getImgSrc() 获得<action method="setImgSrc"><src> 的值左边栏的tag在tag.xml里重新定义左边栏:----------------------------------------------------- <default> <!-- Mage_Tag --> <reference name="left"> <block type="tag/popular" name="tags_popular" template="tag/popular.phtml"/> </reference> </default>=====================================================模板tag/popular.phtml---------------------------------<div class="block block-tags"> <div class="block-title"> <strong><span><?php echo $this->__('Popular Tags'); ?></span></strong> </div> <div class="block-content"> <ul class="tags-list"> <?php foreach ($this->getTags() as $_tag): ?> <li><a href="<?php echo $_tag->getTaggedProductsUrl() ?>" style="font-size:<?php echo $_tag->getRatio()*70+75 ?>%;"><?php echo $this->htmlEscape($_tag->getName()) ?></a></li> <?php endforeach; ?> </ul> <div class="actions"> <a href="<?php echo $this->getUrl('tag/list') ?>"><?php echo $this->__('View All Tags') ?></a> </div> </div></div>=================================================getTags() 猜想是从数据库里调用。 左边栏的newsletternewsletter.xml 重新定义left------------------------------------------------------ <default> <!-- Mage_Newsletter --> <reference name="left"> <block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"/> </reference> </default>====================================================
0 0
- magento 模板--左边栏
- Magento 左边导航栏修改
- magento 在首页左边栏添加分类目录
- magento模板
- Magento左边导航菜单调出方法
- 在Magento页面左边增加分类菜单
- magento模板 -- 如何安装magento模板
- 左边栏
- 定制Magento模板
- 初探magento模板系统
- Magento 模板调试
- 定制Magento模板
- Magento模板制作教程
- Magento 常用模板
- magento的模板安装
- magento假发模板
- magento 模板模块
- magento 模板--分类链接
- Spring整合定时任务调度框架Quartz实战
- C++实现直接插入排序,折半插入排序,希尔排序,冒泡排序,简单选择排序,快速排序,堆排序
- linux本地套接字
- poj 1392 构造欧拉路遍历所有可能
- 注册时,验证用户名是否重名
- magento 模板--左边栏
- 思乡的情绪
- Android 4.3 中的 TRIM 优化
- Func,Action 的介绍及其用法
- 【BZOJ】【P3039】【玉蟾宫】【题解】【悬线法】
- NYOJ116 士兵杀敌(二)(树状数组)
- 初识安卓
- 解决session过期跳转到登陆页面并跳出iframe框架
- GCC内建函数__builtin_constant_p