xml Miva - URI的类别级联列表

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml Miva - URI的类别级联列表相关的知识,希望对你有一定的参考价值。

<mvt:do file="g.Module_Root $ '/modules/component/cmp-mv-prodctgy-meta.mvc'" name="l.success" value="CategoryCascadeList_Load_Category( l.settings:category, l.settings:category:list )" /><mvt:foreach iterator="item" array="category:list"><mvt:assign name="l.settings:category:uri" value="l.settings:category:uri $ '/' $ l.settings:item:code" /></mvt:foreach><mvt:assign name="l.settings:category:uri" value="l.settings:category:uri $ '.html'" />&mvt:category:uri;
<!--
  -----------------------------------------------------------------
  Generates URIs that use a categories parent categories in the URI
  -----------------------------------------------------------------
  
  Given a store with a category/sub-category structure like this:
  
  - appliances
    - kitchen
      - refrigerators
      
  It will generate Miva XML Provisioning for a category URI like this:
  
  /appliances/kitchen/refrigerators.html
  
-->
<mvt:do file="g.Module_Library_DB" name="l.success" value="CategoryList_Load_All( l.settings:categories )" />

<mvt:foreach iterator="category" array="categories">
	<mvt:do file="g.Module_Root $ '/modules/component/cmp-mv-prodctgy-meta.mvc'" name="l.success" value="CategoryCascadeList_Load_Category( l.settings:category, l.settings:category:list )" />
	
	<mvt:comment>
	  <!--
	    When there is only one item in the `category:list`,
	    these URIs have already been generated by Miva's URI management template: `/&mvts:category:code;.html`
	  -->
	</mvt:comment>
	<mvt:if expr="miva_array_elements( l.settings:category:list ) EQ 1">
		<mvt:foreachcontinue/>
	</mvt:if>
	
	<mvt:foreach iterator="item" array="category:list">
		<mvt:assign name="l.settings:category:uri" value="l.settings:category:uri $ '/' $ l.settings:item:code" />
	</mvt:foreach>
	<mvt:assign name="l.settings:category:uri" value="l.settings:category:uri $ '.html'" />
	
	<mvt:assign name="l.settings:xml" value="l.settings:xml $ '<uri_add category_code=\"' $ l.settings:category:code $ '\" status=\"200\" uri=\"' $ l.settings:category:uri $ '\" />'" />
</mvt:foreach>

&mvte:xml;
<!-- Take this output, and import it using, "Import Data and Settings in XML Provisioning Format" -->

以上是关于xml Miva - URI的类别级联列表的主要内容,如果未能解决你的问题,请参考以下文章

xml Miva - URI添加,删除和删除所有XML配置

xml Miva - 使用Sebenza模板模块进行URI管理

xml Miva - 在URI模板中加载自定义字段

xml MIVA合并类别,products.xml

xml Miva - 使用产品主图像的CTGY子类别图像

xml Miva - JSON中的令牌列表