[TYPO3] HELP! Losing hair. Was: Can't have different NOs with different types/heights in GMENU?
JoH
info at cybercraft.de
Thu Oct 11 12:58:25 CEST 2007
> 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