Discussion:
[Erp5-dev] How to call view() on arbitraly chosen portal skin?
Jacek Medrzycki
2007-10-02 14:05:12 UTC
Permalink
Hi

When I call object.view(), i get rendered form for the view action of
the object.

But I want it to be rendered not with the default View skin selection,
but on specified one. That is, I want to simulate the call:
/some/object/path/view?portal_skin=SkinName
but from the code of Zope product.
I tried:
object.view(portal_skin='SkinName')
but it doesn't work.

How can I do this?

Regards
Jacek
bartek
2007-10-02 14:17:46 UTC
Permalink
Post by Jacek Medrzycki
Hi
When I call object.view(), i get rendered form for the view action of
the object.
But I want it to be rendered not with the default View skin selection,
/some/object/path/view?portal_skin=SkinName
but from the code of Zope product.
object.view(portal_skin='SkinName')
but it doesn't work.
How can I do this?
If you want it work exactly this way, use skin layers - by default,
there are View, Print and CSS skin. You can add your own, the tricky
part of it was discussed on this list about a month ago.

But maybe a better solution would be to define additional action on
portal type, with a condition, and give it a priority lower then 1.0, so
that it is checked and possibly called before the default View action.

Bartek
Post by Jacek Medrzycki
Regards
Jacek
_______________________________________________
Erp5-dev mailing list
Erp5-dev at erp5.org
http://mail.nexedi.com/mailman/listinfo/erp5-dev
--
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"
Jacek Medrzycki
2007-10-02 14:38:50 UTC
Permalink
Post by bartek
If you want it work exactly this way, use skin layers - by default,
there are View, Print and CSS skin. You can add your own, the tricky
part of it was discussed on this list about a month ago.
I want to do exactly like that - i've got my own skin layer - and I want
to call object.view() on specified skin layer.
I other way, it should work like specifying portal_skin=SomeSkin in url,
but should be called from the code!
instead of:
http://blebleble/erp/some_module/some_object/?portal_skin=SomeSkin
(which of course works)
I want to invoke
portal.some_module.some_object.view()
and but on specified skin layer.

J.
Jérome Perrin
2007-10-02 16:06:13 UTC
Permalink
Post by Jacek Medrzycki
I want to invoke
portal.some_module.some_object.view()
and but on specified skin layer.
Hi, try this:

portal.changeSkin('SomeSkin')
portal.some_module.some_object.view()

J?rome

Loading...