html Miva - 显示分类列表的字母索引

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html Miva - 显示分类列表的字母索引相关的知识,希望对你有一定的参考价值。

<mvt:comment><!-- Load a Category's Sub Categories --></mvt:comment>
	<mvt:assign name="g.Category_Code" value="'Brands'" />
	<mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( g.Category_Code, l.settings:category )" />
	<mvt:do name="l.result" file="g.Module_Library_DB" value="CategoryList_Load_Parent( l.settings:category:id, l.settings:category:sub_categories )" />

<mvt:if expr="miva_array_elements(l.settings:category:sub_categories)">

	<mvt:comment><!-- Create Helper Variables for Sorting & Display --></mvt:comment>
		<mvt:foreach iterator="sub_category" array="category:sub_categories">
			<mvt:assign name="l.settings:sub_category:first_letter" value="toupper( substring( l.settings:sub_category:name, 0, 1 ) )" />
			<mvt:assign name="l.settings:sub_category:uppercase_name" value="toupper( l.settings:sub_category:name )" />
		</mvt:foreach>
		<mvt:do file="g.Module_Library_Utilities" name="l.null" value="QuickSortArray(l.settings:category:sub_categories, ':uppercase_name', 1)" />

	<mvt:comment><!-- Display A-Z Menu/Navigation --></mvt:comment>
		<nav>
			<mvt:foreach iterator="sub_category" array="category:sub_categories">
				<mvt:if expr="l.settings:sub_category:first_letter NE g.last_letter">
					<mvt:assign name="g.last_letter" value="l.settings:sub_category:first_letter" />
					<mvt:assign name="g.counter" value="g.counter + 1" />
					<mvt:if expr="g.counter GT 1">&nbsp;|&nbsp;</mvt:if>
					<a href="/&mvt:page:code;.html#&mvt:sub_category:first_letter;">
						<mvt:if expr="isdigit(l.settings:sub_category:first_letter)">
							#
						<mvt:else>
							&mvt:sub_category:first_letter;
						</mvt:if>
					</a>
				</mvt:if>
			</mvt:foreach>
		</nav>

	<mvt:comment><!-- Display List of Sub Categories Seperated by their First-Letter  --></mvt:comment>
		<hr>
		<mvt:foreach iterator="sub_category" array="category:sub_categories">
			<mvt:if expr="l.settings:sub_category:first_letter NE g.last_letter">
				<a href="/&mvt:page:code;.html#&mvt:sub_category:first_letter;" name="&mvt:sub_category:first_letter;" class="h2 column whole">
					<mvt:if expr="isdigit(l.settings:sub_category:first_letter)">
						#
					<mvt:else>
						&mvt:sub_category:first_letter;
					</mvt:if>
				</a>
				<mvt:assign name="g.last_letter" value="l.settings:sub_category:first_letter" />
			</mvt:if>
			<div class="column one-third"><a href="/category/&mvt:sub_category:code;.html">&mvt:sub_category:name;</a></div>
		</mvt:foreach>

</mvt:if>

以上是关于html Miva - 显示分类列表的字母索引的主要内容,如果未能解决你的问题,请参考以下文章

html Miva Merchant - 查找PageFinder的分类页面名称

做个简单的Android列表字母索引控件

xml Miva - 动态唯一字母数字代码

颤振列表视图字母索引

xml Miva - JSON中的令牌列表

xml Miva - URI的类别级联列表