plone / bobtemplates.plone

Python Code Templates for Plone Projects with mr.bob
https://pypi.org/project/bobtemplates.plone/
GNU General Public License v2.0
24 stars 31 forks source link

Add a `msg` funtion to the view python class (e.g. as follows): #496

Open me-kell opened 2 years ago

me-kell commented 2 years ago

The template and view in bobtemplates/plone/view/views are not working together.

The template uses <p tal:content="view/msg">this gets replaced</p> but there is no msg function in the view class.

Add a msg funtion to the view python class (e.g. as follows):

def msg(self):
    return "msg from '%s'" % {{{ view_python_class_name }}}

An alternative would be to remove <p tal:content="view/msg">this gets replaced</p> from the template.

I'd prefer adding the msg function.