[Zope3-Users] Re: Skinning problem
mailinglists at xgm.de
Sat Jan 20 05:08:07 EST 2007
Am Freitag, 19. Januar 2007 01:12 schrieb Philipp von Weitershausen:
> On 18 Jan 2007, at 22:10 , Florian Lindner wrote:
> > Am Donnerstag, 18. Januar 2007 16:24 schrieb Philipp von
> > Weitershausen:
> >> Marius Gedminas wrote:
> >>> On Wed, Jan 17, 2007 at 09:50:58PM +0100, Florian Lindner wrote:
> >>>> Hello,
> >>>> I have a ressourceDirectory with a file styles.css
> >>>> <resourceDirectory
> >>>> directory="files"
> >>>> name="files"
> >>>> />
> >>>> I refer to it in my default template:
> >>>> <link rel="stylesheet" type="text/css" tal:attributes="href
> >>>> context/@@/files/styles.css" />
> >>> That's no good. The /@@/ view only works when context is a site.
> >>> Besides, I'm not sure you can use it in a TALES expression like
> >>> this.
> >>> You want
> >>> <link rel="stylesheet" type="text/css"
> >>> tal:attributes="href context/++resource++files/
> >>> styles.css" />
> >>> I think. (I'm sure "href context/++resource++name.css" is the right
> >>> solution for plain resource files, but I haven't used
> >>> resourceDirectory
> >>> much.)
> >> It works like that for resourceDirectory resources as well.
> > Yes, it works fine but now I have another problem:
> > The tempate contains links like:
> Which template?
> > <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.
> > What is the best way to work around this?
> > - Register contact HTML for all interfaces?
> > - Make them static (no TAL) links?
> > Both are ways I don't really like.
> I'm not getting this. Before you asked about resources, now all of a
> sudden it's about a template?
Ok, the entire situation is:
I have a template template.pt which should be applied to all site watched in
the skin xgm.
macro_pages = ('skin_macros', )
the template.pt is the one also used on xgm.de:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<link rel="stylesheet" type="text/css" tal:attributes="href
<li>[ <a tal:attributes="href
This is the content.
(shortened a bit)
The styles.css is the ressource my last posts were about.
index.html is registered like that:
This works perfect as far as only pages use this template who are registered
on the same interface like the other ines (IXGM).
Now I have a third party package (Blog) which should generally be independent
to all that but should use the template.pt which called with ++skin++xgm.
<div tal:content="context/description" />
<div class="row" tal:repeat="item view/getSortedBlogEntries"
tal:content="structure item/@@details.html" />
is registered on the default layer. Since the xgm layer derives from the
default layer it correctly uses my template.pt.
But the problem is now when a view from the Blog object are called links in
the template like
<a tal:attributes="href context/@@index.html/@@absolute_url">home</a>
do not work anymore, since context is the Blog and not a IXGM object anymore.
Therefore the lookup fails.
Sorry for the long mail, I hope I was able to explain what my problem is.
More information about the Zope3-users