products/CPSRSS

changeset 297:eb4d70018698 tip

Quickfix for the stock RSS portlet Make it work without switching to the new rendering engine
author Georges Racinet <georges@racinet.fr>
date Sat, 24 Jan 2015 01:21:22 +0100
parents 5295d67668b9
children
files browser/channels.py skins/widget_portlet_rss.pt
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/browser/channels.py
     1.2 +++ b/browser/channels.py
     1.3 @@ -60,6 +60,13 @@
     1.4          AqSafeBrowserView.__init__(self, *args, **kwargs)
     1.5          self.aqSafeSet('container', self.lookupContainer())
     1.6  
     1.7 +    security.declareProtected(View, 'setDataStructure')
     1.8 +    def setDataStructure(self, ds):
     1.9 +        self.datastructure = ds
    1.10 +
    1.11 +    def portlet(self):
    1.12 +        return self.datastructure.getDataModel().getObject()
    1.13 +
    1.14      def lookupContainer(self, cont_id=None):
    1.15          """Lookup the relevant container and set it up on self."""
    1.16          folder = self.context.aq_inner
     2.1 --- a/skins/widget_portlet_rss.pt
     2.2 +++ b/skins/widget_portlet_rss.pt
     2.3 @@ -2,6 +2,7 @@
     2.4                     export request/form/export|nothing;
     2.5                     portal here/portal_url/getPortalObject;
     2.6                     view nocall:portal/@@channels_restricted;
     2.7 +                   dummy python:view.setDataStructure(ds);
     2.8                     rssitems python: view.rssItems(cont_id='portal_rss',
     2.9                                                    **dict(ds))"
    2.10             condition="rssitems">
    2.11 @@ -17,7 +18,8 @@
    2.12          </li>
    2.13        </tal:block>
    2.14      </ul>
    2.15 -    <tal:block condition="rssitems">
    2.16 +    <tal:block 
    2.17 +               define="dm python:ds.getDataModel()">
    2.18        <metal:block use-macro="here/cpsportlet_macros/macros/xml_exports" />
    2.19      </tal:block>
    2.20    </tal:block>