[Typo3] Simple sql query

Martin Visser visser at squarewise.com
Mon May 2 10:00:18 CEST 2005


Hi,

I'm stuck: I want to execute a simple sql query and display the output
at the right position. I assume this has to be done with TypoScript. If
I try this:
lib.homeDirs = CONTENT
lib.homeDirs.wrap = <table id="schijven" border="0" cellspacing="0"
cellpadding="0" width="100%">|</table>
lib.homeDirs {
  table = tt_content
  select {
    pidInList = this
    orderBy = sorting
  }
}
Something does appear (at the right position), but it's not what I want.

This is the query: SELECT CONCAT(firstname," ",lastname) AS
name,abbreviation FROM _employees WHERE share='1' ORDER BY firstname ASC
It has to be parsed like this:
<table [attribs]>
<tr><td [attribs]>&nbsp;</td><td [attribs]><a href="__abbreviation__"
target="_blank">__name__</a></td></tr>
</table>

Per records a '<tr>' should be parsed. __abbreviation__ and __name__
are field from the database.

The part with <table></table> should be like this I assume:
lib.homeDirs.wrap = <table>|</table>
But that's as far as I come.

lib.homeDirs is defined in TemplaVoila. If I use something like:
lib.homeDirs = TEXT
lib.homeDirs.value = Foo bar
'Foo bar' is parsed at the right position.

I'm a newbie in this, so please help me.



More information about the TYPO3-english mailing list