How can I remove portlets in edit mode with Plone 4?

£可爱£侵袭症+ 提交于 2020-01-11 09:25:31

问题


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



来源:https://stackoverflow.com/questions/5872306/how-can-i-remove-portlets-in-edit-mode-with-plone-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!