Re: [Zope3-Users] Still a skinning problem

2007-02-07 Thread David Johnson
I'm not sure if you're familiar with viewlets, but that might be a  
solution for you here also.


On Feb 6, 2007, at 8:05 PM, Florian Lindner wrote:


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:
home

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:

home


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



___
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:
> > home
> > 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:
>
> home
>
> 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-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:
home
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:

home

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-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
> >
> > home
> >
> > 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:
home
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

home

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