[TYPO3] Third try: Print a list of image filenames to the page?
bedlamhotel at gmail.com
Mon Sep 25 05:55:31 CEST 2006
On 9/24/06, Mike <php at talkingspider.com> wrote:
> >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
> Yea- see that's exactly my question, how do I construct a query that
> will give me like "the second content object down on the list in the
> left column"? I was looking at the tt_content table in the database,
> and I can't see how I could do it. I actually wish there was just
> like an arbitrary field in the typo3 back end like "label" and I
> could label a content item in whatever way I wanted and construct the
> query like "where label='myidentifier' ". I could hijack one of the
> existing fields in there and use it for that purpose, but then the
> label will show up on the page. (Plus that's kind of a hack...) I
> figured there has to be an established way of doing this.
Well, sql is reasonable well-established ;-)
Seriously though, the precise goal of what you're asking about seems
to keep moving. There are basically three options avaiable to you:
1. Write your query on the basis of something that's present in
tt_content *in general* for the content element type you're trying to
select--look through the db and see if you find anything...sorting
might be usable...,
2. Write an extension that adds the extra field you need (5 minutes
with the kickstarter)/use an existing field for this job,
3. find out something about the objects returned in the internal sql
query itself--such as which row a given object belongs to.
1 may be easy, depending on exactly what your criteria are, 2 is
definitely easy, 3 is trickier, but can also be achieved with TS. Have
a look in the TS object browser at lib.stdheader.3 and
lib.stdheader.10.1--these two objects do something very, very similar
to what you're after with the first hx element on the page (i.e. if
it's the first h1 on the page, it gets wrapped in a particular class).
You can adapt the TS you find there for use in your renderObj.
More information about the TYPO3-english