[TYPO3-english] Custom TS menu - output description/abstract
Bernd Wilke
t3n at pi-phi.de
Wed Feb 3 08:39:11 CET 2016
Am 02.02.2016 um 12:31 schrieb Tom Warwick:
> Bernd,
>
> This works perfectly, thank you very much.
>
> For reference, this is my TS to display the Description field in my
> submenu.
>
> lib.subMenu = HMENU
> lib.subMenu.entryLevel = -1
> lib.subMenu.required = 1
> lib.subMenu.1 = TMENU
> lib.subMenu.1.wrap = <ul>|</ul>
> lib.subMenu.1.noBlur=1
>
> lib.subMenu.1.NO {
> allWrap = <li class="toplevel">|</li>
> ACT = 1
> ACT.wrapItemAndSub = <li class="active">|</li>
> after.cObject = TEXT
> after.cObject {
> field = description // abstract
> wrap = |
> }
> }
oops?
so the TS is shown unindented [1] I think you have some brace errors:
ACT is inside of NO, which will have no result.
for better readability: try to use braces as soon, as there are more
than 1 sublevel:
your code:
lib.subMenu = HMENU
lib.subMenu {
entryLevel = -1
required = 1
1 = TMENU
1 {
wrap = <ul>|</ul>
noBlur=1
NO {
allWrap = <li class="toplevel">|</li>
ACT = 1
ACT.wrapItemAndSub = <li class="active">|</li>
after.cObject = TEXT
after.cObject {
field = description // abstract
wrap = |
}
}
}
}
more correct code:
lib.subMenu = HMENU
lib.subMenu {
entryLevel = -1
required = 1
1 = TMENU
1 {
wrap = <ul>|</ul>
noBlur = 1
// not neccessary but makes copying later on easier:
NO = 1
NO {
wrapItemAndSub = <li class="toplevel">|</li>
after.cObject = TEXT
after.cObject {
field = description // abstract
// what for?
wrap = |
}
ACT < .NO
ACT.wrapItemAndSub = <li class="active">|</li>
}
}
[1] depending on your way of submitting [2] you may have problems to
insert spaces at line beginning or see them.
You may provide indention with dots.
you may look at the html-source to see indentions and html-tags of a posting
[2] this information can be retrieved as forum, mailinglist or
newsgroup. each has it's pros and cons, but all lack of a clean
possibility to display code, especially if the data is transferred
bernd
More information about the TYPO3-english
mailing list