[TYPO3] Saving the SPLIT_COUNT to a list

kozy koosb at xs4all.nl
Thu Jun 19 11:05:01 CEST 2008


Hello,

I'm trying to create a very simple gallery. There is a folder with
thumbnails and a folder with the larger version of the image. Every 12
thumbnails are wrapped in a div with a unique id. (using the SPLIT_COUNT
register) So far so good.

Now I'd like to save the id's to a list. This I can't work out how to do.
For some reason I cannot get:

something := addToList({register:SPLIT_COUNT})

to do what I want at the cObj processing the first of every 12th image.

Any thoughts on this?

Thanks so much. Here is the TypoScript:

#Standard wrapping of every image
tmp.imgWrap = COA
tmp.imgWrap {
	10 = IMAGE
	10.file.import.dataWrap = fileadmin/images/work/{field:field_subdir}/thumbs/
	10.file.import.current = 1
	10.stdWrap.typolink.parameter.dataWrap =
fileadmin/images/work/{field:field_subdir}/full/{current:1}
	10.stdWrap.typolink.ATagParams.dataWrap =
onclick="Images.loadDetail('fileadmin/images/work/{field:field_subdir}/full/{current:1}');
return false;"  target="_blank"

	20 = HTML
	20.value.char = 10
}

lib.kzyGallery = COA
lib.kzyGallery {

	# Here I would like to save a list of the SPLIT_COUNT number of the first
split (1)
	menuSplits = TEXT
	# For testing
	menuSplits.value = empty

	# Returns the thumbnails
	thumbs = COA
	thumbs {
		10 = TEXT
		10.filelist = fileadmin/images/work/{field:field_subdir}/thumbs | png |
date |
		10.filelist.insertData = 1

		# Save the list of images and the first image. The full list
		first = COA
		first {
			10 = LOAD_REGISTER
			10 {
				allImages < lib.kzyGallery.thumbs.10

				firstImage < lib.kzyGallery.thumbs.10
				firstImage.listNum = 0
			}

			20 = IMAGE
			20 {
				file.import.dataWrap =
fileadmin/images/work/{field:field_subdir}/full/{register:firstImage}
				params = id="image_full"
			}
		}

		10.split {
			token = ,
			cObjNum = |*| 1 || 2 || 2 || 2 || 2 || 2 || 2 || 2 || 2 || 2 || 2 || 3 |*|

    		1 {
 			# This doesn't work
    			list = COA
    			list {
    				10 =< lib.kzyGallery.menuSplits
    				10.dataWrap := addToList({register:SPLIT_COUNT})
    			}

			# This creates a div with id=section0 and id=section12 etc. I'd like to
save this '0' and '12' to a list...
    			10 < tmp.imgWrap
    			10.wrap = <div class="section" id="section{register:SPLIT_COUNT}">|

			# This doesn't work
			#30 =< lib.kzyGallery. menuSplits
			#30.value := addToList(blas, test)

			# This doesn't work
			#lib.kzyGallery.menu = addToList(blas, test)
    		}
    		1.insertData = 1

			2 < tmp.imgWrap

			3 < tmp.imgWrap
			3.wrap = | </div>
		}

		# Because the last image is not wrapped we need to add the closing div.
This might give problems when the
		# number of images is a multiple of 12. Not sure. Will need to look into
optionSplit a bit more...
		10.wrap = |</div>

		# Wrap the whole again
		10.wrap2 = <div class="scroller-content">|</div>
	}
}



More information about the TYPO3-english mailing list