[TYPO3-mvc] FED SQL Query with sys_language_uid

Claus Due claus at wildside.dk
Thu Feb 2 15:13:48 CET 2012


Hi Chivy,

First of all you need the currently active language's UID assigned as a template variable somehow (approach depends on your implementation method).

Then, in your query's condition add this:

… " AND (sys_language_uid IN (-1,0) OR (sys_language_uid = '{theVariableWithLanguageUid}' AND l18n_parent = '0'))"

The variable can be read from $GLOBALS['TSFE']->sys_language_uid but naturally must be assigned to the template renderer before you can use it :)


---
Cheers,
http://fedext.net

On Feb 2, 2012, at 6:22 AM, Chivy Lim wrote:

> Hi all,
> 
> I use FED for selecting the record as below:
> 
> <fed:data.sql as="categories" table="tx_news_domain_model_category" fields="uid,title" condition="deleted=0 AND hidden=0" orderBy="title" order="ASC" />
> 
> The result of this statement is showing all records in other languages, but I would need only records in the current language. Could you help?
> 
> Thanks,
> Chivy
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list