博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
magento 将分类的图片,放到顶部显示 - 将下面的信息,放到顶部显示
阅读量:4203 次
发布时间:2019-05-26

本文共 711 字,大约阅读时间需要 2 分钟。

block是按照顺序依次而来,依次画出来

如果想将某个部分的数据搞到顶部显示,而且这个数据是内容部分计算出来的,那么可以用下面的方式解决

 

 

1. 在 layout/template.phtml 文件的后面加上

你想要这个部分在哪里显示,就加到哪里,我是在顶部的菜单下面,因此我是在  

messages的下面添加的

 

2.template/columns-left.phtml 

breadcrumbs后面加入
getModulesByPosition('page_header_top') ?>

 

3.在显示的顶部加入

$blockT = $this->getLayout()->createBlock(				'Mage_Core_Block_Template',				'category_image_top',				array('template' => 'catalog/category/view/top_image.phtml')			);			$categoryImage = $current_category->getImage();			$width = 500;			$height = 200;			$imgUrl = $this->getCategoryImageUrl($categoryImage, $width, $height);			$blockT->assign('imageUrl', $imgUrl);			$this->getLayout()->getBlock('page_header_top')->append($blockT);

通过这种方式添加上block就可以了

 

 

 

 

 

 

 

 

 

 

转载地址:http://spcli.baihongyu.com/

你可能感兴趣的文章
【一天一道LeetCode】#48. Rotate Image
查看>>
【一天一道LeetCode】#56. Merge Intervals
查看>>
【一天一道LeetCode】#57. Insert Interval
查看>>
【一天一道LeetCode】#58. Length of Last Word
查看>>
【一天一道LeetCode】#59. Spiral Matrix II
查看>>
【一天一道LeetCode】#30. Substring with Concatenation of All Words
查看>>
【一天一道LeetCode】#60. Permutation Sequence.
查看>>
【一天一道LeetCode】#62. Unique Paths
查看>>
【一天一道LeetCode】#61. Rotate List
查看>>
【一天一道LeetCode】#63. Unique Paths II
查看>>
【一天一道LeetCode】#36. Valid Sudoku
查看>>
【一天一道LeetCode】#75. Sort Colors
查看>>
【一天一道LeetCode】#76. Minimum Window Substring
查看>>
【计算机网络 第五版】阅读笔记之一:概述
查看>>
【计算机网络 第五版】阅读笔记之二:物理层
查看>>
【计算机网络 第五版】阅读笔记之三:数据链路层
查看>>
【计算机网络 第五版】阅读笔记之四:网络层
查看>>
【计算机网络 第五版】阅读笔记之五:运输层
查看>>
【一天一道LeetCode】#77. Combinations
查看>>
【一天一道LeetCode】#78. Subsets
查看>>