[TYPO3] Third try: Print a list of image filenames to the page?

Christopher bedlamhotel at gmail.com
Mon Sep 25 02:29:20 CEST 2006


Hi,

On 9/24/06, Mike <php at talkingspider.com> wrote:
>
> OK I see, thank you.  One thing though- in my original question, in
> my three line PHP example, I do specify putting quotation marks
> around each image.  As in:  'image1.jpg', 'image2.jpg', 'image3.jpg'
>
> So I got your example to work, but I'm stuck without quotations.


Well, you can do this in the renderObj--you can be able to use the
.stdWrap property .split

page.10 = CONTENT
page.10 {
	table = tt_content
	select {
		pidInList = this
		orderBy = sorting
	}
		
	renderObj = HTML
	renderObj {
		value {
			data = field:image
			split {
				token = ,
				cObjNum = 1
				1 {
					current = 1
			  		wrap = <span style="color:red;">|</span>
				}	
			}
		}
	}
}


> And for this:
>
> >As far as the example I posted selecting the entire column, I've
> >already posted links to all the relevant sections of the TSref in this
> >thread. The information about how to restrict your db query is waiting
> >there in the TSref for you to read it (hint: it's the 'WHERE' clause
> >in the .select part of the cobject).
>
>
> I had asked last week in this mailing list for help in selecting only
> one content object, and I received no answer. (Search for "Basic
> fundamental typoscript question".)  Yes, I've looked at the TSRef,
> 24895924752948752 times.


Well, on the basis of what conditions do you want to select content?
There's no magic; in the CONTENT object you're doing a perfectly
conventional database query (using the .select property the properties
of which can be found in the TSref under 'functions'). You have to
specify the WHERE clause of the sql query just as you'd have to in
php.

-Christopher
>
> At 05:02 PM 9/24/2006, you wrote:
>
>
> >Aside from the fact that the example I posted was an EXAMPLE--you
> >don't have a field in tt_content named 'foo', do you?--the renderObj
> >is an HTML object, not an IMAGE object. It renders almost *precisely*
> >what you asked for, the two exceptions being that it also prepended
> >the list with a comma (this was because the values in the image field
> >are also stored as a comma-separated list--just delete the comma in
> >the .dataWrap part).
> >
> >The reason you're getting rendered images is because you didn't
> >specify that you don't want the image content element to behave
> >normally. If that's what you need, you have two easy options (along
> >with several other possibilities):
> >
> >1. explore the TS object browser (in the template module) and alter
> >the default rendering of tt_content.image--but be aware that the basic
> >TS for the image content element is reused elsewhere.
> >
> >2. store all your image content elements in a non-rendered page column
> >(e.g. create a column named 'storage' or something and don't render it
> >in your template, just use it for this job)
> >
> >As far as the example I posted selecting the entire column, I've
> >already posted links to all the relevant sections of the TSref in this
> >thread. The information about how to restrict your db query is waiting
> >there in the TSref for you to read it (hint: it's the 'WHERE' clause
> >in the .select part of the cobject).
> >
> >
> >-Christopher
> >_______________________________________________
> >TYPO3-english mailing list
> >TYPO3-english at lists.netfielders.de
> >http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>



More information about the TYPO3-english mailing list