Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Show content and DAM path in core button component link field

Avatar

Level 4

Hello All,

 

Core button component Link field is of type: granite/ui/components/coral/foundation/include 
When we author button path it only shows content pages like below:

supriyahande_0-1694163762465.png

 

We have a requirement to show both content and DAM path here. I tried adding jcr property nodeTypes="dam:Asset, nt:file, cq:Page" to link field but its not working. I saw Richtext component pathfield shows both content and DAM path as below: 

supriyahande_1-1694164016271.png

We want something like this. Is this possible in Core Button v2 component?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @supriya-hande 
The type itself says pagefield, so you can't fetch the assets.

https://github.com/adobe/aem-core-wcm-components/blob/e8fc23acf252384ded026c59a142ddd905ab306a/conte... 

sling:resourceType="cq/gui/components/coral/common/form/pagefield" 

 

you can extend button and link component and change the type to formal pathfield and use new link type



Arun Patidar

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @supriya-hande 
The type itself says pagefield, so you can't fetch the assets.

https://github.com/adobe/aem-core-wcm-components/blob/e8fc23acf252384ded026c59a142ddd905ab306a/conte... 

sling:resourceType="cq/gui/components/coral/common/form/pagefield" 

 

you can extend button and link component and change the type to formal pathfield and use new link type



Arun Patidar

Avatar

Community Advisor

This is currently an open issue.(#1333 and #2265)

 

'nodeType' property will work in Pathfield. So possible solution would be to use Pathfield(granite/ui/components/coral/foundation/form/pathfield) instead of Pagefield.