[TYPO3] HELP! Losing hair. Was: Can't have different NOs with different types/heights in GMENU?

Peter typo3 at peter-b.org
Sun Oct 21 10:46:05 CEST 2007


Sorry for taking so long to try this - I'm mid house move and have only 
just had the chance to try this out.

Thanks, Joey, for the pointers. They've allowed me to play with the menu 
in various different ways. However, my frustration remains.

I get various good results with both methods, but each has at least one 
show-stopper style problem.

If I use the first method, I can't change allWrap based on the condition.

If I use the second method, useLargestItemX fails to work and the menu 
looks a mess (there are possibly other things that break but I spent so 
long trying to find a way to fix the broken useLargestItemX that I 
didn't find out what they might be...!).

Other suggestions welcome! In the meantime I'm going to experiment with 
the first method (as this had the best results) looking for a way to 
eliminate the allWrap.

Peter.

JoH wrote:
>> Ok, this is driving me nuts. I can't believe there isn't a way to do
>> this, and I can't believe no-one has tried to do this before.
>>
>> Forgetting all the code examples, the requirement is simple; I want
>> different types of entries of different sizes with different wraps in
>> the same GMENU based on a condition (the target page ID, for example).
>>
>> So, based on the target PID, the GMENU entry will either be an IMAGE
>> object 50x50 with a specific wrap, or it will be a TEXT object 200x50
>> with a different wrap.
>>
>> I can't use IProcFunc or ItemArrayProcFunc as both are already in use
>> for something else.
> 
> Doesn't sound like a big problem to me, since GMENU items have got two 
> options to remove the default rendering completely, one is altImgResource 
> the other one is allStdWrap.
> 
> With altImgResource you could use the import feature to get different images 
> depending on a condition:
> 
> NO {
>     altImgResource {
>         import.cObject = COA
>         import.cObject {
>             10 = IMG_RESOURCE
>             10 {
>                 file = GIFBUILDER
>                 file {
>                     #blah
>                 }
>                 stdWrap.if {
>                     value = 1,2,3,4,5
>                     isInList.field = uid
>                 }
>             }
>             20 = IMG_RESOURCE
>             20 {
>                 file = GIFBUILDER
>                 file {
>                     #blah
>                 }
>                 stdWrap.if {
>                     value = 1,2,3,4,5
>                     isInList.field = uid
>                     negate = 1
>                 }
>             }
>         }
>     }
> }
> 
> With allStdWrap you can use the COA directly but then you will loose the 
> options of having imgParams, ATagParams and other stuff that is available 
> for GMENU items and you will have to do the linking by yourself.
> 
> NO {
>     allStdWrap.cObject = COA
>     allStdWrap.cObject {
>         10 = IMG_RESOURCE
>         10 {
>             file = GIFBUILDER
>             file {
>                 #blah
>             }
>             stdWrap.if {
>                 value = 1,2,3,4,5
>                 isInList.field = uid
>             }
>         }
>         20 = IMG_RESOURCE
>         20 {
>             file = GIFBUILDER
>             file {
>                 #blah
>             }
>             stdWrap.if {
>                 value = 1,2,3,4,5
>                 isInList.field = uid
>                 negate = 1
>             }
>         }
>     }
>     stdWrap.typolink.parameter.field = uid
> }
> 
> Both of the approaches can handle optionSplit with any value inside the 
> NO-section, so you can still change the behaviour based on the position of 
> each item.
> 
> HTH - not tested though
> 
> Joey 
> 
> 


More information about the TYPO3-english mailing list