您的位置:首页 > 其它

14.为主题配置图片性能

2015-12-31 14:22 344 查看
Magento2中用于前台的产品图片性能都被存储在view.xml配置文件中。本文提供所有的可用性能细节及配置方法。

1.在view.xml中配置图片性能

view.xml通常位于主题的:

<theme_dir>/etc/view.xml


例如,view.xml在Magento Blank主题中的位置是:

app/design/frontend/Magento/blank/etc/view.xml


在view.xml中,图片性能被配置在< images module=”Magento_Catalog”>元素内:

<images module="Magento_Catalog">
...
<images/>


每种被图片性能配置的类型图片是通过< image>元素的id和type属性定义的:

<images module="Magento_Catalog">
<image id="unique_image_id" type="image_type">
...
</image>
<images/>


下面的表格描述属性的详情:



<images module="Magento_Catalog">
<image id="unique_image_id" type="image">
<width>100</width> <!-- Image width in px -->
<height>100</height> <!-- Image height in px -->
</image>
</images>




http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-images.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: