[TYPO3-english] display the page nav_title above a left menu of subpages, but only if the menu is not empty

Simon Child simon at srchild.com
Fri Sep 7 14:08:52 CEST 2012


I want to display the page nav_title above a left menu of subpages, but if 
there are no subpages I want nothing to be diplayed

My HMENU object is temp.menu1 and if if I just want to display that, then 
this works:

lib.leftmenu < temp.menu1

This adds the page nav_title above it, but doesn't suppress it if there are 
no subpages

temp.lmenu=COA
temp.lmenu.10=TEXT
temp.lmenu.10  {
  value = {page:nav_title}
  insertData = 1
  wrap=<h2>|</h2>
}
temp.lmenu.20 < temp.menu1
temp.lmenu.20.wrap = <ul>|</ul>
lib.leftmenu < temp.lmenu

So I try testing with 'if' to see if temp.menu1 is empty, and have tried 
various things but can't get that to work. Can anyone please give me a 
pointer?

temp.lmenu=COA
temp.lmenu.10=TEXT
temp.lmenu.10  {
  value = {page:nav_title}
  insertData = 1
  wrap=<h2>|</h2>
}
temp.lmenu.wrap = <ul>|</ul>
temp.lmenu.20 < temp.menu1
temp.lmenu.20.wrap = <ul>|</ul>

lib.leftmenu < temp.lmenu
lib.leftmenu.if.isTrue < temp.menu1


Thank you

Simon Child 




More information about the TYPO3-english mailing list