Saturday, April 19, 2008

goodbye macros, hello content providers

i want to refresh main content area in plone with kss. but here comes the problem. you can only refresh content providers - viewlets, portlets - with kss. making another viewlet manager and then another viewlet inside is not smelling nice. for sure there must be a better way of doing this.

[1] after a day of browsing on the net i found the solution. creating another content provider and then calling it from where ever (eg. main_template) is so simple that i think plone developers should use it more often.

content providers = zope piece of content to be shown on a page.

EXAMPLE
how to create and register content provider. packages is called "garbas.firstpage".


then you simply call you provider from any other template using
< tal:replace="structure provider:garbas.firstpage.firstpage" /&rt;


next time i'll show how to benefit from using content provider with kss. stay tuned ...


[1] http://wiki.zope.org/zope3/FAQConfigurationAndSetup#how-can-i-register-a-content-provider-without-using-viewlet-managers

No comments: