- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
编辑:事实证明,下面的解决方案实际上是正确的。事实证明,我的 vagrant box 没有安装 php5-gd,因此 magento 无法执行图像操作,但 PHP 没有显示未安装的错误。所以确保你安装了 php5-gd :P
美好的一天!
我目前正在开发一个基于 Magento 1.9 的电子商务网站,我基本上是边做边学。我目前正在采用静态设计并将其转化为 Magento 主题。
我试图在商店的页脚区域显示商店中 6 种最新产品的图片(带链接),但我发现的教程和问题对我不起作用。
我基本上是从静态模板中取出我的页脚并将其粘贴到我的主题 footer.phtml 文件中。设计要求在 html 中像这样显示六个图像(如果这样有意义吗?)
<div class="medium-6 large-3 columns newlyAdded">
<div class="footerHat"></div>
<h3> Newly Added</h3>
<div class="row">
<ul class="small-block-grid-3">
<li><img src="./images/footer-image-1.jpg" alt="footer image"></li>
<li><img src="./images/footer-image-2.jpg" alt="footer image"></li>
<li><img src="./images/footer-image-3.jpg" alt="footer image"></li>
</ul>
</div>
<p></p>
<div class="row">
<ul class="small-block-grid-3">
<li><img src="./images/footer-image-4.jpg" alt="footer image"></li>
<li><img src="./images/footer-image-5.jpg" alt="footer image"></li>
<li><img src="./images/footer-image-6.jpg" alt="footer image"></li>
</ul>
</div>
</div>
我最初的想法是将其粘贴到一个静态 block 中,然后循环访问 Magento 模型中的一些内容,但我不确定这是否是最好的方法。
任何帮助将不胜感激,当然我会提供尽可能多的信息:)
谢谢
编辑:额外信息
page.xml 文件中与页脚相关的内容:
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
<label>Page Footer</label>
<action method="setElementClass"><value>bottom-container</value></action>
</block>
<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
</block>
<block type="core/text_list" name="before_body_end" as="before_body_end" translate="label">
<label>Page Bottom</label>
<block type="page/html_cookieNotice" name="global_cookie_notice" as ="global_cookie_notice" template="page/html/cookienotice.phtml" before="-" />
</block>
<reference name="footer">
<block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml">
<action method="setProductsCount"><count>4</count></action>
</block>
</reference>
footer.phtml 文件(默认 magento 版本)
<div class="footer-container">
<div class="footer">
<?php echo $this->getChildHtml() ?>
<p class="bugs"><?php echo $this->__('Help Us to Keep Magento Healthy') ?> - <a href="http://www.magentocommerce.com/bug-tracking" onclick="this.target='_blank'"><strong><?php echo $this->__('Report All Bugs') ?></strong></a> <?php echo $this->__('(ver. %s)', Mage::getVersion()) ?></p>
<address><?php echo $this->getCopyright() ?></address>
</div>
</div>
custom_page.xml:
<?xml version="1.0"?>
<layout>
<custom_layout translate="label">
<label>Custom layout</label>
<reference name="root">
<action method="setTemplate"><template>page/custom_layout.phtml</template></action>
<action method="setIsHandle"><applied>1</applied></action>
</reference>
</custom_layout>
</layout>
最佳答案
Magento 已经具备此功能,您可以使用以下代码在页脚/您想要显示的任何位置显示新产品
<reference name="footer">
<block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page">
<action method="setProductsCount"><count>4</count></action>
</block>
</reference>
注意 我认为您已经遵循了 Magento 的主题化方式并拥有“引用页脚”,如果您愿意,您可以将 block 代码放入任何引用调用中,并可以直接在页脚中调用它.phtml.
如果您想设置布局样式,请在“app/design/frontend/{themepackage}/{themename} 中创建“app/design/frontend/base/default/template/catalog/product/new.phtml”的副本/template/catalog/product/new.phtml"并修改布局。
如有任何疑问,请随时发表评论!希望这对您有所帮助!
关于php - Magento 1.9 在页脚显示最新产品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26340724/
就目前情况而言,这个问题不太适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、民意调查或扩展讨论。如果您觉得这个问题可以改进并可能重新开放,visit
ECharts是一个纯Javascript的图表库,可以流畅的运行在PC和移动设备上,兼容当前绝大部分浏览器,底层依赖轻量级的Canvas类库ZRender,提供直观、生动、可交互、可高度个性化定制
前言 提示:这里可以添加本文要记录的大概内容: 例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。 提示:以下是本篇文章正文
作为一名ios开发攻城狮,在苹果没有出arc(自动内存管理机制)时,我们几乎有一半的开发时间都耗费在这么管理内存上.后来苹果很人性的出了arc,虽然在很大程度上,帮助我们开发者节省了精力和时间.但是
如何反转Pandas中DataSeries的排序顺序,以便我按降序使用它们? 最佳答案 In [28]: s = pd.Series([20, 10, 30], ['c', 'a', 'b']) In
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Is jQuery $.browser Deprecated? 最新的 jQuery 库是否发生变化 $.brows
我正在开发一个 Intranet 项目,所以我无法复制/粘贴代码,所以希望我的描述和一些小片段会有所帮助。 我知道 MySQL 触发器无法做到这一点,但希望有一种干净的 JPA PrePersist(
这是数据集: 人员状态日期 埃里克 1 1/1/2015 埃里克 2 2/1/2015 埃里克 3 2015 年 3 月 1 日 约翰福音 1 3/1/2015 约翰福音 2 2015 年 2 月 1
现在我正在使用下面的查询按每篇文章的 auto_increment id 排序 mysql_query("SELECT * FROM articles ORDER BY id DESC"); 我想知道
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 我们不允许提出有关书籍、工具、软件库等方面的建议的问题。您可以编辑问题,以便用事实和引用来回答它。 关闭
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 我们不允许提出有关书籍、工具、软件库等方面的建议的问题。您可以编辑问题,以便用事实和引用来回答它。 关闭
现在我正在使用下面的查询按每篇文章的 auto_increment id 排序 mysql_query("SELECT * FROM articles ORDER BY id DESC"); 我想知道
在我们做文章的时候常用一些函数修改来实现自己的页面效果,例如,时间的自定义格式 我们常常需要乃至的,搜集了些有关时间格式的CODE,作大家为参考,希望对大家有些帮助 列表页list_article
我想将某些东西提交到 github 存储库,但我(显然)没有任何权利这样做。我对那个 repo 做了一个分支,提交了我的更改并提交了一个 pull-request。 现在,问题是过了一段时间其他人已经
我是 SQL 新手,所以现有的答案对我来说有点复杂。 我有三张 table : WORKER |id |name |date |... JOB |id |name |salary |accept AP
我正在自动从PowerPoint和Excel电子表格中生成PowerPoint报表。在粘贴表格之前,我已经完成了整个过程。 我使用PPApp.CommandBars.ExecuteMso ("Past
我们有 1 个 Kafka 主题和 1 个分区: 从 spring boot kafka 消费者那里看到一个相当奇怪的行为。 Spring kafka消费者在重新启动时总是从主题的开头开始消费。 我已
通过编程从iOS照片库获取最新照片是否有技巧? 我知道我可以按日期搜索,但是我必须每隔一微秒进行一次扫描,以便进行某种比较以准确地找到它。 有没有人做过这个或任何想法? 最佳答案 我之前采取的一种方法
我们上周将 Web 应用程序中的 Telerik Kendo 库从 V2015.2.902 升级到 V2016.1.112。从那时起,我们注意到使用 Kendo 的页面需要很长时间才能加载(30 秒到
我有两个表: STUDENT GRADES ---------- ---------- id id name person_id ad
我是一名优秀的程序员,十分优秀!