Andres Moya wrote:

>Hello.
>
>I'm writing a CPSSkins theme for using into a Plone site. The question is that 
>I
>need that in some slots there appear some dynamic content, i.e. some 
>information
>fetched from the Zope database. I just have the TAL code that obtains the
>content, it's now in one METAL macro (although i could easily move it to its
>own template or to a script or method).
>
>But I haven't found any way to call it from the CPSSkins theme, none of the
>available templets allows me to put dynamic content inside. With the Text Box,
>for example, I can write static html, but it ignores the TAL tags.
>
>I'm trying to write my own templet following the tutorial on
>http://www.medic.chalmers.se/~jmo/CPS/CPSSkinsTutorial0.2.tgz. I have written
>the templet, and i'm able to install it into the plone site, with no error
>messages, but when I try to add it to the skin, it does not appear in the
>templets list. And the tutorial itself also don't work, I have a KeyError
>'options' when i try to edit the style.
>
>Before I continue trying to make this work, i'd ask if there is an easier way 
>to
>put a piece of TAL code inside a skin.
>
>BTW, i'm using Zope 2.7.6, Plone 2.0.5 and CPSSkins 2.3.3. I can't upgrade to
>newer versions or change to another tools because my project is very advanced,
>we are almost in the deadline and it's not time to make drastic changes.
>
>If there is no easy way, i can modify main_template.pt in cpsskins_plone2 skin,
>but i think this is a dirty solution, there should be a better approach.
>
>Thanks.
>
>  
>


Hi!

This is currently done using a Custom Portlet under CPSPortlets, but
this won't work in Plone. I'm going to take a look at the tutorial code
and update it. It is apparently out of sync with CPSSkins 2.3.3, but the
changes are quite small.

You can in the meantime look at the code of for instance the TextBox
Templet, and create a new Templet but instead of having:

render_method = 'cpsskins_textbox'

you could write

render_method = 'my_zpt'

and my_zpt will be rendered

or add a render() method in your class:

    security.declarePublic('render')
    def render(self, **kw):
        return self.my_zpt()

regards /JM


_______________________________________________
cps-users mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/cps-users

Reply via email to