diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/main_template.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/main_template.xml
index 865ab98f7a249c278051dd28940aafe0c3ee13ea..9260f65348c0c397bfbdc3fe87b662f6710fdb47 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/main_template.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/main_template.xml
@@ -86,8 +86,8 @@ IDEAS:\n
    tal:define="ignore_layout          request/ignore_layout | nothing;\n
                layout_form_id         here/getApplicableLayout | nothing;\n
                layout_form    python: layout_form_id and getattr(here, layout_form_id, None) or None;\n
-               is_web_mode    python: (layout_form and not ignore_layout) and True or False;\n
-               editable_mode  python: not layout_form and True or ((not (not(hasattr(context.REQUEST, \'editable_mode\')) or not(context.REQUEST[\'editable_mode\']))) or ignore_layout);\n
+               is_web_mode    python: (layout_form is not None) and (not ignore_layout);\n
+               editable_mode  python: (not is_web_mode) or request.get(\'editable_mode\', 0);\n
                dummy          python: request.set(\'editable_mode\', editable_mode);\n
                page_template  python: is_web_mode and ((layout_form.meta_type==\'Page Template\' and layout_form.id) or getattr(layout_form, \'pt\', None)) or \'template_erp5_xhtml_style\';">\n
     <tal:block metal:use-macro="python: getattr(here, page_template).macros[\'master\']">\n
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
index 02225a563f9711d2f3a52d071d1249ed9f2dea93..2a14d60899b5ce63b22aa762057236cb35531a10 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
@@ -1 +1 @@
-268
\ No newline at end of file
+270
\ No newline at end of file