xml Miva - mvt:按图像类型代码加载图像

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml Miva - mvt:按图像类型代码加载图像相关的知识,希望对你有一定的参考价值。

<mvt:comment>
  <!--
    Option #1:
    Load in the Image from the Image Type ID
  -->
</mvt:comment>
<mvt:comment>
	Initialize Loading the Image Type ID Once
</mvt:comment>
<mvt:assign name="l.width" value="150" />
<mvt:assign name="l.height" value="150" />
<mvt:do file="g.Module_Library_DB" name="l.result" value="ImageType_Load_Code( 'main', l.main_imagetype )" />


<mvt:foreach iterator="product" array="products">

	<mvt:comment>
		Load in the Specific Product's Image type
	</mvt:comment>
	<mvt:do file="g.Module_Library_DB" name="l.result" value="ProductImage_Load_Type(l.settings:product:id, l.main_imagetype:id, l.settings:product:imagetypes_data:type)" />
	<mvt:do file="g.Module_Library_DB" name="l.result" value="Image_Load_ID( l.settings:product:imagetypes_data:type:image_id, l.settings:product:imagetypes_data:image )" />
	<mvt:do file="g.Module_Library_DB" name="l.result" value="GeneratedImage_FindOrInsert_Image_Dimensions( l.settings:product:imagetypes_data:image, l.width, l.height, l.settings:product:imagetypes_data:generated )" />

	<mvt:if expr="l.settings:product:imagetypes_data:generated:id">
		<mvt:assign name="l.settings:product:src" value="l.settings:product:imagetypes_data:generated:image" />
	<mvt:else>
		<mvt:assign name="l.settings:product:src" value="g.theme_path $ '/images/img_no_thumb.jpg'" />
	</mvt:if>

</mvt:foreach>




<mvt:comment>
  <!--
    Option #2
    Load All of a Products Images and find the Specific type(s) you want.
  -->
</mvt:comment>
<mvt:do name="l.image_count" file="g.Module_Library_DB" value="ProductImageDataList_Load_Product(l.settings:product:id, l.settings:product:images)" />
<mvt:foreach iterator="image" array="product:images">
	<mvt:if expr="l.settings:image:imagetype:code EQ 'main'">
		<mvt:assign name="l.settings:product:main" value="l.settings:image" />
		<mvt:foreachstop/>
	</mvt:if>
</mvt:foreach>
<mvt:if expr="l.settings:product:main:image:id">
	<mvt:do file="g.Module_Library_DB" name="l.result" value="GeneratedImage_FindOrInsert_Image_Dimensions( l.settings:product:main:image, '255', '255', l.settings:product:main:generated )" />
</mvt:if>

以上是关于xml Miva - mvt:按图像类型代码加载图像的主要内容,如果未能解决你的问题,请参考以下文章

xml Miva - mvt:debug

xml Miva - mvt:调用基本授权标题

xml Miva - mvt:调用SOAP请求

xml Miva - mvt:做Sitemap

xml Miva - mvt:致电SLI搜索

xml Miva - 价格组查询与mvt:做