[TYPO3-english] Present images from sys folder
Eric Thelander
3d-telis at home.se
Wed Dec 17 00:05:16 CET 2008
Hello everyone
I'm trying to set up a template where a gallery page will show images
from pages located in a sysfolder. The page tree looks like this
* Gallery
o Sysfolder
+ Page 1
+ Page 2
+ etc...
The pages in the sys folder is built up like this, first they have Text
w/image element and then a Image element. I need the TS on my gallery
template to grab the picture in Text w/image element together with the
page title and also make the image and title link to the page where they
are located. Kind of like a automatic thumbnail feature.
I've gotten it to work half way by modifying a randomcontent script. I
get the gallery to show the correct pictures from every page and line up
the pictures nicely. If I enable the titles as well they do show but
mess up the alignment of the pictures, but I cant get the linking to
work because the original script needs the text to get cropped in order
to present a read more link.
I admit I'm not very savvy with typo3, I get by modifying scripts and
searching solutions in the typo3 mailing list. I apologize if this has
been answered previously and kindly ask you to point me in the right
direction.
This is my modified script:
*Constants:*
# ID of the page where your content elements are stored
lib.randomContent.pidInList = 21,22,23,24
# Maximum number of pixels (width) a block of images inserted as content
is allowed to consume.
lib.randomContent.maxImageWidth = 110
# Same as above, but this is the maximum width when text is wrapped
around an imageblock. Default is 50% of the normal Max Image Width
lib.randomContent.maxImageWidthInText = 110
*Setup:
*
# Random student block
lib.randomContent = COA_INT
lib.randomContent {
10 = CONTENT
10 {
table = tt_content
select {
where = CType='textpic'
# ID of the page where your content elements are stored
pidInList = {$lib.randomContent.pidInList}
orderBy = rand()
}
renderObj = COA
renderObj {
# Use the two new constants "lib.randomContent.maxImageWidth"
# and "lib.randomContent.maxImageWidthInText" to control the
# size of the images.
5.maxImageWidth = {$lib.randomContent.maxImageWidth}
5.maxImageWidthInText = {$lib.randomContent.maxImageWidthInText}
# The following code is identical to the "tt_content.textpic"
# object from css_styled_content
10 = COA
10.if.value = 25
10.if.isLessThan.field = imageorient
20 < tt_content.image.20
}
}
}
Best regards
Eric
More information about the TYPO3-english
mailing list