Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

CSS gap when the component is locked in edit mode

Avatar

Level 4

I created a template with a layout container and included a text component in the template. I Added text to the component and locked the component since I want all the pages to import the same text. But when the pages are in edit mode, there is a huge gap between this text and the next component, however in preview this gap does not exist. How do I make sure the gap does not exist in edit mode as well. Attached are the screenshots for it.

EDIT mode

Edit mode.png

PREVIEW mode

Preview mode.png

Thanks for the help.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

This could be possible because edit mode contains extra DOM element to support editing and your UI code may be impacted by those although you can add extra classes in WCM edit mode  and with the help of extra classes you can handle it.

<div data-sly-test.author="${wcmmode.edit || wcmmode.design}" data-sly-unwrap></div>

<div class="row ${author ? author_row  : '' }">

  //

  //

</div>

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

This could be possible because edit mode contains extra DOM element to support editing and your UI code may be impacted by those although you can add extra classes in WCM edit mode  and with the help of extra classes you can handle it.

<div data-sly-test.author="${wcmmode.edit || wcmmode.design}" data-sly-unwrap></div>

<div class="row ${author ? author_row  : '' }">

  //

  //

</div>

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now