Hiding border / columns

Anthony Gerrard <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <CAHA8JiTXPY6OQ0ukVbFmXeCX1JY9tTpDBiRkrDMoPwRvn1cL1w@mail.gmail.com>
I just working through a Plone 3.3->4.3 upgrade for one of my clients.
 They require the navigation to be present on the sitemap and search
results pages.  To enable this we need to override the relevant template
and remove the following...

tal:define="dummy python:request.set('disable_border',1);
                             disable_column_one
python:request.set('disable_plone.leftcolumn',1);
                             disable_column_two
python:request.set('disable_plone.rightcolumn',1);"

It feels to me there must be a friendlier way to hide the columns where you
don't have to copy-paste entire templates but instead override the view
class.  You could obviously move the code into the view class but how much
do we care about backwards compatibility?

I could achieve this by tweaking the code in
plone.app.layout.globals.layout.LayoutPolicy

        force_disable = self.request.get('disable_' + manager_name, None)
        if force_disable is not None:
            return not bool(force_disable)

to something like (untested but you get the idea)

        force_disable = self.request.get('disable_' + manager_name, None)
        override_disable = self.request.get('override_disable_' +
manager_name, False)
        if force_disable is not None:
            if bool(force_disable) and bool(override_disable):
                return True
            return not bool(force_disable)

Alternatively if we don't care about backwards compatibility we can move
the code to the view class

    def __call__(self):
        self.request.set('disable_border', True)
        self.request.set('disable_plone.leftcolumn', True)
        self.request.set('disable_plone.rightcolumn', True)

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk

_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.