Hi Team,
I've developed custom component like the below, it's not showing the name of the component when we drag and drop. Like it should display like a Title component. In the below image the date picker should also come like title on page.
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Tessa_learner1 ,
Looks like you do not have any placeholder text display logic for your component.
You need to add a placeholder in your component HTL to display it. This will be displayed as default when nothing is configured in the dialog (which is the case when you first drag and drop)
You can use /apps/core/wcm/components/commons/v1/templates.html
<div data-sly-use.model="yourmodel"
data-sly-use.templates="core/wcm/components/commons/v1/templates.html"
<sly data-sly-call="${templates.placeholder @ isEmpty = ${model.isEmpty}, classAppend='cmp-text'}"></sly>
If there is no sling model for your component, you can check the property directly on HTL as well.
For reference implementation, you can check components like "/apps/core/wcm/components/text/v2/text"
Regards,
Nitesh
Hi @Tessa_learner1 ,
Looks like you do not have any placeholder text display logic for your component.
You need to add a placeholder in your component HTL to display it. This will be displayed as default when nothing is configured in the dialog (which is the case when you first drag and drop)
You can use /apps/core/wcm/components/commons/v1/templates.html
<div data-sly-use.model="yourmodel"
data-sly-use.templates="core/wcm/components/commons/v1/templates.html"
<sly data-sly-call="${templates.placeholder @ isEmpty = ${model.isEmpty}, classAppend='cmp-text'}"></sly>
If there is no sling model for your component, you can check the property directly on HTL as well.
For reference implementation, you can check components like "/apps/core/wcm/components/text/v2/text"
Regards,
Nitesh
Thank you so much for your reply. Yes I haven't added template and placeholder, after adding it I can able to view the component name as a placeholder.
Thank you.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies