[TYPO3-project-formidable] rdt:LISTER with LINK: Adding the UID of the record to the URL
Manuel Rego Casasnovas
mrego at igalia.com
Mon Mar 2 07:30:12 CET 2009
Hello,
On Sun, 1 Mar 2009 20:07:32 +0100
"Hauke Hain" <newgrp at googlemail.com> wrote:
> I have titles in my lister and I want to make a link where the uid of
> the record is a URL parameter.
> The problem is to get the UID. Her is the relevant part of my
> XML-file:
>
> [...]
> <datasources>
> <datasource:DB name="pages">
> <sql>
> <userobj>
> <php><![CDATA[
> return 'SELECT r.title FROM preview_previews WHERE pid =
> '.$GLOBALS['TSFE']->id.' AND r.deleted=0 AND r.hidden=0';
> ]]></php>
> </userobj>
> </sql>
> </datasource:DB>
> </datasources>
>
> </control>
> <elements>
> <renderlet:LISTER name="allreviews" cachehash="true"
> custom="scope='col'"> <datasource use="pages" />
> <template
> path="/typo3conf/ext/preview/res/tmpl/list_previews.html"
> subpart="###MAIN###"
> cssfile="/typo3conf/ext/preview/res/lister.css"
> alternaterows="###ROW1###, ###ROW2###"/>
> <columns>
> <column name="title" type="renderlet:LINK"
> listHeader="LLL:listAll.title">
> <href><userobj><php><![CDATA[
> $aParams = ''; // From where??
> return $this->cObj->currentPageURL(
> array('preview_pi1[show_preview]' =>
> $aParams['uid'])); ]]></php></userobj></href>
> </column> </column>
> </columns>
> </renderlet:LISTER>
> [...]
You can get the uid with something like:
$row = $oForm->oDataHandler->_getListData();
$row['uid'];
About the $aParams is an array of parameters that is passed to a
callback, for example:
<userobj>
<extension>this</extension>
<method>getDetailURL</method>
<params>
<param>
<name>one_param</name>
<value>15</value>
</param>
</params>
</userobj>
Best regards,
Rego
More information about the TYPO3-project-formidable
mailing list