开发者

TYPO3 TMENU each special.value wrap

开发者 https://www.devze.com 2023-03-25 18:42 出处:网络
I dont come forth. I want to wrap each given PID in its own unique wrap. Here my code: menutab.list = HMENU

I dont come forth. I want to wrap each given PID in its own unique wrap.

Here my code:

menutab.list = HMENU
menutab.list.special = directory
menutab.list.special.value = 7,8,9,10,11,12,13
menutab.list.1 = TMENU
menutab.list.1.wrap = <div>|</div>开发者_StackOverflow;
...

So thats working fine. I get every submenu of given PIDs but now i'm searching for something like that:

menutab.list.special.value.wrap = <div id="current PID!"> | </div>

I hope someone understand my issue. Big thanks!!


It depends which field you would like to display, but basically any field from the page record can be displayed into the output.

menutab.list = HMENU
menutab.list {
    special = directory
    special.value = 7,8,9,10,11,12,13
    1 = TMENU
    1 {
        # stdWrap2 wraps the whole item, including the link
        NO.stdWrap2.dataWrap = <div id="p{field:uid}">|</div>
    }
}

This will give the following output:

<div id="p26"><a href="test-0/">Test 0</a></div>
<div id="p27"><a href="test-1/">Test 1</a></div>
<div id="p30"><a href="test-2/">Test 2</a></div>
<div id="p31"><a href="test-3/">Test 3</a></div>
<div id="p35"><a href="test-4/">Test 4</a></div>
<div id="p36"><a href="test-5/">Test 5</a></div>
<div id="p37"><a href="test-6/">Test 6</a></div>

For more options, please take a look at the TSref and the stdWrap functions.

TSref http://typo3.org/documentation/document-library/references/doc_core_tsref/4.4.0/view/toc/0/

stdWrap http://typo3.org/documentation/document-library/references/doc_core_tsref/4.4.0/view/1/5/#id2618234


I think the easiest is to do something like that, not sure of the syntax... :

menutab.list.1 = HMENU
menutab.list.1 {
  special = directory
  special.value = 7
  1 = TMENU
  1.wrap = <div id="7"> | </div>
}
menutab.list.2 < menutab.list.1
menutab.list.2.special.value = 8
menutab.list.2.1.wrap = <div id="8"> | </div>
...

Not the best solution, but can work

0

精彩评论

暂无评论...
验证码 换一张
取 消