user2896526
user2896526

Reputation: 11

Adobe CQ - Specify where JCR content is written (exact path)

I am trying to create a dialog that has an xtype of "textfield"...I need to specify that anytime the user updates this field it will always overwrite the same JCR content node.

I am including this component/dialog in multiple pages, so that the author can edit the text. The issue is that the text will be updated for that page. (because I am using a relative path).

What I need to happen...The content is updated and written to a central location so that no matter which page the user edits this text it will always update to a central location.

A real world example: We have modal dialogs that show throughout the site. Some of these dialogs are global. Out client has requested to have an edit option on any page that these dialogs show. The acceptance criteria is that they can edit on any page and that edit will be applied globally.

My problem is that I am not sure how to set the path that the text field will write to.

I am retrieving the content from here:

 <cq:include path="/content/jjj/en/misc/deviceoutmodal/jcr:content/buttontext1" resourceType="zig/components/text"/>

How can I write to the same path?

Upvotes: 1

Views: 1361

Answers (1)

anotherdave
anotherdave

Reputation: 6754

I think this would be best achieved with design dialogs — you can set a property based on the component (or template), which will then get used by every instance of that component.

The editor can edit the property when in Design mode, (or through the Designer as far as I remember). Design dialogs are created like regular dialogs but named design_dialog.xml. The example use-case that Adobe lists is for a logo component:

The Logo component displays the logo of the website Geometrixx. The logo image and the home link can be configured globally (same for every page of the website) so that every instance of this component is identical. Therefore a design dialog is needed to provide the image and path of the home link to the design of the corresponding Page. The Logo component is placed in the upper left corner of all pages on the website.

Upvotes: 1

Related Questions