I have a composite component consisting of three included components an image a title and a text component. Normally since the title component inherits the `wcm/foundation/components/title` the data-sly-resource included component gets the title type option (h1,h2...) from it's parent. However for this specific composite component I want to limit the type option to just have h2 available. The Title component is included in the composite component like this:
<div data-sly-unwrap="${!wcmmode.edit}" data-sly-resource="${'title' @ resourceType='project/components/generic/title'}"></div>
This allows the content editor to edit the title in place.
My question is if it would be possible in some way to place cq:dialog restrictions on the title component that is included from the composite component to just allow the content editor to select h2?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Yes ,we do the same approach as Scott suggested.
First copy the JCR Dialog from the title component to your new component and modify according as per your requirement.
Hope this helps!!
Thanks,
Ratna Kumar.
Views
Replies
Total Likes
Hi,
If you need any variation to the existing component, you can overlay that component and create a new one and then use it.
else you may have to write some listeners to handle these restrictions at different places which personally I don’t prefer as it increases the complexity of a component and also it’s maintenance.
thanks
Views
Replies
Total Likes
this would also mean that I have multiple title components which do nothing but restrict the cq dialog options and would in my opinion also create complexity
Views
Replies
Total Likes
I also prefer the 1-1 approach. Each component has its own JCR branch that defines a dialog. This makes it easy to control which fields are used in a component dialog. As Lokesh mentions - if you want to do more complex stuff - you can write event listeners, etc.
Views
Replies
Total Likes
In my usecase, since H1-H5 styles are managed in styleguide, we use Generic Lists from ACS common to manage these lists. We created various variations based on the component context definitions (hero components title -> h1- h5, banner components - h2->h5 etc)
Views
Replies
Total Likes
when you say 1 on 1 approach how would you suggest doing this efficiently with as little duplication as possible ? for this instance with a title component
Views
Replies
Total Likes
Copy the JCR Dialog from the the title component to your new component. Then make the modifications under your new component's dialog JCR nodes. That is the best way in my view. It works and cuts down on complexity.
Views
Replies
Total Likes
Hi,
Yes ,we do the same approach as Scott suggested.
First copy the JCR Dialog from the title component to your new component and modify according as per your requirement.
Hope this helps!!
Thanks,
Ratna Kumar.
Views
Replies
Total Likes
Views
Likes
Replies