[TYPO3-english] Image composition register/if
Jill E. Peterson
jillande at gmail.com
Mon Jun 17 20:22:29 CEST 2013
Greetings,
I am trying to display an images content element so that the images are
merged into one photo in groups of three and if there is not an even group
of 3, omit the remainder images (i.e. don't render an image at all if one
space would be missing). It seems to work for a moment but then I reload
the page and the register values are blank and so the logic fails and
either all the images generate or none and I can toggle between these cases
with .if.negate = 1. I'm sure there's something simple I am missing here to
make it work--I can tell it's not quite right because the
register:bannerCount values are double what I would expect (for example, 22
instead of 11). I'm not opposed to importing from css_styled_content where
I get a correct image count but I'm not sure how to source the images from
from GIFBUILDER in that case (I don't need click-enlarge to work). In
short, I'm not sure if my use of "if" is incorrect, if this "register" is
incorrect, or probably even both. :-)
Any advice?
Many thanks.
Jill
lib.banner = COA
lib.banner {
stdWrap.wrap = <ul>|</ul>
stdWrap.required = 1
10 = IMAGE
10 {
# Image source
file = GIFBUILDER
file {
XY = 720,266
format = jpg
quality = 85
10 = IMAGE
10.before.stdWrap.cObject = LOAD_REGISTER
10.before.stdWrap.cObject {
bannerCount.cObject = TEXT
bannerCount.cObject.data = register:bannerCount
bannerCount.cObject.wrap = |+1
bannerCount.prioriCalc = intval
}
10.XY = 234,266
10.file {
import = uploads/pics/
import.field = image
import.listNum = 0
width = 234
height = 266c
quality = 100
format = png
}
20 < .10
20.offset = 243,0
20.file {
import.listNum = 1
}
30 < .20
30.offset = 486,0
30.file {
import.listNum = 2
}
}
if {
value = 2
isGreaterThan.data = register:bannerCount
}
stdWrap.wrap = <li>|</li>
stdWrap.required = 1
}
20 < .10
20.file.10.file.import.listNum = 3
20.file.20.file.import.listNum = 4
20.file.30.file.import.listNum = 5
20.if.value = 5
30 < .20
30.file.10.file.import.listNum = 6
30.file.20.file.import.listNum = 7
30.file.30.file.import.listNum = 8
30.if.value = 8
40 < .30
40.file.10.file.import.listNum = 9
40.file.20.file.import.listNum = 10
40.file.30.file.import.listNum = 11
40.if.value = 11
}
inserted to the page by
# BANNER IMPORT
page.10.template.60.10.5 = CONTENT
page.10.template.60.10.5 {
table = tt_content
select {
where = header="BANNER"
pidInList = {$local.config.storagepid}
}
renderObj =< lib.banner
}
More information about the TYPO3-english
mailing list