Re: [Zope3-Users] Still a skinning problem

2007-02-06 Thread Mohsen Moeeni

Until the gurus find time to jump in with `the right` solution...

On 2/5/07, Florian Lindner [EMAIL PROTECTED] wrote:

The line in the template.pt:
a tal:attributes=href context/@@index.html/@@absolute_urlhome/a
works fine as long as context is an IXGM, because index.html is registered for
IXGM. But if a view from the IBlog is called is it also rendered in the
template.pt but context now is a IBlog which does not have an index.html (or
at leat not the one I want) and therefore fails.



Your template *assumes* the context will always have
an `index.html` view. So it can not be used for a
context that doesn't have it. At any rate, context
is not the best object you can use to link to home.
It's better to use site root for that purpose. Something
like:

a tal:attributes=href view/siteroot/@@index.html/@@absolute_urlhome/a

Where you find site root using zope3 APIs in view code and
assign it to siteroot.

Disclaimer: I have been away from Zope3 for a long time
and my knowledge was not advanced even then. So if
I am talking non-sense, you can safely ignore me :-)

Mohsen,
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Still a skinning problem

2007-02-06 Thread Florian Lindner
Am Dienstag, 6. Februar 2007 11:43 schrieb Mohsen Moeeni:
 Until the gurus find time to jump in with `the right` solution...

 On 2/5/07, Florian Lindner [EMAIL PROTECTED] wrote:
  The line in the template.pt:
  a tal:attributes=href context/@@index.html/@@absolute_urlhome/a
  works fine as long as context is an IXGM, because index.html is
  registered for IXGM. But if a view from the IBlog is called is it also
  rendered in the template.pt but context now is a IBlog which does not
  have an index.html (or at leat not the one I want) and therefore fails.

 Your template *assumes* the context will always have
 an `index.html` view. So it can not be used for a
 context that doesn't have it. 

I know that's the problem.

 At any rate, context 
 is not the best object you can use to link to home.
 It's better to use site root for that purpose. Something
 like:

 a tal:attributes=href view/siteroot/@@index.html/@@absolute_urlhome/a

 Where you find site root using zope3 APIs in view code and
 assign it to siteroot.

Now there is still the problem that I need a view class that implements 
siteroot for every view that uses template.pt.
Or can I use a view class for the template itself? (tried but did not work).

Any other idea or do I don't really understand you?

Thanks,

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Still a skinning problem

2007-02-05 Thread Florian Lindner
Am Sonntag, 4. Februar 2007 22:20 schrieb David Johnson:
 I will wager to help...since frequently my posts go unanswered
 also.   I've implemented a few skins with great success.  However, if
 you wait long enough you could a real response from someone like
 Stephen instead of myself.

  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_urlhome/a
 
  do not work anymore, since context is the Blog and not a IXGM
  object anymore.
  Therefore the lookup fails.

 I do not understand this particular point clearly and this seems to
 be an important point.  Could you provide more specifics?  Sounds
 like you have a blog package installed.  The blog package has objects
 that you can create (presumably blogs and blog entries).   The
 objects have various views, which have links that are being inserted
 incorrectly?

 Can reply and provide an example URL to your object and its view?
 Can you also provide the actual HTML code that is being produced
 (just the bad HTML code) versus what you would like to see?

There is no HTML Code produced since the view fails with an error.
The template is the same that is used at http://xgm.de

I have two packages:

- IXGM is the one you can see at xgm.de at this moment. It provides a 
template.pt, the contact site, CSS ressources, ... It is also a container. IT 
also defines a IXGMSKin

- IBlog is a new package. It should not know of IXGM and should also be used 
independently. In my case it is contained in IXGM. Of course it should adapt 
the look and feel of IXGM when called with the ++skin++xgm traverser set and 
then it should be rendered with template.pt (what it actually does). And that 
causes the problem:

The line in the template.pt:
a tal:attributes=href context/@@index.html/@@absolute_urlhome/a
works fine as long as context is an IXGM, because index.html is registered for 
IXGM. But if a view from the IBlog is called is it also rendered in the 
template.pt but context now is a IBlog which does not have an index.html (or 
at leat not the one I want) and therefore fails.

I have uploaded both packages at 
http://xgm.de/staticfiles/skinning-problem.zip.

Thanks for help,

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Still a skinning problem

2007-02-04 Thread David Johnson
I will wager to help...since frequently my posts go unanswered  
also.   I've implemented a few skins with great success.  However, if  
you wait long enough you could a real response from someone like  
Stephen instead of myself.


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_urlhome/a

do not work anymore, since context is the Blog and not a IXGM  
object anymore.

Therefore the lookup fails.
I do not understand this particular point clearly and this seems to  
be an important point.  Could you provide more specifics?  Sounds  
like you have a blog package installed.  The blog package has objects  
that you can create (presumably blogs and blog entries).   The  
objects have various views, which have links that are being inserted  
incorrectly?


Can reply and provide an example URL to your object and its view?   
Can you also provide the actual HTML code that is being produced  
(just the bad HTML code) versus what you would like to see?


 
___

Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Still a skinning problem

2007-02-03 Thread Florian Lindner
Hello,
I am doing a repost here, since the problem really bugs me and I have gotten 
no replys anymore...

I have a template template.pt which should be applied to all site visited 
within the skin xgm.

page
for=*
name=standard_macros
permission=zope.Public
class=.views.StandardMacros
layer=xgm.interfaces.IXGMSkin
allowed_interface=zope.interface.common.mapping.IItemMapping
/

page
for=*
name=skin_macros
permission=zope.Public
layer=xgm.interfaces.IXGMSkin
template=template.pt
/

and

class StandardMacros(BaseMacros):
macro_pages = ('skin_macros', )


the template.pt is the one also used on xgm.de:

metal:block define-macro=page
metal:block define-macro=view

html xmlns=http://www.w3.org/1999/xhtml; xml:lang=de lang=de
  
head
title metal:define-slot=titleTesttitle/title
link rel=stylesheet type=text/css tal:attributes=href 
context/++resource++files/styles.css /
/head
  
body

ul id=navigation
li[ a tal:attributes=href 
context/@@index.html/@@absolute_urlhome/a ]/li

/ul

div id=content
metal:block define-slot=body
This is the content.
/metal:block
/div

/body
/html

/metal:block
/metal:block

(shortened a bit)


index.html is registered like that:

pages
for=xgm.interfaces.IXGM
layer=xgm.interfaces.IXGMSkin
permission=zope.Public
class=.views.ViewClass 

page
name=index.html
template=index.pt /

 /pages

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.

html metal:use-macro=views/standard_macros/view
  body
div metal:fill-slot=body
  h1 tal:content=context/title/h1
  div tal:content=context/description /

  div class=row tal:repeat=item view/getSortedBlogEntries
   tal:content=structure item/@@details.html /
/div
  /body
/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_urlhome/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.

Thanks,

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users