[TYPO3-dev] Mapping eId-URLs to "real" URLs

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri Jan 19 18:13:26 CET 2007


Martin Kutschker wrote: on 18.01.2007 16:13:

> I wanted to translate all of my URLs to fake "real" URLs. Why? So I can
> get a complete dump with wget easily.
> 
> But the dump should include also the click enlarge images provided by
> showpic.php which as of 4.0 is implemented as a eId-URL.
> 
> Does anyone have an idea how to get this into Real URL?
> 
> I think of having the eIds in a separate URL prefix, eg mysite.com/eid/.
> So mysite.com/eid/showpic/options should be the generated and accepted
> URL for my popups.
> 
> The other thing I need to change is the thumbnails. Currently they are
> done as t3lib/thumbs.php, but if they were an eId-script they too could
> be set up like above.

You need:

1) the link generation should go through typolink so that a RealURL can
be generated at the first place. Currently cObj::imageLinkWrap creates
the URL manually:

$url =
$GLOBALS['TSFE']->absRefPrefix.'index.php?eID=tx_cms_showpic&file='.rawurlencode($imageFile).$params;
...

I think this is not such a difficult task to change that to a call to
typoLink (or linkdata).

2) the whole purpose of eID is that you don't need to load anything from
TYPO3 framework that you don't specifically need. If you want to be
"realurl aware", the eID routine needs at least to be able to load the
realURL configuration, which means to load ext_localconf.php.

Apart from that you need to tell RealURL that there are URLs that are
not bound to "page IDs", which is currently central for realurl
functionality (generation of page-path with the "pagePath" function).

An idea would be to allow an alternative pagePage in case no page is
being processed. I think the most difficult issue here is to make sure
it don't break any existing sites (e.g. which already have a page called
"eid" on first level). Maybe it already works if you use preVars for
that purpose, but in case of variable amount of parameters you have the
problem that preVars expect a fixed amount of parameters.

You also have to make sure no part of realurl is called that expect some
part of TYPO3 to be loaded which we don't load in our eID-script.

Cheers,
Ernesto




More information about the TYPO3-dev mailing list