[TYPO3-project-formidable] get value from locallang file

Martin Claus mc.laus at gmx.de
Fri Nov 7 23:17:56 CET 2008


Hi Rob,

if I understood you correct, then you want to have a listbox in the BE  
having values (not captions) defined in an language file.
If this is correct then you can use something like this:

<renderlet:LISTBOX>
	<data>
		<userobj>
			<php><![CDATA[
				$sLabel = 'LLL:EXT:myext/locallang_DB.xml:offers.job_priority.l.';
				$aLabels = array(
					$sLabel.'0',
					$sLabel.'1',
					$sLabel.'2'
				);
				$aItems = array();
				foreach($aLabels as $label) {
					$aItems[] = array(
						'caption'=>$GLOBALS["LANG"]->sL($label),
						'value'=>$GLOBALS["LANG"]->sL($label)
					);
				return $aItems;
				}
			]]></php>
		</userobj>
	</data>
</renderlet:LISTBOX>

This should work. Well, at least I hope so. Not tested yet.
If your Listbox is in the frontend you can use $GLOBALS['TSFE']  
instead of $GLOBALS['LANG'].

I hope this will help you.

Martin

Am 07.11.2008 um 13:43 schrieb Rob De Vries:

> Hey Luc,
>
>  <label index="LLL:jobs_offers.job_priority.I.0">
> this works perfect if I want a value directly form the locallang file.
> but I need to get the right value depending on the output.
>
> in my list i have {job_priority} witch gives a number (0,1 or 2)
> but i need the refering value from the locallang file
>
> in this case the value 0 will be replaced with Very urgent(&gt;=3  
> days)
>
> tnx!
> Rob
>
>
>
> -- 
> ------------------------------------------------------------
> web : http://www.rob-ot.be
> skype : rob-ot
> ------------------------------------------------------------
> [O_o] -- Don't feed the rob-ot
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable



More information about the TYPO3-project-formidable mailing list