电话
13363039260
有eyoucms的会员在官网问了一个问题,见链接:https://www.eyoucms.com/ask/list_1_0/10535.html,
说白了就是一二级同时在同一页面进行选择的时候,如果全都有二级的话,没问题,但如果有一些分类有二级而有些没有二级,那就会出现有错,我老早就知道并且用我自已的方法处理,只要是判断是否有二级,有就显示二级,没就只显示一级,而不是只有一级的时候,二级位置出现和一级一样的分类,相关例子:https://www.pooban.com/download/lists_436.html,代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | <!-- 分类 begin --> < div class = "between-tree" > < div class = "nav-m" > <!-- 一级分类 --> < ul > < li class = "nav-head text-middle text-main" >分类:</ li > < li class = "nav-child" > < ul > < li >< a href = "{$eyou.field.typeid|gettoptype=###,'typeurl'}" title = "{$eyou.field.typeid|gettoptype=###,'typename'}" class = " {eyou:eq name='$eyou.field.typeid' value='$eyou.field.typeid|gettoptype=###,typeid'}active{/eyou:eq}" >全部</ a ></ li > {eyou:channel type="first" currentstyle="active"} {eyou:eq name='$eyou.field.grade' value='2'} {eyou:type typeid='$eyou.field.typeid' id='field1'} {eyou:eq name='$field1.parent_id' value='$field.id'} {eyou:assign name='$field.currentstyle' value='active' /} {/eyou:eq} {/eyou:type} {/eyou:eq} < li >< a href = "{$field.typeurl}" title = "{$field.typename}" class = "{$field.currentstyle}" >{$field.typename}</ a ></ li > {/eyou:channel} < div class = "clearfix" ></ div > </ ul > </ li > < div class = "clearfix" ></ div > </ ul > <!-- 一级分类 --> <!-- 二级分类可能1 --> {eyou:if condition="($eyou.field.grade == '1'&&$eyou.field.has_children == '1')"} < ul > < li class = "nav-head text-middle text-main" >二级:</ li > < li class = "nav-child" > < ul > < li >< a href = "{$eyou.field.ptypeurl}" title = "{$eyou.field.ptypename}" {eyou:eq name = '$eyou.field.ptypeid' value = '$eyou.field.ptypeid|gettoptype=###,typeid' } class = "active" {/eyou:eq}>全部</ a ></ li > {eyou:channel type='sonself' currentstyle="active"} < li > < a href = "{$field.typeurl}" title = "{$field.typename}" class = "{$field.currentstyle}" >{$field.typename}</ a > </ li > {/eyou:channel} < div class = "clearfix" ></ div > </ ul > </ li > < div class = "clearfix" ></ div > </ ul > {/eyou:if} <!-- 二级分类可能1 --> <!-- 二级分类可能2--> {eyou:if condition="($eyou.field.grade == '2'&&$eyou.field.has_children == '0')"} < ul > < li class = "nav-head text-middle text-main" >二级:</ li > < li class = "nav-child" > < ul > < li >< a href = "{$eyou.field.ptypeurl}" title = "{$eyou.field.ptypename}" {eyou:eq name = '$eyou.field.ptypeid' value = '$eyou.field.ptypeid|gettoptype=###,typeid' } class = "active" {/eyou:eq}>全部</ a ></ li > {eyou:channel type='sonself' currentstyle="active"} < li > < a href = "{$field.typeurl}" title = "{$field.typename}" class = "{$field.currentstyle}" >{$field.typename}</ a > </ li > {/eyou:channel} < div class = "clearfix" ></ div > </ ul > </ li > < div class = "clearfix" ></ div > </ ul > {/eyou:if} <!-- 二级分类可能2--> </ div > </ div > <!-- 分类 end --> |
当然,也可以通过多搞一个分类模板,就是比较麻烦。