1

我目前正在与打字稿作斗争。我需要存档的是有一个选择框,其中包含某个页面的所有页面(第 1 级、第 2 级)。

因此,假设我有一个名为“产品”的页面,其中包含子项“产品 1”和“产品 2”。“产品 1”和“产品 2”都有自己的其他子项。

现在,我得到了以下脚本:

temp.drop_down_box = COA
temp.drop_down_box {
  10 = HMENU
  10 {
     # Special menu type 'directory': Get subpages of the current page
     special = directory
     # '123' is the uid of the page, for which the subpages shall be listed in the drop down box
     special.value = 35
     # Select box with JavaScript event 'onChange' that enables a jump to the target page, once an entry has been selected in the list
     wrap = <select name="dropdown_navigation" size="1" onChange="document.location.href='index.php?id=' + this.value">|</select>
     1 = TMENU
     1 {
       expAll = 1
       noBlur = 1
       NO {
         # 'value' holds the uid of the page in the list (is later appended to the target URL above)
         stdWrap.dataWrap = <option value="{field:uid}">
         allWrap = |</option>
         # Don't wrap the items in link tags
         doNotLinkIt = 1
       }
       # Inherit the 'allWrap' and 'doNotLinkIt' settings from the NO part
       CUR < copy">.NO
       CUR = 1
       CUR {
       # If we're on the current page, mark this list entry as 'selected'
         stdWrap.dataWrap = <option value="{field:uid}" selected="selected">
       }
     }
  }
}

它工作得很好,但只在一个层面上。我想这样:

Product
- Product 1
  - Item 1
  - Item 2
  - Item 3
  - Item 4
- Product 2
  - Item 1
  - Item 2
  - Item 3

... 等等。

有没有办法做到这一点?

最好的问候, 安德烈亚斯

* 编辑:得到它的工作:

temp.drop_down_box = COA
temp.drop_down_box {
  10 = HMENU
  10 {

    // ... {code from first part of question here} ...
    // additional levels copying 1 level and changing required values

    2 < .1
    2.NO.linkWrap = <option value="{field:uid}">-- |</option>

    3 < .1
    3.NO.linkWrap = <option value="{field:uid}">---- |</option>

  }
}
4

1 回答 1

2

对于每个菜单级别,您需要添加下一个 TMENU 声明:

1 = TMENU
1 {
   ...
}

2 = TMENU
2 {
   ...
}

99 = TMENU
99 {
   ...
}
于 2012-07-10T08:01:55.153 回答