Velocity多重if else判断

本文介绍了一个包含行政区、商圈、标志物及品牌等信息的布局展示模板。通过此模板可以了解到如何根据不同需求展示各类地点信息,并对品牌进行特殊处理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<div id="contentAreaDiv" class="fenlei_bg" style="overflow: hidden;">
		<!----------------------行政区DIV----------------------------------->
		<div id="contentMask" class="stayInAreaDiv brightblue18 size16" style="overflow: hidden;height: 385px;">
            <div id="districtAreaDiv">
            	<ul>
				#foreach($!district in $!districts)
					#if($!{district.length()} > 9)
                    	<li style="line-height:24px;">$!{district}</li>
					#else
                    	<li>$!{district}</li>
					#end
					#if($!velocityCount % 2 == 0)
						</ul>
						<ul>
					#end
				#end
                </ul>
            </div>
        </div>
		
		<!----------------------商圈DIV----------------------------------->
		<div id="contentMask2" class="stayInAreaDiv brightblue18 size16" style="overflow: hidden;height: 385px;display:none;">
            <div id="commericalLocationAreaDiv">
            	<ul>
				#foreach($!commericalLocation in $!commericalLocations)
					#if($!{commericalLocation.length()} > 9)
                    	<li style="line-height:24px;">$!{commericalLocation}</li>
					#else
                    	<li>$!{commericalLocation}</li>
					#end
					#if($!velocityCount % 2 == 0)
						</ul>
						<ul>
					#end
				#end
                </ul>
            </div>
        </div>
			
		<!----------------------标志物DIV----------------------------------->
		<div id="contentMask3" class="stayInAreaDiv brightblue18 size16" style="overflow: hidden;height: 385px;display:none;">
            <div id="landmarkLocationAreaDiv">
            	<ul>
				#foreach($!landmarkLocation in $!landmarkLocations)
					#if($!{landmarkLocation.length()} > 9)
                    	<li style="line-height:24px;">$!{landmarkLocation}</li>
					#else
                    	<li>$!{landmarkLocation}</li>
					#end
					#if($!velocityCount % 2 == 0)
						</ul>
						<ul>
					#end
				#end
                </ul>
            </div>
        </div>
			
		<!----------------------品牌DIV----------------------------------->
		<div id="contentMask4" class="stayInAreaDiv brightblue18 size16" style="overflow: hidden;height: 385px;display:none;">
            <div id="brandAreaDiv">
            	<ul>
				#set($brandIndex=1)
				#foreach($!brand in $!brandList)
					#if($!{brand.name} != "")
    					#if($!{brand.name.length()} > 9)
                        	<li brandId="$!{brand.brandId}" style="line-height:24px;">$!{brand.name}</li>
    					#else
                        	<li brandId="$!{brand.brandId}">$!{brand.name}</li>
    					#end
    					#if($!brandIndex % 2 == 0)
    						</ul>
    						<ul>
						#end
						#set($brandIndex=$brandIndex+1)
					#end
				#end
                </ul>
			</div>
        </div>
	</div>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值