[TYPO3-project-formidable] Send a param to a datasource

Manuel Rego Casasnovas mrego at igalia.com
Wed Nov 21 10:40:19 CET 2007


Hello.

I'd like to send a param to a datasource, however I don't know if I can
do it, and how to do it.

For example in the next XML config, a datasource:DB subpages that show
subpages for the pages on lister:

	<control>

		<datahandler:VOID />
		<renderer:STANDARD />

		<datasources>

			<datasource:DB name="pages">
				<sql><![CDATA[
					SELECT uid, title, tstamp, crdate from pages where pid=273
				]]></sql>
			</datasource:DB>

			<datasource:DB name="subpages" params="pid">
				<sql><![CDATA[
					SELECT uid, title, tstamp, crdate from pages where pid=$pid
				]]></sql>
			</datasource:DB>

		</datasources>

	</control>

	<elements>

		<renderlet:LISTER name="mylist" cachehash="true">
			<datasource use="pages" />
			<columns>
				<column name="title" type="renderlet:TEXT" listHeader="Page title" />

				<column name="crdate" type="renderlet:DATE" listHeader="CR date">
					<data>
						<datetime format="%d %B %Y" />
					</data>
				</column>
				<column name="mysublist" type="renderlet:LISTER" listHeader="My sub list" cachehash="true" params="uid">
					<datasource use="subpages" />
					<columns>
						<column name="title" type="renderlet:TEXT" listHeader="Page title" />

						<column name="crdate" type="renderlet:DATE" listHeader="CR date">
							<data>
								<datetime format="%d %B %Y" />
							</data>
						</column>
					</columns>
				</column>
			</columns>
		</renderlet:LISTER>

	</elements>

Maybe the line: "SELECT uid, title, tstamp, crdate from pages where
pid=$pid" isn't a good example. Buy if I can use an userobj in a
datasource:PHPARRAY would be great.

Is it possible?

Best regards,
   Rego

-- 
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com



More information about the TYPO3-project-formidable mailing list