[TYPO3-english] Menu and second level menu in different table rows

Bas v.d. Wiel j.a.m.v.d.wiel at tue.nl
Thu Mar 26 13:25:22 CET 2009


Hi Alex,
You're not doing your customer a favor this way since you're creating 
*extremely* crappy and invalid markup that will most likely never look 
right in any browser. I scrubbed up some of your code as best I could 
from the top of my head and without any testing, but why you're doing 
things like this remains a total mistery to me. The use of unordered 
lists encapsulated per individual item inside table cells is totally 
pointless (and most likely invalid) and it will give search engines and 
the visually challenged hell to interpret your website. The use of <th> 
elements is also semantically incorrect and thus pointless in this case 
so I replaced those with <td>'s.

Whatever way you spin this, the end result will be just plain nasty. I'd 
advise you to first construct a *valid* (see http://validator.w3.org) 
plain HTML version of what you want you're building, test that for 
functionality, style it properly, and only then recreate the thing in 
TypoScript. A final tip: use indentation and accolades in your TS 
syntax. It helps you keep these complex constructs readable and 
maintainable.

I'm due in a meeting in a few minutes, so I'll leave it at this. 
Hopefully this helps a bit..

subparts.menu = HMENU
subparts.menu {
    special = directory
    special.value = 1

    1 = TMENU
    1 {
          wrap = <tr>|</tr>
          expAll = 1
          NO = 1
          NO {
                   allWrap = <td id="m{elementUid}">|</td>
                   subst_elementUid = 1
                   NO.ATagTitle.field = subtitle
          }
          ACT < .NO
          ACT {
                   allWrap = <td id="m{elementUid}" class="h">|</td>
          }
    }
    2 = TMENU
    2 {
          wrap = <table><tr>|</tr></table>
          NO = 1
          NO {
                   allWrap = <td>|</td>
                   ATagTitle.field = subtitle
          }
          ACT < .NO
          ACT {
                   allWrap = <td class="menu-act">|</td>
          }
    }
}


Alexander Agafonov wrote:
> Bas, thanks for advice, but I'm already tried, anyway I need to get the 
> solution for my case
>
>
> Bas v.d. Wiel wrote:
>   
>> That's what customers do.. but then still, why not simply use nested 
>> unordered lists without all the table cruft in between them. The end 
>> result being something like this:
>>
>> <table>
>>  <tr>
>>    <td id="menucontainer">
>>      <ul>
>>        <li class="active">Menu</li>
>>          <ul class="menu_l2">
>>            <li>Item 1</li>
>>            <li>...</li>
>>         </ul>
>>       <li>Inactive item level 1</li>
>>     </ul>
>>   </td>
>>  </tr>
>> </table>
>>
>> That's a whole lot easier to make, doesn't break the way UL's are 
>> supposed to be made, and your customer still has tables.. sort of. ;-)
>>
>> Bas
>>
>> Alexander Agafonov wrote:
>>     
>>> Yes, but my customer want tables. I tried to discuss it with him but 
>>> he doesn't agree with another layout. (((((
>>>
>>>
>>> Bas v.d. Wiel wrote:
>>>  
>>>       
>>>> Hi Alex,
>>>> Why mix in all this table stuff? It'd probably be a lot easier if you 
>>>> just nested your unordered lists and, if you really have to, wrap the 
>>>> whole thing up in a single <td>.. even though tables are to be 
>>>> considered baaaaaaaaad for layout. ;-)
>>>>
>>>> Bas
>>>>
>>>> Alexander Agafonov wrote:
>>>>    
>>>>         
>>>>> Hello guys!
>>>>> I have a problem, I need ti realize menu like this:
>>>>>
>>>>> <table width="100%" border="1">
>>>>> <tr>
>>>>> <td>Menu 1</td>
>>>>> <td>Menu 2</td>
>>>>> <td>Menu 3</td>
>>>>> <td>Menu 4</td>
>>>>> </tr>
>>>>> <tr>
>>>>> <td><ul>
>>>>> <li>Menu 1.1</li>
>>>>> <li>Menu 1.2</li>
>>>>> <li>Menu 1.3 </li>
>>>>> </ul></td>
>>>>> <td><ul>
>>>>> <li>Menu 2.1</li>
>>>>> <li>Menu 2.2</li>
>>>>> <li>Menu 2.3 </li>
>>>>> </ul></td>
>>>>> <td><ul>
>>>>> <li>Menu 3.1</li>
>>>>> <li>Menu 3.2</li>
>>>>> <li>Menu 3.3 </li>
>>>>> </ul></td>
>>>>> <td><ul>
>>>>> <li>Menu 4.1</li>
>>>>> <li>Menu 4.2</li>
>>>>> <li>Menu 4.3 </li>
>>>>> </ul></td>
>>>>> </tr>
>>>>> </table>
>>>>>
>>>>> I'm tried to find solution but still no success. There is my TS setup:
>>>>>
>>>>>
>>>>> subparts.menu = HMENU
>>>>> subparts.menu.special = directory
>>>>> subparts.menu.special.value = 1
>>>>> subparts.menu.1 = TMENU
>>>>> subparts.menu.1 {
>>>>>    expAll = 1
>>>>>    wrap = <tr>|</tr>
>>>>>
>>>>>     NO.allWrap = <th id="m{elementUid}">|</th>
>>>>>     NO.subst_elementUid = 1
>>>>>     NO.ATagTitle.field = subtitle
>>>>>     ACT = 1
>>>>>     ACT.allWrap = <th id="m{elementUid}" class="h">|</th>
>>>>>     }
>>>>> subparts.menu.2 = TMENU
>>>>> subparts.menu.2 {
>>>>>    before.wrap = <tr>
>>>>>    after.wrap = |</tr>
>>>>>    wrap =  <td>|</td>
>>>>>     NO.allWrap = <li class="">|</li>
>>>>>     NO.subst_elementUid = 1
>>>>>     NO.ATagTitle.field = subtitle
>>>>>     ACT = 1
>>>>>     ACT.allWrap = <li class="menu-act">|</li>
>>>>>     }
>>>>>
>>>>> It wraps second level in a same row.
>>>>>
>>>>> Plz, Help!!
>>>>>
>>>>> Regards, Alex
>>>>> _______________________________________________
>>>>> TYPO3-english mailing list
>>>>> TYPO3-english at lists.netfielders.de
>>>>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>>>>>         
>>>>>           
>>> _______________________________________________
>>> TYPO3-english mailing list
>>> TYPO3-english at lists.netfielders.de
>>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>>>   
>>>       
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>   



More information about the TYPO3-english mailing list