[TYPO3-formidable] best way for getting oDataHander datainauserobj lister

Stéphane FILLION s.fillion at ameos.com
Mon Aug 16 10:00:58 CEST 2010


There is an error on the previous snippet

<column name="description" type="renderlet:BOX" mode="inline">
<html>
<userobj>
<php><![CDATA[
$sDescription = $this->getListData('description');
$max = "350";
$leng = strlen($sDescription);
if ($leng >= $max) {
$sDescription = substr($sDescription,0,$max) . ' (...)';
}

return $sDescription;
]]></php>
</userobj>
</html> 
</column>



-----Message d'origine-----
De : typo3-project-formidable-bounces at lists.typo3.org [mailto:typo3-project-formidable-bounces at lists.typo3.org] De la part de Stéphane FILLION
Envoyé : lundi 16 août 2010 09:58
À : TYPO3 project list for the FORMidable extension
Objet : Re: [TYPO3-formidable] best way for getting oDataHander datainauserobj lister

You can use : 
<column name="description" type="renderlet:BOX" mode="inline">
	<html>
		<userobj>
			<php><![CDATA[
				$sDescription = $this->getListData('description');
				$max = "350";
				$leng = strlen($aData['description']);
				if ($leng >= $max) {
					$sDescription = substr($aData['description'],0,$max) . ' (...)';
				}

				return $sDescription;
			]]></php>
		</userobj>
	</html>		
</column>
				
Regards,
Stephane

-----Message d'origine-----
De : typo3-project-formidable-bounces at lists.typo3.org [mailto:typo3-project-formidable-bounces at lists.typo3.org] De la part de Domi Garms
Envoyé : lundi 16 août 2010 09:49
À : TYPO3 project list for the FORMidable extension
Objet : Re: [TYPO3-formidable] best way for getting oDataHander data inauserobj lister

Hello Stephane,

thanks for your reply. I just want to know, how I can reach the value,
which is given over the renderlet in a <userobj><php>...
I have for example
<column name="description" type="renderlet:BOX" mode="inline">
					<html>
						<userobj>
							<php><![CDATA[
								$aData = $this->oDataHandler->getListData();
								$max = "350";
								$leng = strlen($aData['description']);
								if ($leng >= $max) {
									$aData['description'] = substr($aData['description'],0,$max)
. ' (...)';
								}
								return $aData['description'];
							]]></php>
						</userobj>
					</html>		
				</column>
Is there another function, how to get the value of
$aData['description'] without loading the whole list data via
$aData=$this->oDataHandler->getListData()? Because in my searchform I
need it a couple of times, and I thought there is maybe something
like: $this->value in the <userobj> available.

Thanks a lot

Domi



2010/8/16 Stéphane FILLION <s.fillion at ameos.com>:
> Hello Domi,
>
> In my opinion, the best way is to use a renderlet:LISTBOX (or renderlet:CHECKBOX)
>
>
>
> <column name="gender" type="renderlet:LISTBOX">
>        <data>
>                <items>
>                        <item caption="male" value="0" />
>                        <item caption="female" value="1" />
>                </items>
>        </data>
> </column>
>
> Regards,
> Stephane
>
> -----Message d'origine-----
> De : typo3-project-formidable-bounces at lists.typo3.org [mailto:typo3-project-formidable-bounces at lists.typo3.org] De la part de Domi Garms
> Envoyé : lundi 16 août 2010 07:02
> À : TYPO3 project list for the FORMidable extension
> Objet : [TYPO3-formidable] best way for getting oDataHander data in auserobj lister
>
> Good Morning,
>
> I just wondering what would be the easiest way for getting the value
> for a renderlet in a LISTER. I want to render the gender, which is
> saved as 0 or 1 in the datasource, it should rendered as male or
> female
>
> My snippet is:
>
> <!-- GENDER -->
>                                <column name="gender" type="renderlet:BOX" mode="inline" >
>                                        <html>
>                                                <userobj>
>                                                        <php><![CDATA[
>                                                                $aData = $this->oDataHandler->getListData();
>                                                                $aData['gender'] = ($aData['gender'] == 1) ? "female" : "male";
>                                                                return $aData['gender'];
>                                                        ]]></php>
>                                                </userobj>
>                                        </html>
>                                </column>
>
> Because I need this function quite often, not sure if there is a
> better way for doing it...Thanks for any hint!
>
> Regards,
> Domi
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable
>
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable
>
_______________________________________________
TYPO3-project-formidable mailing list
TYPO3-project-formidable at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable

_______________________________________________
TYPO3-project-formidable mailing list
TYPO3-project-formidable at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-formidable



More information about the TYPO3-project-formidable mailing list