[TYPO3-english] Complex Query in Typoscript
Peter Russ
peter.russ at 4many.net
Wed Feb 23 22:41:08 CET 2011
--- Original Nachricht ---
Absender: IAmThatSTrange
Datum: 23.02.2011 22:16:
> Hi all, I've been looking all over for information on how to do this in
> Typoscript. tsref while great doesn't go into the detail for me to
> understand where to dot the i's and cross the t's. (syntax, usage)
>
> What I'm trying to do is show the last 5 updated content element headers as
> links to those content elements on the home page (from several pages down -
> on as many subpages as necessary to get those content elements).
> So
> Home page (where the links to the content elements will be shown)
> News
> Feb 2011
> 021811 (where the content elements are)
> 021611 (where the content elements are)
> 021411 (where the content elements are)
> Jan 2011
> 011811 (where the content elements are)
> 011611 (where the content elements are)
> 011411 (where the content elements are)
>
> I only need the most recent 5 or 6 but if one page has only 3 content
> elements, then the top 3 content elements from the next page should show.
>
> I have a query that get's exactly what I want in a straight db query, I've
> just no clue how to put this into Typoscript.
>
> the Query:
>
> SELECT t.uid, t.pid, bodytext
> FROM tt_content t
> WHERE pid IN (SELECT p1.uid FROM pages p1 LEFT JOIN pages p2 ON p1.pid =
> p2.uid where p2.pid = 17523 and p1.hidden = 0 and p1.deleted=0)
> order by tstamp desc
>
> Can anyone assist?
>
> Thanks so much!
>
> M
PS: alreday done similar thing. But you have to "reverse" the MySql
standard approach:
1) Query internal first
2) With each result of first query do the external
As you can imagine: not very fast.
Never left R&D.
Peter.
--
Fiat lux! Docendo discimus.
_____________________________
uon GbR
http://www.uon.li
http://www.xing.com/profile/Peter_Russ
More information about the TYPO3-english
mailing list