Magento उस फ़ाइल का उपयोग करता है जिसे view.xmlएप्लिकेशन के थीम स्तर पर बनाए रखा जाता है।
इसलिए, उदाहरण के लिए, यदि आप डिफ़ॉल्ट थीम का उपयोग कर रहे हैं, तो आपको अंडर lumaढूंढना चाहिएview.xmlvendor/magento/theme-frontend-luma/etc/view.xml
इस फ़ाइल में, आप <images/>नोड के अंदर नोड देखेंगे <media>।
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<media>
<images module="Magento_Catalog">
<image id="bundled_product_customization_page" type="thumbnail">
<width>140</width>
<height>140</height>
</image>
<image id="cart_cross_sell_products" type="thumbnail">
<width>200</width>
<height>248</height>
</image>
<image id="cart_page_product_thumbnail" type="small_image">
<width>165</width>
<height>165</height>
</image>
........
</images>
</media>
......
</view>
<image/>नोड के तहत छवियों का आयाम यहां बनाए रखा गया है।
idकी विशेषता मान <image/>नोड codebase में संदर्भित है।
उदाहरण के लिए:
<image id="related_products_list" type="small_image">
<width>152</width>
<height>190</height>
</image>
आईडी मान का उपयोग दृश्य फ़ाइल में किया जाता है vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml
case 'related':
/** @var \Magento\Catalog\Block\Product\ProductList\Related $block */
if ($exist = $block->getItems()->getSize()) {
$type = 'related';
$class = $type;
$image = 'related_products_list';
$title = __('Related Products');
$items = $block->getItems();
$limit = 0;
$shuffle = 0;
$canItemsAddToCart = $block->canItemsAddToCart();
$showWishlist = true;
$showCompare = true;
$showCart = false;
$templateType = null;
$description = false;
}
break;
यहाँ $imageछवि आकार के मूल्य को संदर्भित करता है:
<?php echo $block->getImage($_item, $image)->toHtml(); ?>
यदि विषय में ए नहीं है view.xml, तो यह एक फालबैक थीम (मूल विषय) का उपयोग कर सकता है जिसमें view.xmlफ़ाइल है।
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Magento Luma</title>
<parent>Magento/blank</parent>
.....
</theme>
यहाँ Magento/blankमूल विषय है।
view.xmlफ़ाइल के मूल्यों को बदलने / अधिलेखित करने के मामले में आपको पूरी view.xmlफ़ाइल को अपने कस्टम विषय में पूरी तरह से कॉपी करने और मूल्यों को बदलने की आवश्यकता है।
view.xmlनोड वैल्यू फ़ॉलबैक सिस्टम नहीं है, इसका मतलब है कि यदि नोड का कोई मूल्य आपके पास कस्टम थीम में मौजूद नहीं है, तो view.xml यह अपने मूल विषय के view.xml मान पर नहीं गिरेगा, इसीलिए संपूर्ण फ़ाइल की प्रतिलिपि बनाने की आवश्यकता है।
एक बार मूल्यों में परिवर्तन हो जाने के बाद, आपको दौड़ना होगा
php bin/magento catalog:images:resize
यह नए छवि आकारों को पुन: उत्पन्न करेगा।