[TYPO3-dev] link to external url behaviour (why not going directly external?)

stefano cecere scecere at krur.com
Sun Jan 11 17:04:25 CET 2009


Christopher Torgalson wrote:
> Hi,
> 
> On Sat, Jan 10, 2009 at 4:48 PM, stefano cecere <scecere at krur.com> wrote:
>> since i had some problems with a "link to external url" menu (in a multilanguage, multidomain, reaurled site.. the links were not going "out" but always loaded the home page)
>>
>> i was wandering: WHY shouldn't a "link to external URL" page have the extenal URL as direct link (instead of passing to it's typo3 ID page and then do the jump?
>>
>> i could make it easily insert a custom PHP script in the HMENU generation.. but shouldn't it be a core option?
> 
> It's simple in TS. Search this list--your question has been answered
> several times.

really so simple in TS?

i said that i could make it via a custom PHP script that i add to the NO MenuItems:

NO.allStdWrap.postUserFunc = user_functions->user_modifyToExternalUrl

where user_modifyToExternalUrl is:

<?php
class user_functions {
	function user_modifyToExternalUrl($content, $conf){

		// if link type is "external url" replace link to redirecting page with external url
		if($this->cObj->data['doktype'] == 3){
			$content = preg_replace('/(<a[^>]*href=")[^"]*("[^>]*>)/','$1http://'.$this->cObj->data['url'].'$2', $content);
		}
	return $content;
	}
}
?>

what i ask is: why do these external links pass via the internal pages, and not show straight the external URL in the menus?
what is the advantage to have them working like they do now?

thanks!
stefano




More information about the TYPO3-dev mailing list