[Zope3-dev] invoking method in skins

dev at projekt01.ch dev at projekt01.ch
Mon Jul 3 11:00:50 EDT 2006


Hi Roy

[...]
> 
> Folks,
> 
> I have two skins - A and B, where B extends A. Both A and B 
> have the same named attribute "methodOne".

I guess you mean view "methodOne" and not attribute
which is registred as a page or view in ZCML. right? 

> I find that from within another method template 
> (/++skin++B/obj/@@methodFive), if I invoke "view/methodOne", 
> the method invoked is /++skin++A/obj/@@methodOne, not skin 
> B's. Is there a way to get to B's methodOne?

Try this:

/++skin++B/path/to/obj/@@methodOne

probably it's not a good idea becaues you need to apply the
skin after the site root.

I think it's not a good Idea to call views from a different
skin in another skin. Or are you looking for a skin switcher?
There is a method called applySkin which will switch a skin

If you really need to do this, you can switch the skin call 
the method and switch the skin back in a python method registred 
as a view.

I recommend to register the two different methods under 
different names if you don't use a "skin switcher".

Regards
Roger Ineichen
_____________________________
END OF MESSAGE



More information about the Zope3-dev mailing list