O'Reilly logo

Professional Plone Development: Building robust, content-centric web applications with Plone 3, an open source Content Management System by Martin Aspeli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

KSS-Enabling the “my cinema” Functionality

There is another piece of functionality that naturally lends itself to being KSS-enabled: the my cinema toggle button, shown on every cinema. Again, this is rendered by a viewlet. However, if the my cinema portlet is displayed, it may also need to be updated when the button is pressed.

The selector in cinemacontent.kss is simple:

#my-cinema-toggle input:click {
    evt-click-preventdefault: True;
    action-server: toggleMyCinema;
}

We have also added an ID, my-cinema-toggle, to the viewlet in browser/mycinema.pt.

The server-side action—the toggleMyCinema view—is again similar to the logic in the update() method of the corresponding viewlet. However, the KSS commands being sent back are a little more involved than ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required