如何使用选项拆分来控制typo3 菜单属性? [英] How to use option split to control typo3 menu properties?
问题描述
我正在尝试解决 Typ3 中的设计问题实现.本质上,我必须实现从目录生成的选项卡式菜单(只有活动状态是选项卡式),但每个活动(选项卡式)菜单必须具有不同的背景颜色(与选项卡正文框匹配).我最初选择使用 TMENU,但之前介绍了 optionsplit 功能作为实现此目的的一种方法,但我想不出使用 TMENU 实现此目的的方法,因此我目前正在尝试使用 GMENU,但是我没有得到正确的结果.下面是我当前的代码,它给了我空白的空格.我正在尝试复制标签图像并集中图像中的文本,但使用选项拆分来复制文件.
I am trying to resolve a design issue implementation in typo3. Essentially I have to implement a tabbed menu (only the active state is tabbed) that's generated from the directory, but each active (tabbed) menu has to have a different bg colour (matching the tab body box). I opted to use a TMENU initially but was introduced to the optionsplit functionality earlier as a way to achieve this but I can't think of a way achieve this using a TMENU so I am currently experimenting with GMENU, however I am not getting the right results. Below is my current code which gives me blank white spaces. I am experimenting with copying the tab images and centralising the text within the image, but using an optionsplit to copy the files.
temp.navmenu1 = HMENU
special = directory
special.value = {$idMenu}
entryLevel = 1
temp.navmenu1.1 = GMENU
temp.navmenu1.1 {
NO = 1
NO{
NO.Wrap = <ul style="display: inline; "> | </ul>
backColor = #d9d9d9
10 = TEXT
10.text.field = title
10.offset = 0,5
10.align = center
10.niceText = 1
}
ACT < .NO
ACT{
XY = [4.w],[4.h]
4 = IMAGE
4.file = {$hmtab}|*|{$midtab}|*|{$endtab}
}
}
# Temp items aren't rendered, so let's copy it into a TSOP
tv.navmenu1 < temp.navmenu1
page = PAGE
page.typeNum = 0
page.10 = USER
page.10.userFunc = tx_templavoila_pi1->main_page
推荐答案
我认为一个新站点不应该再使用 GMENU
.相反,您应该将 TMENU
与 CSS 结合使用.
I do not think a new site should use GMENU
any more. Instead you should use TMENU
with CSS.
以下是一个可以帮助您入门的基本示例:
Here is a basic example that should get you started:
10 = HMENU
10 {
special = directory
# start with pid 3
special.value = 3
1 = TMENU
1 {
expAll = 1
wrap = <ul>|</ul>
NO = 1
NO {
wrapItemAndSub = <li>|</li>
ATagTitle = abstract // description // title
}
ACT < .NO
ACT.wrapItemAndSub = <li class="active">|</li>
CUR < .NO
CUR.wrapItemAndSub = <li class="current">|</li>
}
2 < .1
3 < .1
4 < .1
4.wrap = <ul class="level-4">|</li>
}
当然,您现在可以将 option split
用于 wrapItemAndSub
,如下所示:wrapItemAndSub = <li class="first">|</li>|*|<li class="normal">|</li>|*|<li class="last">|</li>
Of course you can now use option split
for wrapItemAndSub
like so: wrapItemAndSub = <li class="first">|</li> |*| <li class="normal">|</li> |*| <li class="last">|</li>
其余的只是普通的 CSS.
The rest in then just normal CSS.
这篇关于如何使用选项拆分来控制typo3 菜单属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!