[TYPO3] TMENU

Bas van der Togt b.vandertogt at profinit.com
Wed Jan 24 19:02:57 CET 2007


Hi Joey!

Good to hear from you again.
This code is getting a bit confused for me...:-)
It's not working yet.
Can you give me a hint?

This is my whole code:

temp.MenuTopA = COA
temp.MenuTopA {
   10 = HMENU
   10.special = list
   10.special.value = 66
   10.1 = GMENU_LAYERS
   10.1 {
     expAll = 1
     relativeToTriggerItem = 1
     leftOffset = -190
     topOffset = 31
     hideMenuWhenNotOver = 1
     hideMenuTimer = 1
     freezeMouseover = 1
     NO {
     allStdWrap.prepend = COA
     allStdWrap.prepend {
       if {
         value.field = pid
         equals.data = register:parentPage
         negate = 1
       }
       wrap = <td height="31">|</td>
       imgParams = onMouseOver="ShowHide('menubar','hidden')" 
onMouseOut="ShowHide('menubar','visible')"
       10 = IMAGE
       10.file = fileadmin/templates/images/organisatie.gif
       10 {
         file = GIBUILDER
         file {
           XY = 116,31
           backColor = #000000
           5 = TEXT
           5 {
             text.cObject = COA
             text.cObject {
               10 = RECORDS
               10 {
                 source.field = pid
                 tables = pages
                 conf.pages = TEXT
                 conf.pages {
                   field = title
                 }
               }
             }
           }
         }
       }
       20 = LOAD_REGISTER
       20 {
         parentPage.cObject = TEXT
         parentPage.cObject.field = pid
       }
     }
     ACT = 1
     ACT {
       wrap = <td height="31">|</td>
       imgParams = onMouseOver="ShowHide('menubar','hidden')" 
onMouseOut="ShowHide('menubar','visible')"
       XY = 116,31
       5 = IMAGE
       5.file = fileadmin/templates/images/organisatie-o.gif
       5.width = 116
       5.height = 31
     }
     RO = 1
     RO {
       wrap = <td width="116" height="31">|</td>
       imgParams = onMouseOver="ShowHide('menubar','hidden')" 
onMouseOut="ShowHide('menubar','visible')"
       XY = 116,31
       5 = IMAGE
       5.file = fileadmin/templates/images/organisatie-o.gif
       5.width = 116
       5.height = 31
     }
   }
   10.2 = TMENU_LAYERS
   10.2 {
     wrap = <div onmouseover="ShowHide('menubar','hidden')" 
onMouseOut="ShowHideFF('menubar','visible')" 
onMouseLeave="ShowHide('menubar','visible')"><table width="772" 
border="0" cellspacing="0" cellpadding="0"><tr><td id="line" colspan="5" 
width="772" height="7" bgcolor="#BED600"></td></tr><tr><td colspan="5" 
width="772" height="2" bgcolor="#FFFFFF"><img src="clear.gif" 
width="772" height="2"></td></tr><tr><td valign="top" width="183"><table 
border="0" cellspacing="0" cellpadding="0"><tr><td width="183" 
height="21" bgcolor="#BED600" class="menu-act"><table border="0" 
cellspacing="0" cellpadding="3"><tr><td></td><td 
class="menu-act">Organisatie</td></tr></table></td></tr><tr><td 
bgcolor="#FFFFFF" height="1"><img src="clear.gif" 
height="1"></td></tr></table>|</td><td bgcolor="#FFFFFF" width="2"><img 
src="clear.gif" width="2"></td><td valign="top" width="422"><img 
src="fileadmin/templates/images/overlay-o.gif" width="422" 
height="148"></td><td bgcolor="#FFFFFF" width="2"><img src="clear.gif" 
width="2"></td><td valign="top" width="163"><img 
src="fileadmin/templates/images/right-organisatie.jpg" width="163" 
height="146"></td></tr></table></div>
     NO {
       doNotLinkIt = 0
       stdWrap.cObject = COA
       stdWrap.cObject {
         10 = COA
         10 {
           10 = TEXT
           10.data = DB : pages:{field:pid}:title
           10.insertData = 1
           10.typolink.parameter.field = pid
           10.wrap = <table border="0" cellspacing="0" 
cellpadding="0"><tr><td colspan="2" width="183" height="21" 
bgcolor="#B8B8B8"><table border="0" cellspacing="0" 
cellpadding="3"><tr><td></td><td>|</td></tr></table></td></tr><tr><td 
bgcolor="#FFFFFF" height="1"><img src="clear.gif" height="1" 
width="180"></td></tr></table>
           20 = LOAD_REGISTER
           20.firstPos = 0
           if.isTrue.data = register:firstPos
         }
         20 = COA
         20 {
           10 = TEXT
           10.field = title
           10.typolink.parameter.field = uid
           10.wrap = <table border="0" cellspacing="0" 
cellpadding="0"><tr><td colspan="2" width="183" height="21" 
bgcolor="#B8B8B8"><table border="0" cellspacing="0" 
cellpadding="3"><tr><td></td><td>|</td></tr></table></td></tr><tr><td 
bgcolor="#FFFFFF" height="1"><img src="clear.gif" height="1" 
width="180"></td></tr></table>
         }
       }
       wrapItemAndSub = |
     }
   }
}

JoH asenau schreef:
>> Thanks for your reply again Peter!
>> I'm almost there.
>> The problem is that i'm using a GMENU.
>>
>> How can i put the folowing part in a GMENU?
>>
>> --- PART TO PUT IN GMENU ---
>> stdWrap.cObject = COA
>> stdWrap.cObject {
>>    10 = TEXT
>>    10.field = title
>>    20 = LOAD_REGISTER
>>    20.firstPos = 1
>> }
>> --- PART TO PUT IN GMENU ---
>>
>> --- MY GMENU ---
>> NO {
>>       wrap = <td height="31">|</td>
>>       imgParams = onMouseOver="ShowHide('menubar','hidden')"
>> onMouseOut="ShowHide('menubar','visible')"
>>       XY = 116,31
>>       5 = IMAGE
>>       5.file = fileadmin/templates/images/organisatie.gif
>>       5.width = 116
>>       5.height = 31
>> }
>> --- MY GMENU ---
> 
> Interesting question, especially when you take a look at your Subject
> "TMENU" and your code, which seems to be a TMENU_LAYERS using GMENU
> parameters inside its items ;-)
> 
> But lets take a closer look to the GMENU problem. This is what I understood:
> 
> 1. You need the parent page of each submenu
> 2. You want to render the title of this parent page just once before each
> submenu
> 3. You want to do that using a GMENU
> 
> Some useful information:
> 1. The parent page can be identified by the pid field of each item inside
> the submenu.
> 2. GMENU items got a special property called allStdWrap, or if you like it
> better they can use stdWrap together with the allWrap property too.
> 3. You can use a register that is set after the first item of a submenu is
> rendered by the engine and check if the pid is the same or not
> 4. The GIFBUILDER TEXT Element which is used for GMENU items can be filled
> using stdWrap
> 
> So what you need is a GIFBUILDER element created using the title value of a
> page identified by the pid value of a submenuitem that will be rendered only
> before the first item of this submenu which can be recognized by the
> register using the allStdWrap property of the item - easy, isn't it? ;-)
> 
> NO {
>     #########################################
>     ### This will render a COA before the menu item ###
>     ### but only if the pid does not equal the one in    ###
>     ### the register which means we are in another   ###
>     ### submenu now                                                     ###
>     #########################################
>     allStdWrap.prepend = COA
>     allStdWrap.prepend {
>         if {
>             value.field = pid
>             equals.data = register:parentPage
>             negate = 1
>         }
>         wrap = <yourwrap>|</goeshere>
>         10 = IMAGE
>         10 {
>             ###################################
>             ### Same setup as your GMENU items ###
>             ###################################
>             file = GIBUILDER
>             file {
>                 XY = 116,31
>                 backColor = #XXYYZZ
>                 5 = TEXT
>                 5 {
>                     #####################################
>                     ### Here we get the title of the parent page ###
>                     #####################################
>                     text.cObject = COA
>                     text.cObject {
>                         10 = RECORDS
>                         10 {
>                             source.field = pid
>                             tables = pages
>                             conf.pages = TEXT
>                             conf.pages {
>                                 field = title
>                             }
>                         }
>                     }
>                 }
>             }
>         }
>         #######################################
>         ### here we fill the current pid into the register ###
>         ### so the next item wont get the title anymore ###
>         #######################################
>         20 = LOAD_REGISTER
>         20 {
>             parentPage.cObject = TEXT
>             parentPage.cObject.field = pid
>         }
>     }
> }
> 
> Not tested, but should be working.
> 
> Joey
> 


More information about the TYPO3-english mailing list