Show content and DAM path in core button component link field | Community
Skip to main content
supriya-hande
Level 4
September 8, 2023
Solved

Show content and DAM path in core button component link field

  • September 8, 2023
  • 2 replies
  • 967 views

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:

 

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: 

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

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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/content/src/content/jcr_root/apps/core/wcm/components/commons/editor/dialog/link/v1/link/edit/.content.xml#L13C16-L13C83 

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

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
September 8, 2023

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/content/src/content/jcr_root/apps/core/wcm/components/commons/editor/dialog/link/v1/link/edit/.content.xml#L13C16-L13C83 

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
JeevanRaj
Community Advisor
Community Advisor
September 8, 2023

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.