[TYPO3-shop] Language implementation in tt_products
Simon Tuck
e-mailNO at SPAMeyejet.com
Mon Feb 13 17:54:44 CET 2006
Hi Franz,
It's me again ;)
>
> this sound interesting. However I prefer this solution where the
> language table with all the translations is separate. I dislike it if a
> lot of fields in a table are unused.
It's your decision of course, but you're talking of 3 extra fields as opposed to an extra table.
> The T3 localization still works
> with the language tables.
No it doesn't. The languages work, but T3 localization is not available.
Anyway, I decided to modify the extension. I had set out not wanting to change you're extension in any way. use hooks and all that, but I wanted
to see what it took and it's no big deal to modify accordingly.
Basically everything remains the same *except* when you output a record to the FE. Before a record goes to the the FE you need to check for the
language and run the record array through $GLOBALS['TSFE']->sys_page->getRecordOverlay. For example, in class.tx_ttproducts_single_view.php I
just add...
<snip>-----------------------------------
if ($GLOBALS['TSFE']->sys_language_uid && count($row)) {
$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($this->tt_products->table->name, $row, $GLOBALS['TSFE']->sys_language_uid,
GLOBALS['TSFE']->sys_language_contentOL);
}
-----------------------------------</snip>
...at the appropriate position in the printView method. The same of course applies to the list and basket view, and I suppose I'll have to check
the other views later on, but the calculation scripts etc. all remain the same.
Perhaps you can use that at a later point...
Cheers,
Simon
More information about the TYPO3-project-tt-products
mailing list