On Thu, Jan 18, 2007 at 10:10:20PM +0100, Florian Lindner wrote: > Yes, it works fine but now I have another problem: > > The tempate contains links like: > > <a tal:attributes="href context/@@contact.html/@@absolute_url">kontakt</a> > > contact.html is registered for the interface (IXGM) of the object in which > the > object that should use the template (IBlog) resides. But in the IBlog context > there is no contact.html.
So, if I understand you correctly, you have URLs like /foo/bar/xgm/blog/@@myview.html where myview.html uses the template above, and you want that view to have an absolute URL to /foo/bar/xgm/@@contact.html ? > What is the best way to work around this? > > - Register contact HTML for all interfaces? No? > - Make them static (no TAL) links? That would work. <a href="../../contact.html">...</a> > Both are ways I don't really like. Or you could use <a tal:attributes="href string:${context/zope:parent/@@absolute_url}/@@contact.html">kontakt</a> The pattern is to get to the desired new context of the view you want to link to, apply @@absolute_url to it, and then concatenate the new view name to that string. (It might be a nice extension to the AbsoluteURL view(s) to make them traversable so that you could say obj/@@absolute_url/something_to_append in a TALES expression. But it wouldn't work when something_to_append starts with '@@'.) Marius Gedminas -- Never, ever expect hackers to be able to read closed proprietary document formats like Microsoft Word. Most hackers react to these about as well as you would to having a pile of steaming pig manure dumped on your doorstep. -- ESR (http://www.tuxedo.org/~esr/faqs/smart-questions.html)
signature.asc
Description: Digital signature
_______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users