Re: Hiding border / columns

"David Glick (Plone)" <david.glick-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
On 2/4/14, 2:22 AM, Anthony Gerrard wrote:
> 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)

I'm not quite following...How does this help?

>
> 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)

And why does this give you concerns about backwards-compatibility?


------------------------------------------------------------------------------
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
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.