Expand my Community achievements bar.

SOLVED

AEM 6.1 Sightly Initial Display Then Hide

Avatar

Level 1

Hello I am new to AEM, and Sightly. I have a questions regarding, Sightly and AEM.

So I have created a component that display data based on the 2 inputs, when I drag-and-drop the component to the page I am looking for initial TEXT to appear and then when I double click and edit the component that text will disappear.

Thank you ahead of time,

-T

1 Accepted Solution

Avatar

Correct answer by
Level 8

You can check to see if a property exists and display default text if it does not.

<h1>${properties.text ? properties.text : 'Use Dialog to Enter Text'}</h1>

Edit:

This can actually be achieved with less code.

<h1>${properties.text || 'Use Dialog to Enter Text'}</h1>

View solution in original post

4 Replies

Avatar

Correct answer by
Level 8

You can check to see if a property exists and display default text if it does not.

<h1>${properties.text ? properties.text : 'Use Dialog to Enter Text'}</h1>

Edit:

This can actually be achieved with less code.

<h1>${properties.text || 'Use Dialog to Enter Text'}</h1>

Avatar

Level 10

Hi Tony,

I presume you are looking for default or initial text in dialog box textfield. You can use emptyText

Documentation

Avatar

Level 1

I have used emptyText and defautlValue and nothing worked. The above comment from leeasling, worked perfectly.

Avatar

Level 1

leeasling wrote...

You can check to see if a property exists and display default text if it does not.

  1. <h1>${properties.text ? properties.text : 'Use Dialog to Enter Text'}</h1>

 

 

Worked perfectly. Thank you a quick response.