Microdata for news item in breadcrumb navigation - typo3

With the following code I build my breadcrumb navigation with the according microdata for a BreadcrumbList:
lib.breadcrumb = COA
lib.breadcrumb {
wrap = <ol class="list-inline" role="menubar" itemscope itemtype="http://schema.org/BreadcrumbList">|</ol>
10 = HMENU
10 {
special = rootline
special.range = 0|-1
1 = TMENU
1 {
wrap = |
NO {
allWrap = <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">|</li>
stdWrap.htmlSpecialChars = 1
linkWrap = |
doNotLinkIt = 0 |*||*| 1
ATagBeforeWrap = 1
ATagTitle.field = nav_title // title
ATagParams = role="menuitem" itemprop="item"
stdWrap.wrap = <span itemprop="name">|</span>
after.cObject = COA
after.cObject {
5 = TEXT
5.dataWrap = <meta itemprop="position" content="{register:count_MENUOBJ}|" />
}
}
}
}
}
This works perfectliy fine, but I have no idea, how to add the item <meta itemprop="position" content="{register:count_MENUOBJ}|" /> for a newsrecord:
This is how it looks at the moment:
// add news title to breadcrumb if needed
[globalVar = GP:tx_news_pi1|news > 0]
lib.breadcrumb.10.1.NO.doNotLinkIt = 0
lib.breadcrumb.20 = COA
lib.breadcrumb.20 {
wrap = <li class="article" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">|</li>
after.cObject = COA
after.cObject {
5 = TEXT
5.dataWrap = <meta itemprop="position" content="{register:count_MENUOBJ}|" />
}
10 = RECORDS
10 {
dontCheckPid = 1
tables = tx_news_domain_model_news
source.data = GP:tx_news_pi1|news
source.intval = 1
conf.tx_news_domain_model_news = TEXT
conf.tx_news_domain_model_news.field = title
conf.tx_news_domain_model_news.htmlSpecialChars = 1
wrap = <span itemprop="name">|</span>
}
}
[end]
Obviously the {register:count_MENUOBJ} is not available for the news item.
How can I get the last value of {register:count_MENUOBJ} from the menu object and increase it by one for the news item?

I had the same problem, my solution is to work with the CUR element:
lib.breadcrumb = COA
lib.breadcrumb {
stdWrap.wrap = <ol class="list list--inline" itemscope itemtype="http://schema.org/BreadcrumbList">|</ol>
10 = HMENU
10{
special = rootline
special.range = 0|-1
includeNotInMenu = 1
1 = TMENU
1{
noBlur = 1
expAll = 1
NO = 1
NO.wrapItemAndSub = <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">|</li>
NO.stdWrap.htmlSpecialChars = 1
NO.stdWrap.htmlSpecialChars.preserveEntities = 1
#NO.doNotLinkIt = |*| 0 |*| 1
NO {
ATagParams = itemprop="item"
stdWrap.wrap = <span itemprop="name">|</span>
after = <meta itemprop="position" content="{register:count_MENUOBJ}" />
after.insertData = 1
}
}
}
}
[(request.getQueryParams()['tx_news_pi1'])['news'] > 0]
lib.breadcrumb {
10 {
1 {
CUR < .NO
CUR {
doNotLinkIt = 1
stdWrap2 {
typolink {
# Detail page
ATagParams = itemprop="item"
parameter.field = uid
additionalParams.data = GP:tx_news_pi1|news
# If there is a plugin with mode "Detail", the controller and action parameter might be skipped
additionalParams.wrap = &tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]=|
useCacheHash = 1
stdWrap = <span itemprop="name">|</span>
}
}
stdWrap.cObject = RECORDS
stdWrap.cObject {
if.isTrue.data = GP:tx_news_pi1|news
dontCheckPid = 1
tables = tx_news_domain_model_news
source.data = GP:tx_news_pi1|news
source.intval = 1
conf.tx_news_domain_model_news = TEXT
conf.tx_news_domain_model_news {
field = title
}
}
}
}
}
}
[global]

Related

TYPO3 - FilesProcessor - print out image tag in FLUID Template

I want to read out the "images" from a content element with FilesProcessor.
But I can't get the files array filled
In the TYPO3-Backend I add an image to the content element:
My TypoScript:
// Part 1: Fluid template section
page.10 = FLUIDTEMPLATE
page.10 {
templateName = TEXT
templateName {
cObject = TEXT
cObject {
data = pagelayout
required = 1
case = ucfirst
split {
token = pagets__
cObjNum = 1
1.current = 1
}
}
ifEmpty = Default
}
templateRootPaths {
0 = EXT:site_package/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
partialRootPaths {
0 = EXT:site_package/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
layoutRootPaths {
0 = EXT:site_package/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
}
page.10 {
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
levels = 1
includeSpacer = 1
as = mainnavigation
}
20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
20 {
table = tt_content
orderBy = sorting
where = colPos = 1
as = jumbotronContent
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
as = images
reference.fieldName = image
}
}
}
}
}
My Jumbotron-Content-Element HTML-Template:
<f:debug title="all" inline="true">{_all}</f:debug>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<section class="hero">
<div class="d-flex container">
<div class="d-flex flex-column justify-content-center">
<f:for each="{jumbotronContent}" as="Jumbotron" iteration="iter">
<h1>{Jumbotron.data.header}</h1>
<h2>{Jumbotron.data.subheader}</h2>
<button>SABER MAIS AGORA</button>
</f:for>
</div>
<div class="hero-image d-flex justify-content-center">
<f:for each="{images}" as="image">
<f:debug>{image}</f:debug>
<f:image image="{image.originalFile}"/>
</f:for>
</div>
</div>
</section>
</html>
But the f:debug-Viewhelper tells me
images => array(empty)
How can I fill the image array? I probably put the FilesProcessor code on the wrong place.
Can someone plase assist.
Thank you
Your configuration has a typo: it should be references (plural):references.fieldName
page.10.dataProcessing.20.dataProcessing.10.references.fieldName = image

Howto set a CSS class in a TYPOscript menu depending on content from tt_content

I am building a navigation menu with TYPOscript which is extended with content from the tt_content table.
Now I am trying to change the CSS-class of the parent element (.drop-wrapp), if there is content from tt_content and put the page title from parent page in second level (here: "PAGE TITLE FIRST LEVEL").
This is my TYPOscript so far:
lib.navMain = COA
lib.navMain {
10 = TEXT
10.wrap = |
10.value = {$const.lang.navi.skip}
10.typolink {
parameter.data = page:uid
parameter.dataWrap = |#skipMainNavi
ATagParams = class="sr-only sr-only-focusable"
}
20 = HMENU
20 {
special = directory
special.value = {$const.pid.home}
entryLevel = 0
1 = TMENU
1 {
wrap = <ul class="nav navbar-nav" role="menubar">|</ul>
expAll = 1
target = _top
noBlur = 1
wrap= <ul class="nav navbar-nav" role="menubar">|</ul>
NO {
wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li class="last">|</li>
linkWrap = |
ATagParams = role="menuitem"
title = field:title
ATagTitle.field = subtitle // title
}
ACT < .NO
ACT = 1
ACT {
wrapItemAndSub = <li class="first active">|</li> |*| <li class="active">|</li> |*| <li class="last active">|</li>
ATagParams = class="mainmenuActive"
# linkWrap = <strong>|</strong>
}
}
2 < .1
2 {
wrap = <div class="drop-wrapp CLASS_IF_CONTENT_FROM_TT_CONTEN"><div class="drop-wrapp-inner">|</div></div>
20 = HMENU
20 {
special = directory
special.value.data = field:pid
1 = TMENU
1 {
expAll = 1
NO {
wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li class="last">|</li>
linkWrap = |
ATagParams = role="menuitem"
title = field:title
ATagTitle.field = subtitle // title
}
ACT < .NO
ACT = 1
ACT {
wrapItemAndSub = <li class="first active">|</li> |*| <li class="active">|</li> |*| <li class="last active">|</li>
ATagParams = class="mainmenuActive"
# linkWrap = <strong>|</strong>
}
}
}
stdWrap.append = CONTENT
stdWrap.append {
table = tt_content
select {
pidInList.field = pid
where = colPos=1 AND deleted=0 AND hidden=0
orderBy = sorting
languageField = sys_language_uid
max = 2
}
stdWrap {
wrap = <div class="teaser-block"><div class="teaser-block-inner"><strong class="title">PAGE TITLE FIRST LEVEL</strong><div class="teaser-text">|</div></div></div>
// wrap only if there is content!
required = 1
}
}
stdWrap.innerWrap = <div class="drop-block"><ul class="list-unstyled nav-list" role="menubar">|</ul></div>
}
}
30 = TEXT
30.wrap = <a id="skipMainNavi" class="sr-only">|</a>
30.value =
30.htmlSpecialChars = 0
}
UPDATE:
This is very breafly what I want to achieve:
<nav>
<ul>
<li>Level 0.0</li>
<li>
Level 0.1
<div class="drop-wrapp wide"><!-- only add class ".wide" if there is content from tt_content in "div.teaser-block" -->
<div class="drop-wrapp-inner">
<div class="drop-block">
<ul>
<li>Level 1.0</li>
<li>Level 1.1</li>
<li>Level 1.2</li>
</ul>
</div>
<div class="teaser-block">
Here is content from tt_content
</div>
</div>
</div>
</li>
<li>Level 0.2</li>
</ul>
</nav>
I am sure, there are better solutions, but the following example works now for me. My trick are the two elements after the "30 = CONTENT" element. If there is content from tt_content I open a "div"-element and close if afterwards. Maybe there is a better way to do this with a special wrap?
lib.navMain = COA
lib.navMain {
10 = TEXT
10.wrap = |
10.value = {$const.lang.navi.skip}
10.typolink {
parameter.data = page:uid
parameter.dataWrap = |#skipMainNavi
ATagParams = class="sr-only sr-only-focusable"
}
20 = HMENU
20 {
special = directory
special.value = {$const.pid.home}
entryLevel = 0
1 = TMENU
1 {
expAll = 1
target = _top
noBlur = 1
wrap = <ul class="nav navbar-nav" role="menubar">|</ul>
NO {
wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li class="last">|</li>
linkWrap = |
ATagParams = role="menuitem"
title = field:title
ATagTitle.field = subtitle // title
}
ACT < .NO
ACT = 1
ACT {
wrapItemAndSub = <li class="first active">|</li> |*| <li class="active">|</li> |*| <li class="last active">|</li>
ATagParams = class="mainmenuActive"
# linkWrap = <strong>|</strong>
}
}
2 < .1
2 {
wrap = <div class="drop-wrapp"><div class="drop-wrapp-inner">|</div></div>
stdWrap.cObject = COA
stdWrap.cObject {
20 = HMENU
20 {
special = directory
special.value.data = field:pid
1 = TMENU
1 {
expAll = 1
wrap = <div class="drop-block"><ul class="list-unstyled nav-list" role="menubar">|</ul></div>
NO {
wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li class="last">|</li>
linkWrap = |
ATagParams = role="menuitem"
title = field:title
ATagTitle.field = subtitle // title
}
ACT < .NO
ACT = 1
ACT {
wrapItemAndSub = <li class="first active">|</li> |*| <li class="active">|</li> |*| <li class="last active">|</li>
ATagParams = class="mainmenuActive"
# linkWrap = <strong>|</strong>
}
}
}
30 = CONTENT
30 {
table = tt_content
select {
pidInList.field = pid
where = colPos=99 AND deleted=0 AND hidden=0
orderBy = sorting
languageField = sys_language_uid
max = 2
}
stdWrap {
wrap = |
// wrap only if there is content!
required = 1
}
}
1 = COA
1 {
if.isTrue.numRows < lib.navMain.20.2.stdWrap.cObject.30
10 = TEXT
10.value = <div class="wide">
}
100 = COA
100 {
if.isTrue.numRows < lib.navMain.20.2.stdWrap.cObject.30
10 = TEXT
10.value = </div><!-- /.wide -->
}
}
}
}
30 = TEXT
30.wrap = <a id="skipMainNavi" class="sr-only">|</a>
30.value =
30.htmlSpecialChars = 0
}

Dropdown menu not working Typo3

my dropdown menu does not work as I planned it to.
Here
you can find the menu I'm working on.
When I press 'Produkte' there should open a dropdown menu with 2 submenu points.
If I get this dropdown, and these menu points again have submenus, there should be another dropdown. Is this possible ? And if yes, how, I'm quite new to TypoScript..
EDIT: okay i just saw the .. , how can i link this relative, so if I add a new submenu point it will automatically show in there?
Maybe using data-target="dropdown"?
lib.field_topmenu = HMENU
lib.field_topmenu {
1 = TMENU
1 {
wrap = <ul class="nav navbar-nav">|</ul>
expAll = 1
NO = 1
NO {
allWrap = <li>|</li>
ATagTitle.field = title
}
ACT = 1
ACT {
wrapItemAndSub = <li class="active">|</li>
ATagTitle.field = title
}
IFSUB = 1
IFSUB {
before = <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-target="dropdown">
after = <b class="caret"></b></a>
doNotLinkIt = 1
wrapItemAndSub = <li class="dropdown">|</li>
ATagTitle.field = title
ATagParams = class="dropdown-toggle" data-toggle="dropdown"
ATagBeforeWrap = 1
}
ACTIFSUB = 1
ACTIFSUB {
before = <a href="#" class="dropdown-toggle" data-toggle="dropdown">
after = <b class="caret"></b></a>
# doNotLinkIt = 1
wrapItemAndSub = <li class="dropdown active">|</li>
ATagTitle.field = title
ATagBeforeWrap = 1
}
}
2 = TMENU
2 {
expAll = 1
wrap = <ul class="dropdown-menu">|</ul>
ACT = 1
ACT {
wrapItemAndSub = <li class="active">|</li>
ATagTitle.field = title
}
ACTIFSUB = 1
ACTIFSUB {
wrapItemAndSub = |
before = <li class="divider"></li><li class="nav-header">
after = </li>
# doNotLinkIt = 1
ATagTitle.field = title
}
NO {
allWrap = <li>|</li>
ATagTitle.field = title
}
IFSUB = 1
IFSUB {
before = <li class="divider"></li><li class="nav-header">
after = </li>
doNotLinkIt = 1
ATagTitle.field = title
}
SPC = 1
SPC {
allWrap = <li class="divider"></li><li class="nav-header">|</li>
}
}
3 = TMENU
3 {
NO {
allWrap = <li>|</li>
ATagTitle.field = title
}
ACT = 1
ACT {
wrapItemAndSub = <li class="active">|</li>
ATagTitle.field = title
}
}
Solved the problem.
lib.field_topmenu = HMENU
lib.field_topmenu {
entryLevel = 0
1 = TMENU
1 {
expAll = 1
wrap = <ul class="nav navbar-nav"> | </ul>
noBlur = 1
NO = 1
NO {
wrapItemAndSub = <li>|</li>
stdWrap.htmlSpecialChars = 1
ATagTitle.field = title
}
ACT <.NO
ACT {
wrapItemAndSub = <li class="active">|</li>
}
IFSUB <.NO
IFSUB {
allWrap = <!!==:>|
wrapItemAndSub = <li class="dropdown">|</li>
ATagBeforeWrap = 1
linkWrap = | <b class="caret"></b>
ATagParams = class="dropdown-toggle" data-toggle="dropdown"
}
ACTIFSUB < .IFSUB
ACTIFSUB {
allWrap = <!!==:>|
}
}
2 = TMENU
2 {
wrap = <ul class="dropdown-menu" role="menu" aria-labelledby="dLable">|</ul>
expAll = 1
NO = 1
NO {
allWrap = <li>|</li>
stdWrap.htmlSpecialChars = 1
}
ACT < .NO
ACT.ATagParams = class="active"
ACT.allWrap = <li class="active">|</li>
IFSUB < .NO
IFSUB.wrapItemAndSub = <li class="dropdown">|</li>
IFSUB.ATagParams = class="dropdown-toggle" data-toggle="dropdown"
IFSUB.linkWrap = | <b class="caret"></b>
IFSUB.ATagBeforeWrap = 1
ACTIFSUB < .IFSUB
ACTIFSUB {
allWrap = <!!==:>|
}
3 = TMENU
3 {
wrap = <ul class="dropdown-menu" role="menu" aria-labelledby="dLable">|</ul>
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.htmlSpecialChars = 1
ACT < .NO
ACT.ATagParams = class="active"
ACT.allWrap = <li class="active">|</li>
}
}
}
lib.title_banner = IMAGE
lib.title_banner {
file {
import.data = levelmedia:-1, slide
treatIdAsReference = 1
import.listNum = 0
}
}
You have to use wrapItemAndSub instead of allWrap if you want to have the <li> tags around the whole submenu.
In general you should first create a working HTML markup and then use TypoScript to generate exactly that markup.

TYPO3 Menu: only first level is displayed

I am currently working on a new site with Typo3, Version 7.3.
This site will have a menu that should list all levels no matter of the current page.
I tried with this TypoScript (which I also found on the internet in very similar variants):
MENU = HMENU
MENU.special = directory
MENU.special.value = 5
MENU.1 = TMENU
MENU.1 {
wrap = <ul>|</ul>
expAll = 1
NO = 1
NO {
wrapItemAndSub = <li>|</li>
}
ACT = 1
ACT {
wrapItemAndSub = <li class="active">|</li>
}
}
MENU.2 < MENU.1
MENU.2.wrap = <ul>|</ul>
Unfortunately this only outputs the first level of the page tree.
Did I miss something?
(The examples I found on the internet mostely related to version 6.x of Typo3) Is there some new command/syntax for menus in version 7.x of Typo3?
Thanks a lot for your help!
hello here is your Top navigation menu typo-script if you want to go with third level menu then it also possible this code is second level menu only
lib.Main_menu = COA
lib.Main_menu {
10 = HMENU
10.special = directory
10.special.value = 2
10 {
wrap =<ul class="nav navbar-nav navbar-right text-uppercase">|</ul>
#entryLevel = 0
1 = TMENU
1 {
expAll = 1
noBlur = 1
# target = _top
NO {
ATagTitle {
field = title
fieldRequired = nav_title
}
ATagBeforeWrap = 1
linkWrap = |
wrapItemAndSub.insertData = 1
wrapItemAndSub = <li class="menu-{field:uid}">|</li> |*| <li class="menu-{field:uid}">|</li>
stdWrap.htmlSpecialChars = 1
# allWrap = <div class="menu_header_no">|</div>
}
ACT < .NO
ACT = 1
ACT {
wrapItemAndSub.insertData = 1
wrapItemAndSub = <li class="active menu-{field:uid}" >|</li>
# ATagParams = class=""
# allWrap = <div class="menu_header_act">|</div>
}
IFSUB < .NO
IFSUB = 1
IFSUB {
stdWrap.htmlSpecialChars = 1
wrapItemAndSub = <li class="dropdown menu-{field:uid}">|</li>
# allWrap = <div class="menu_header_no">|</div>
# ATagParams = class="dropdown-toggle" data-toggle="dropdown"
}
ACTIFSUB < .IFSUB
ACTIFSUB = 1
ACTIFSUB {
stdWrap.htmlSpecialChars = 1
wrapItemAndSub = <li class="active menu-{field:uid} dropdown">|</li>
# allWrap = <div class="menu_header_no">|</div>
# ATagParams = class="dropdown-toggle" data-toggle="dropdown"
# stdWrap.wrap = <b class="caret"></b>
}
}
2 = TMENU
2 {
noBlur = 1
wrap = <div class="hide-caret" data-toggle="dropdown" role="button" aria-expanded="false"><span class="caret"></span></div><ul class="dropdown-menu" role="menu">|</ul>
NO {
ATagTitle {
field = title
fieldRequired = nav_title
}
wrapItemAndSub.insertData = 1
stdWrap.htmlSpecialChars = 1
wrapItemAndSub = <li menu-{field:uid}><span class="sub-name">|</span><div class="menu-img"><img src="typo3conf/ext/fluxtemplate/Resources/Public/img/menu-5.png" class="img-responsive" alt="a" /></div></li>
}
ACT < .NO
ACT = 1
ACT {
wrapItemAndSub = <li class="active menu-{field:uid}"><span class="sub-name">|</span><div class="menu-img"><img src="typo3conf/ext/fluxtemplate/Resources/Public/img/menu-5.png" class="img-responsive" alt="a" /></div></li>
# ATagParams = class=""
# allWrap = <div class="menu_header_act">|</div>
}
}
}
}
Following script will help you to show till third level menu.
lib.MainMenu= HMENU
lib.MainMenu.special = directory
lib.MainMenu.special.value = 1
lib.MainMenu.1 = TMENU
lib.MainMenu.1 {
NO {
wrapItemAndSub = <li >|</li>
ATagTitle.field = 1
# = 1
}
ACT = 1
ACT{
wrapItemAndSub = <li>|</li>
ATagTitle.field = 1
stdWrap.htmlSpecialChars = 1
ATagParams = class="activemenu"
}
IFSUB{
wrapItemAndSub = <li >|</li>
ATagTitle.field = 1
}
}
lib.MainMenu.2 < .lib.MainMenu.1
lib.MainMenu.2{
wrap = <ul>|</ul>
noBlur = 1
expAll = 1
NO {
wrapItemAndSub = <li >|</li>
ATagTitle.field = 1
}
IFSUB{
wrapItemAndSub = <li >|</li>
ATagTitle.field = 1
}
}
lib.MainMenu.3 < .lib.MainMenu.2
lib.MainMenu.3{
wrap = <ul>|</ul>
noBlur = 1
expAll = 1
NO {
wrapItemAndSub = <li>|</li>
ATagTitle.field = 1
}
CUR = 1
CUR{
linkWrap= <li>|</li>
}
CURIFSUB = 1
CURIFSUB{
linkWrap= <li>|</li>
}
ACTIFSUB = 1
ACTIFSUB{
linkWrap= <li>|</li>
}
}
You may change HTML as per your requirement
For more information about TYPO3 stuff you may visit my blog
https://jainishsenjaliya.wordpress.com/
meanwhile I found a solution (which I don't fully understand):
MENU = HMENU
MENU.special = directory
MENU.special.value = 5
MENU.1 = TMENU
MENU {
1 {
wrap = <ul>|</ul>
expAll = 1
NO = 1
NO {
wrapItemAndSub = <li>|</li>
stdWrap.htmlSpecialChars = 1
ATagTitle.field = title
}
ACT <.NO
ACT {
ATagParams = class="active"
}
}
2 < .1
3 < .2
}
So all I changed is putting everything in MENU into a block ( {...} ) instead of using the dot-notation.
To my understanding this should actually not make any difference, right?

Building a Menu with anchor links as second menu level

I am working on a menu, showing the first level as normal links. The second menu level should be build as anchor menu from the content elements. Inspired by this post I build the following ts:
lib.footerMenu = HMENU
lib.footerMenu {
1 = TMENU
1 {
wrap = <ul class="nav">|</ul>
noBlur = 1
NO = 1
NO {
wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li class="last">|</li>
ATagParams = class="first" |*| |*| class="last"
after.cObject = CONTENT
after.cObject {
table = tt_content
select {
pidInList = this
orderBy = sorting
where = colPos=1
languageField = sys_language_uid
}
wrap = <ul>|</ul>
renderObj = TEXT
renderObj {
field = header
dataWrap = <li>|</li>
}
}
}
}
}
producing something like that ('Arnold ipsum.' and 'Who the hell are you.' being CEs of the Homepage):
<ul class="nav">
<li class="first">Homepage
<ul>
<li>Arnold ipsum.</li>
<li>Who the hell are you.</li>
</ul>
</li>
<li>Team
<ul>
<li>Arnold ipsum.</li>
<li>Who the hell are you.</li>
</ul>
</li>
...
</ul>
The problem now is, that this (pidInList = this) always holds the actual page id and so the anchor menu of the actual page is appended to all main menu items.
How to show the right anchor menu below every main menu?
lib.footerMenu = HMENU
lib.footerMenu {
1 = TMENU
1 {
wrap = <ul class="nav">|</ul>
noBlur = 1
NO = 1
NO {
wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li class="last">|</li>
ATagParams = class="first" |*| |*| class="last"
after.cObject = CONTENT
after.cObject {
table = tt_content
select {
pidInList.stdWrap.cObject = CASE
pidInList.stdWrap.cObject {
key.field = doktype
default = TEXT
default.field = uid
4 = TEXT
4.field = shortcut
}
orderBy = sorting
where = colPos=1
languageField = sys_language_uid
selectFields = uid,pid,header
}
wrap = <ul>|</ul>
renderObj = TEXT
renderObj {
field = header
typolink {
parameter.field = pid
section.field = uid
}
wrap = <li>|</li>
}
}
}
}
}
Though, it might not work on old TYPO3 installations because if I remember correctly pidInList didn't used to have stdWrap. It should work on TYPO3 4.5+.