[Zope] Catching external links - Ideas ?

Andreas Kostyrka andreas@mtg.co.at
Sun, 8 Aug 1999 22:07:44 +0200 (CEST)


On Sun, 8 Aug 1999, Bjoern Kriews wrote:

> 
> Hi !
> 
> I am pretty new to Zope and I am looking for a way to allow content authors
> to link to external sites through a logging redirector.
> I would like to save those people from typing the redirector-URL and 
> having to URL-escape some characters.
> 
> What I want to provide the content writers with is something like:
> <!--#ext "Look, there" href="http://some.where?query%20string#name"-->
> 
> and get 
> <A HREF="/redirect?http%3a%2f%2fsome.where%3fquery%2520string%23name"
> onMouseOver="...">Look, there !</A>

What about <A HREF="<dtml-exturl http://somewhere>">Some external URL.</A>

Your syntax might be less typing for the authors, but is much less
flexible about what is put in the link.

Examples:

<A HREF="<dtml-exturl http://somewhere>"<dtml-var
"somewhere_banner.tag(border=0)"></A>

> If you have an idea on how to achieve this with Zope builtins or
> on the best way to implement it, please give me a hint.
Well, you could always write an tag Product. Actually you would probably
need two things:
1) Redirector object: This would define the URL that is used for
                      redirection.
2) Redirector tag: This uses a Redirector object to redirect to some
                   URL.

Additional ideas:
-) Redirector objects might provide additional features:
   *) invisible redirect.
   *) visible redirect (you are being now taken to this and that homepage)
   *) defined sites. This way you can refer to some site by a symbolic
                     name. <dtml-exturl site_of_the_month>
   *) logging to predefined logfiles.
      (This way you do not need to isolate and URL decode your normal
       httpd logs.)
-) One additional thing would be to consider an object that would
   automagically redirect all '<A HREF="http://' constructs.
   This would surely mean some quite unorthodox hacking of ZOPE, but
   might be the ultimative tool: Your content authors don't have to bother
   to remember to mark external urls, and you get all external clicks
   logged.

I might implement such a beast, as it would be of general use, but if you
need it quickly to your specification, you might consider to hire someone
to develop it. (There is always Digital Creations, and there are when I
counted right at least three german speaking companies to do this deed,
beehive.de, kocons.de, and mtg.co.at ;) )

Andreas
--
Andreas Kostyrka                     | andreas@mtg.co.at
phone: +43/1/7070750                 | phone: +43/676/4091256   
MTG Handelsges.m.b.H.                | fax:   +43/1/7065299
Raiffeisenstr. 16/9                  | 2320 Zwoelfaxing AUSTRIA