0
votes

I'm developing components on adobe cq5 and need some help/advice. I would like to create a phone number component part of which uses phone number prefixes. I want a page author to be able to set the range of prefixes (i.e. they need to be content managed), but I don’t want them to have to re-specify this list every time they add a phone number component. The list of prefixes needs to be globally maintained not component level properties. I know how to set and use component level properties but not global ones. Can someone tell me how or point me in the right direction of an example?

3

3 Answers

1
votes

Have you thought about using design dialog instead of edit dialog? This can solve your problem. There is some info regarding this topic.

1
votes

Part of the creation of a dialog is that you are assigning a name which provides the dialog the understanding of where you want to store the values.

This is usually in the form of ./foo what people forget is that the name field is a path specification. You could equally specify a name of /global/data/phoneprefixes which would provide the feature that you are looking for.

To then use this data, from your code, you would need to look in the same place. The properties object wouldn't have it at this point since it's only providing the relational properties of the resource you're on.

0
votes

If you can't use design dialog for any reason i think the other option could be using the Reference component.

https://docs.adobe.com/docs/en/aem/6-0/author/page-authoring/default-components/editmode.html#Reference