Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
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>



Arun Patidar

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>



Arun Patidar