0

我里面有 HMENU 和 TMENU。对于 TMENU.NO.after 属性,我需要根据当前页面 uid 动态分配 cObject 吗?

代码:

#Privatni podmeni
lib.meni= HMENU
lib.meni.special = list
lib.meni.special.value = 5395, 5396, 5397, 5398
lib.meni.wrap = <ul id="menu" style="display:none;">|</ul>
lib.meni.1 = TMENU

    lib.meni.1{
      expAll = 1
      NO {

       allWrap = <li>|</li>
       ATagParams.insertData = 1
       ATagParams = class="drop _{field:uid}"
       after.cObject < temp.meni5
      }
    }

我需要这个伪代码:

IF field:uid = 5240
   after.cObject < temp.meni5
IF field:uid = 5241
   after.cObject < temp.meni6
IF field:uid = 5342
   after.cObject < temp.meni7

我怎样才能做到这一点?

4

2 回答 2

1

我能够通过在 TS 中使用 CASE 对象来完成这项工作。这是示例代码:

temp.meni0= HMENU
temp.meni0.special = list
temp.meni0.special.value = 5417, 5418, 5419, 5420, 5421
temp.meni0.wrap = <div class="dropdown_5columns"><div class="col_1"><ul>|</ul></div></div>
temp.meni0.1 = TMENU

temp.meni0.1{
  expAll = 1
  NO {
   allWrap = <li>|</li>
   #ATagParams.insertData = 1
   #ATagParams = class="drop"

  }
}


temp.meni6= HMENU
temp.meni6 < temp.meni0
temp.meni6.special.value = 5431, 5432, 5433, 5434, 5435
temp.meni6.wrap = <div class="dropdown_5columns m-144"><div class="col_1"><ul>|</ul></div></div>


temp.meni7= HMENU
temp.meni7 < temp.meni0
temp.meni7.special.value = 5456, 5457, 5458, 5459, 5460
temp.meni7.wrap = <div class="dropdown_5columns m-288"><div class="col_1"><ul>|</ul></div></div>



temp.meni8= HMENU
temp.meni8 < temp.meni0
temp.meni8.special.value = 5466, 5467, 5470, 5471, 5472
temp.meni8.wrap = <div class="dropdown_5columns m-432"><div class="col_1"><ul>|</ul></div></div>

lib.meni= HMENU
lib.meni.special = list
lib.meni.special.value = 5395, 5396, 5397, 5398
lib.meni.wrap = <ul id="menu" style="display:none;">|</ul>
lib.meni.1 = TMENU
lib.meni.1{
  expAll = 1
  NO {

   allWrap = <li>|</li>
   ATagParams.insertData = 1
   ATagParams = class="drop _{field:uid}"

    #after.cObject < temp.meni5
    after.cObject = CASE
    after.cObject {
      key.field = uid
      default = TEXT
      default.value = <span>NIJE OK!</span>

      5395 < temp.meni0
      5396 < temp.meni6
      5397 < temp.meni7
      5398 < temp.meni8
    }

  }
}

有了这个,我可以为 lib.menu 的每个菜单项(页面)插入非常具体的子菜单

于 2013-08-30T06:31:08.477 回答
1

您可以使用 COA cObject 并对其进行部分设置:

lib.meni.1.NO.after.cObject = COA
lib.meni.1.NO.after.cObject {
  10 < temp.meni5
  10.if.equals.field = uid
  10.if.value = 5240

  20 < temp.meni6
  20.if.equals.field = uid
  20.if.value = 5241

  30 < temp.meni7
  30.if.equals.field = uid
  30.if.value = 5342
}

但如果您在temp.meni5temp.meni6temp.meni7中的对象支持 stdWrap,这将起作用。详情请查看TSref

于 2013-08-29T20:02:51.493 回答