How can I remove portlets in edit mode with Plone

2020-04-08 12:25发布

问题:

I'm used to achieve this under Plone 3 by override base_edit.cpt file under portal_skin and make columns empty:

  <metal:head fill-slot="column_one_slot"></metal:head>
  <metal:head fill-slot="column_two_slot"></metal:head>

I have tried to achieve this with Plone4 and the result is quite weird: I have two empty columns and the edit mode doesn't stretch (stay in the middle of the page).

回答1:

In Plone 4 you can disable the columns by setting a couple variables on the request:

<metal:override fill-slot="top_slot"
    tal:define="disable_column_one python:request.set('disable_plone.leftcolumn',1);
                disable_column_two python:request.set('disable_plone.rightcolumn',1);"/>


回答2:

I think that's because plone 3 used tables as core page structure while plone 4 uses sunburst that uses Deco GS.

Probably the fastest way (not THE way :P) is to force the width of the columns trough CSS (you can push CSS using style_slot into base_edit.cpt).

Anyway, I see in

./plonetheme.sunburst-1.0.3-py2.6.egg/plonetheme/sunburst/skins/sunburst_templates/main_template.pt

that columns class/width should be calculated by getColumnsClass of sunburst_view. Probably is a bit buggy (I didn't debug it though).

HTH



标签: plone