Child pages
  • [cms] The "EDITING_MODE" constant not available before template rendering [5.2.2-B2]
Skip to end of metadata
Go to start of metadata

The CMS part of In-Portal introduces "editing mode" term, which can be any of:

Editing ModeNameMeaning
empty stringunspecified
  • regular user accessed is browsing website
  • all content editing functions disabled
1Browse Mode
  • administrator is browsing through website as regular user
  • all content editing functions disabled
2Content Mode
  • administrator is browsing through website as regular user
  • allows editing page properties in general
  • allows editing of CMS blocks on the page
  • allows editing of phrases on the page
3Design Mode
  • administrator is browsing through website as regular user
  • allows editing page properties in general
  • allows editing template content of the page
  • allows editing drag-n-drop of blocks on the page

The developers can determine which (if any) editing mode is active currently by checking "EDITING_MODE" constant value.

This constant however is only defined just before page content is generated, which makes it impossible to access it from hooks to "adm:OnStartup" event and such.

Solution

  1. move code for setting "EDITING_MODE" constant from "kApplication::Run" method into after hook to "adm:OnStartup" event
  2. locate places, where "EDITING_MODE" constant is used not while on Front-End and add extra defined('EDITING_MODE') check in there

Related Discussions

Related Tasks

INP-1666 - Getting issue details... STATUS