In Sightly/AEM6, when including a parsys component, how can I set the text that says 'Drag Components Here' (cq:emptyText) to use a localised string? I have several parsys components as children of a custom component and need different text for each (e.g. Drag image components here, drag link components here).
Asked
Active
Viewed 5,851 times
5
-
I also faced a similar issue and after finding no suitable answers anywhere, decided to do my own solution and wrote a detailed blog entry explaining it: https://scribcopia.wordpress.com/2017/08/13/customizing-text-within-parsys-touch-ui/ – TechNiks Aug 13 '17 at 20:08
3 Answers
2
Unfortunately it seems to be hard coded to use a specific I18n string, in /libs/cq/gui/components/authoring/clientlibs/editor/js/model/Inspectable.js
However, I was able to override the parsys control and change the CSS classes of the newpar from new section
to cq-placeholder section
and then include data-emptytext="Custom text"
on the same html element.

Alasdair McLeay
- 2,572
- 4
- 27
- 50
-
Would you be able to post some code details? I'm trying to do the same thing, and I haven't found a way to get data attributes on the "new" div. – joelt Sep 15 '15 at 13:59
1
in CQ5.6 we can do the following, maybe it works with AEM 6:
- inherit your component from /libs/foundation/components/parsys
- add a node which name is 'new' under your component node, which sling:resourceType is foundation/components/parsys/new or just copy the /libs/foundation/components/parsys/new
- add cq:emptyText property to this node, which is the text appear in the box.

nerd
- 837
- 6
- 21
-
the new Sightly parsys is at /libs/wcm/foundation/components/parsys, it has a child component at /libs/wcm/foundation/components/parsys/newpar. Unfortunately inheriting this componenent and setting cq:emptyText does not work, I guess it's stored somewhere else now – Alasdair McLeay Jul 30 '14 at 15:32
-
you'll need to inherit both, the parsys and the newpar and in the parsys, you need to reference your newpar. – Thomas Aug 04 '14 at 13:23
0
See the following code:
<div id="myTabContent" class="tab-content" data-sly-list="${properties.titles}">
<div data-sly-test.resourcePath1="${'{0}{1}' @ format=['tab',itemList.index]}" class="${itemList.index != 0 && wcmmode.isPreview ? 'tab-pane fade' : 'tab-pane fade in active'}" id="${item}">
<div data-sly-resource="${ resourcePath1 @ resourceType='wcm/foundation/components/parsys/newpar'}" class="cq-placeholder section" data-emptytext="${item}'s content"></div>
</div>

Cody Gray - on strike
- 239,200
- 50
- 490
- 574