Comprehensive Explanation
Adobe Experience Manager provides the wcmmode object within HTL to identify the current Web Content Management rendering mode.
The wcmmode.edit property evaluates to true when a page is rendered in AEM's Edit mode. This enables developers to conditionally display authoring-specific markup without including that markup in normal published-page output.
The data-sly-test block statement evaluates a Boolean expression and renders its host element only when the expression is true.
The correct implementation is:
< p data-sly-test="${wcmmode.edit}" >
Hello World
< /p >
When an author opens the page in Edit mode, the paragraph is rendered. In other modes where wcmmode.edit evaluates to false, the paragraph is omitted.
Option A is incorrect because wcm.edit is not the documented HTL property for detecting the current authoring mode.
Option B is incorrect because wcmmode.editor is not the recognized mode property.
Adobe also documents wcmmode.preview for conditions that must apply specifically to Preview mode.
A common practical application involves displaying component placeholders when a component has no configured content. Such placeholders help authors identify and select components that would otherwise appear empty.
The wcmmode.edit condition is therefore the correct mechanism for rendering content exclusively in Edit mode.
Official Adobe Reference: Adobe Experience Manager Components — The Basics, Component Placeholders; Components Reference Guide — Authoring Mode.
Submit