[TYPO3-core] RFC #4911: Add an option to add alternative external URL or shortcut for other languages

Francois Suter fsuter at cobweb.ch
Tue Feb 3 11:54:25 CET 2009


Hi Ingo,

> Problem:
> Currently it is not possible to have alternative targets for shortcuts 
> and external url page types in translations. This certainly is not a 
> killer feature but is needed quite often by users.

Thanks for this patch.

> Please especially check how I solved the way how translated shortcuts 
> are handled, I'm not completely sure here whether this is the cleanest 
> possible way and whether it is in the right place. I could also imagine 
> to maybe putting this into a separate function checkTranslatedShortcut() 
> or similar. There could also be some implications with other parts in 
> the core. However, the way it is solved in the patch worked in my tests.

Indeed a separate function may be a good idea, as settingLanguage() is 
already quite long.

I encountered one problem: when a page translation has no shortcut 
defined (or was not set to the shortcut doktype), the current 
implementation takes "0" as the new page id and redirects to the home 
page. Just changing the following test from:

if ($originalShortcutPageOverlay['shortcut'] != $this->id) {

to

if (!empty($originalShortcutPageOverlay['shortcut']) && 
$originalShortcutPageOverlay['shortcut'] != $this->id) {

solves that issue.

External URLs work fine.

Lastly your patch includes a change in the pages table, changing the 
description field from an input field to a text field. While I agree 
that this is a good idea, I suppose it's not really part of this patch.

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-team-core mailing list