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">
       }
     }
  }
}

正常に機能していますが、1つのレベルでのみ機能します。私はそれをそのようにしたいです:

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 に答える