I have a HTML template which I made a typo3 template of, using automaketemplate. In this HTML, I have a setup of divs like this
<div class="bigPostItWrap">1
<div class="postit">2
<div class="postit_tesa">3</div>
<div class="postItWrap">4
<ul class="menusmall">5
<li>* Team</li>6
<li>* something else</li>
<li>* Third point</li>
</ul>
</div>
</div>
</div>
The UL should contain the secondary navigation, only displayed if a certain primary navigation object is selected. As it is positioned somewhere else on the screen, I made it an independent menu like this
postitMenu = HMENU
postitMenu {
# show the submenue relative to this entry level (?)
entryLevel = 1
# the first level of the menu is a text menu
1 = TMENU
# wrap the whole menu with <ul class="menu"> | </ul>
1.wrap = <ul class="menusmall"> | </ul>
# enable the "no"rmal state
1.NO = 1
# for the normal state, wrap it in li
1.NO.linkWrap = <li>* |</li>
#enable active state
1.ACT = 1
#copy all properties from normal state to active state
1.ACT < .NO
# disable the link for the active menu-point
1.ACT.doNotLinkIt = 1
# wrap the active menulink in li with the class = "active"
1.ACT.allWrap = <li class="active">* |</li>
}
All this works quite well, and the menu only gets displayed on the correct main-menu entry. But the outer div postit contains a background image (you may guess, it’s a postIt), and the postit_tesa shows a strip of sticky tape on top of the postit. Of course, if I don’t show the secondary menue, i also don’t want the postIt and sticky tape to be rendered.
As I am fairly new to typoScript, I have no clue how to achieve that. And I don’t know how to google for that, at least I don’t find any solution. I thought that somehow, if I make the bigPostItWrap around it, I may do something like
if there is an li-element,
render the subpart bigPostItWrap,
else, don't render it
but II can’t get behind the ts-if, or doing something totaly wrong.. Any hint is appreciated. It’s probably ridiculous easy for a pro, but I can’t figure it out, and I’m trying since the day before yesterday -.-
Thanks!
For anyone facing the same problem: I did it with a cheat.. in fact there are two ways.
First, I simply made the outer wrap-div, and assigned it all the other code, and than made the menu build inside this code, if the page ID was the one i wanted. That worked, but wasn’t nice.
The second, probably cleaner approach is via css.. Just set the wrapper’s visibility to hidden. Than make typo3 give your body tag the UID inside the body tag
In your css, make a new selector (assuming page 3 is the one you want the menu to appear)
There you go. The Div will only be visible on the page with the UID 3.