[Zope] flexible linking...

Breuer, Yvon YBreuer@tee.toshiba.de
Thu, 25 Jul 2002 13:24:51 +0200


The link_MailtoSomeone is not a DTML document but a DTML method.
Is a method not ok for this?

Further:
ad 1) I'll change it. Seems plausible.
ad 2) You're right, but... I haven't learned Python yet. (Guess it's =
worth a try. I've already got so much to learn! :-) )

Yvon Breuer


-----Original Message-----
From: Charlie Reiman

Your link_MailtoSomeone is not expanding. Are you sure it's a DTML =
document?

FWIW, this seems really complicated and probably will bite you later on. =
I
see a couple of big problems.

1) Intrasite links in Zope are best left up to zope itself. You don't =
want
this in your DTML:
<A href=3D"/orderform">Order now</A>
You want this instead
<dtml-var expr=3D"orderform.absolute_url()">Order now</A>

The reason is that the first can't be relocated, won't work when you =
move
the site, won't work behind VirtualHostMonster, and can't take advantage =
of
Zope's intrinsic HTML savvy object rendering. The same argument applies =
to
image references. It's not clear from your example but it looks like =
you'd
be forcing text links.

2) You've got everything all split up in little bits. To change a link, =
it
looks like someone will need to edit three (?) objects, all in different
folders. Think about how much clicking the poor fellow is in for. If you
need to make links editable by others, it doesn't seem to me like this =
is
going to make things easier.

If you must do something like this, consider using object properties to
store information, using TinyTables plus python, or writing your own =
'Link'
product.

> -----Original Message-----
> From: Breuer, Yvon
>
> Hi,
>
> new(bie) question...
>
>
> What I want:
> ------------
> - I'm trying to make my links as flexible as possible.
> - I'd like to have all links together in one folder.
> - I'd like to have all texts together in one folder.
>
>
> Reasons:
> --------
> - Later I want to impliment multi-languages (for everything, so
> for links too).
> - I don't want to change every link implemented in my pages when
> some mailto- or http-address changes.
> - I'm lazy. I just want to make it once and let others maintain
> the textfiles if something changes afterwards.
>
>
> My setup:
> ---------
> ROOT (folder)
> 	body (dtml method)
>
> 	LINKS (folder)
> 		link_MailtoSomeone (dtml method)
> 		link_HttpSomeSite (dtml method)
>
> 		MAILTO (folder)
> 		mailto_Me (plain/text)
> 		mailto_You (plain/text)
>
> 		HTTP (folder)
> 		http_MySite (plain/text)
> 		http_YourSite (plain/text)
>
> 	TEXTS (folder)
> 		txt_MailtoSomeone_Subject (plain/text)
> 		txt_MailtoSomeone_OnMouseOver (plain/text)
> 		txt_MailtoSomeone_Description (plain/text)
>
>
> My coding:
> ----------
> body  =3D  <dtml-var "LINKS.link_MailtoSomeone">
>
> link_MailtoSomeone  =3D  <a href        =3D "<dtml-var =
"MAILTO.mailto_Me">"
>                           subject     =3D "<dtml-var
> "TEXTS.txt_mailtoSomeone_Subject">"
>                           onMouseOver =3D "window.status =3D
> '<dtml-var "TEXTS.txt_mailtoSomeone_OnMouseOver">'; return true;"
>                           onMouseOut  =3D "window.status =3D ''; =
return true;"
> 	                 >
>                        <dtml-var =
"TEXTS.txt_mailtoSomeone_Description">
>                        </a>
>
> mailto_Me  =3D  mailto:ybreuer@tee.toshiba.de
>
> txt_MailtoSomeone_Subject  =3D  My question is ...
>
> txt_MailtoSomeone_OnMouseOver  =3D  Send us an e-mail
>
> txt_MailtoSomeone_Description  =3D  If you have a question, click this =
link
>
>
> The result: (hopefully your still with me :-) )
> -----------
> Unfortunately, instead of showing me the appropriate link, this
> result in the following text:
> <a href =3D "<dtml-var "MAILTO.mailto_Me">" subject =3D "<dtml-var
> "TEXTS.txt_mailtoSomeone_Subject">" onMouseOver =3D "window.status
> =3D '<dtml-var "TEXTS.txt_mailtoSomeone_OnMouseOver">'; return
> true;" onMouseOut =3D "window.status =3D ''; return true;" >
> <dtml-var "TEXTS.txt_mailtoSomeone_Description"> </a>
>
>
> The question:
> -------------
> How can I prevent getting the complete string as a result in
> stead of the correct link?
> (The question is simple, but is the answer? ;-) )
>
> Best regards,
>
> Yvon Breuer
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>