Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-115828

As a developer I want to know in a fragment if I am in edit mode

    Details

    • Type: Feature Request
    • Status: Needs More Information
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Fragments Toolkit
    • Labels:
      None

      Description

      Currently there seems to exist no nice way to detect in a fragment if the page is in edit mode or in view mode.

      In Javascript you can at least check "document.body.classList.contains('has-edit-mode-menu');" but I really dislike that I should have to check if the body tag has a specific styleclass (which I have to hardcode) in a fragment.

      Please provide:

      • A way to check in freemarker if the page is in edit mode.
      • A nice, reliable way to check in javascript, if the page is in edit mode.

      Note: It might also be worthwile to be able to check if the fragment itself is currently edited by a developer. The developer could add extra debug information or call mock interfaces in that case.

      For that reason, a getMode() method like in FragmentRendererContext would be convenient.

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            crabel Christoph Rabel
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Packages

                Version Package