|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
I have a GMENU that works with conditions that work. But I need to do
different sized NO types based on the condition NO { XY = ???? 10 = TEXT 10.text.field = title 10.if {...} 20 = IMAGE 20 { file.import = a/nother/file file.maxW = 150 } 20.if {...} } Either 10 or 20 will be selected, never both. The conditions work, selecting the right item (TEXT or IMAGE). Problem is, I don't know in advance which it's going to be. There is no set pattern or sequence so optionsplit is ruled out. So, how do I determine what NO.XY should be? I can't use [10.h] or [20.h] as I don't know in advance which wil be used! Peter. _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#2
|
|||
|
|||
|
Peter schrieb:
> I have a GMENU that works with conditions that work. But I need to do > different sized NO types based on the condition > > NO { > XY = ???? > 10 = TEXT > 10.text.field = title > 10.if {...} > 20 = IMAGE > 20 { > file.import = a/nother/file > file.maxW = 150 > } > 20.if {...} > } > > Either 10 or 20 will be selected, never both. The conditions work, > selecting the right item (TEXT or IMAGE). Problem is, I don't know in > advance which it's going to be. > > There is no set pattern or sequence so optionsplit is ruled out. > > So, how do I determine what NO.XY should be? I can't use [10.h] or > [20.h] as I don't know in advance which wil be used! XY = [10.h]+[20.h]+5 as an example.... -- T3A AM Rocking TYPO3 since 3.1b1 _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#3
|
|||
|
|||
|
Mathias Schreiber [TYPO3] wrote:
> Peter schrieb: >> I have a GMENU that works with conditions that work. But I need to do >> different sized NO types based on the condition >> >> NO { >> XY = ???? >> 10 = TEXT >> 10.text.field = title >> 10.if {...} >> 20 = IMAGE >> 20 { >> file.import = a/nother/file >> file.maxW = 150 >> } >> 20.if {...} >> } >> >> Either 10 or 20 will be selected, never both. The conditions work, >> selecting the right item (TEXT or IMAGE). Problem is, I don't know in >> advance which it's going to be. >> >> There is no set pattern or sequence so optionsplit is ruled out. >> >> So, how do I determine what NO.XY should be? I can't use [10.h] or >> [20.h] as I don't know in advance which wil be used! > > XY = [10.h]+[20.h]+5 > > as an example.... > Mi Mathias, Thanks for the suggestion. This definitely works in some circumstances. However, as it turns out I'm producing a GMENU with useLargestItemX, which is taken from both 10 and 20 regardless of the conditions.... I'm going to completely re-address how the menu is generated, as I doubt I'm going to get what I want this way.... Peter. _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#4
|
|||
|
|||
|
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. Any ideas? Peter. _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#5
|
|||
|
|||
|
> 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 _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#6
|
|||
|
|||
|
> 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 > > HTH - not tested though And of course not correct ;-) since allStdWrap is no imgResource you have to use IMAGE instead: NO { allStdWrap.cObject = COA allStdWrap.cObject { 10 = IMAGE # .... HTH Joey _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#7
|
|||
|
|||
|
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 > > _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#8
|
|||
|
|||
|
>> 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 >> } >> } >> } >> } >> } >> > > If I use the first method, I can't change allWrap based on the > condition. Of course you can, because allWrap got stdWrap properties itself, so you can create the wrap using a cObject: allWrap.cObject = COA allWrap.cObject { 10 = TEXT 10.value = wrapA | wrapA 10.if { value = 1,2,3,4,5 isInList.field = uid } 20 = TEXT 20.value = wrapB | wrapB 20.if { value = 1,2,3,4,5 isInList.field = uid negate = 1 } } and to do it in a more elegant way you could use a register that you can check within both the GIFBUILDER and the allWrap: NO { altImgResource { import.cObject = COA import.cObject { 5 = LOAD_REGISTER 5 { myCondition.cObject = TEXT myCondition.cObject { value = 0 override = 1 override.if { value = 1,2,3,4,5 isInList.field = uid } } } 10 = IMG_RESOURCE 10 { file = GIFBUILDER file { #blah } stdWrap.if { isTrue.data = register:myCondition } } 20 = IMG_RESOURCE 20 { file = GIFBUILDER file { #blah } stdWrap.if { isFalse = register:myCondition } } } } allWrap.cObject = COA allWrap.cObject { 10 = TEXT 10.value = wrapA | wrapA 10.if { isTrue.data = register:myCondition } 20 = TEXT 20.value = wrapB | wrapB 20.if { isFalse.data = register:myCondition } } } HTH Joey -- Wenn man keine Ahnung hat: Einfach mal Fresse halten! (If you have no clues: simply shut your gob sometimes!) Dieter Nuhr, German comedian openBC/Xing: http://www.cybercraft.de T3 cookbook: http://www.typo3experts.com _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#9
|
|||
|
|||
|
Well as usual real life intervened in tech life in the shape of moving
house and real work, so it's taken me a while to get around to this, but... After much wrangling I realised that I was just not going to get it to work the way I wanted - various TS options that I was using (perhaps inappropriately) to produce a prety round-cornered popup menu fell somewhere in-between the two methods so I shuffled a whole load of stuff out of TS and into CSS and ended up with (note that this is a cut-down version - the meat of the problem - with bogus libs/fields/values for readability)..... lib.mainNav.2 { itemArrayProcFunc = mylib->myfunc IProcFunc = mylib->myfunc2 NO = 1 NO { XY = [10.w]+30,25 |*| [10.w]+30,20 |*| [10.w]+30,25 ATagTitle.field = subtitle // title ATagBeforeWrap = 1 allWrap.cObject = COA allWrap.cObject { 10 = TEXT 10.value = <span class="subNavItem"> | </span> 10.if { value.field = myfield equals = myvalue negate = 1 } 20 = TEXT 20.value = <span class="subNavImage"> | </span> 20.if { value.field = myfield equals = myvalue } } 10 = TEXT 10 { text.field = title } altImgResource { import.cObject = COA import.cObject { 10 = IMG_RESOURCE 10 { file = GIFBUILDER file { XY = 210,210 10 = IMAGE 10.file { import.field = myimage maxW = 200 maxH = 200 } 10.align = c,c } stdWrap.if { value.field = myfield equals = myvalue } } } } } } which is pretty much what Joey suggested - thanks Joey! _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | Thema bewerten |
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [TYPO3] Extension for handling different types of one file fordownload | jirka sedláèek | typo3-english@lists.netfielders.de | 0 | 04.09.2007 13:30 |
| [TYPO3-dev] non-standard page types and extension configurationinfo? | Jason Lefkowitz | typo3-dev@lists.netfielders.de | 6 | 07.06.2007 18:47 |
| [TYPO3] Default content types | James Corell | typo3-english@lists.netfielders.de | 5 | 06.06.2007 23:49 |
| [TYPO3] Disabling content types | James Corell | typo3-english@lists.netfielders.de | 4 | 23.05.2007 21:22 |
| [TYPO3] hide non-editable content types in BE | Steven Hewett | typo3-english@lists.netfielders.de | 2 | 16.04.2007 17:05 |