Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

What populates the referece.json path?

Avatar

Level 2

Is there anyway to know what is running behind the scenes to generate the asset references for a page at the /libs/wcm/core/content/reference.json path? I'm looking for a way to show the Experience Fragment Variation title instead of the name since it only shows "master" for most of our Experience Fragments making it difficult to distinguish between all of the master variations. I have been able to modify the JS that created the Published References pane to display the path instead of the name, but ideally I'd like to modify what's being generated in the json for XF variations so that I could show "XF Name - master" instead.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Did you see any references from custom implementation listed in response object for this call - /libs/wcm/core/content/reference.json in browser network tab? If you see it listed in response, you may have to write some custom js to show those in the References page. 

 

There are a couple of custom reference providers in ACS Commons repo which you can refer for your implementation. 

DesignReferenceProvider.java

PagesReferenceProvider.java

View solution in original post

3 Replies

Avatar

Community Advisor

Yes. ActivationReferenceSearchServlet is collecting the references of the page being published, which uses the ReferenceProvider implementations to collect all the references. There are a bunch of implementations for the ReferenceProvider class, such as AssetReferenceProvider, PageTemplateReferenceProvider and etc. 

 

I see there is a reference provider for pulling in the Experience Fragment references - ExperienceFragmentsReferenceProvider which is part of the Experience Fragments bundle. I don't think you've access to this file to override, but you can try implementing a custom reference provider to read the information you want from XF to display in the references page.

 

Thanks,

Lokesh

Avatar

Level 2

Thanks, Lokesh! I looked at the one example I could find for creating a custom reference provider (https://aem4beginner.blogspot.com/reference-provider-for-aem-content) trying to add items to the existing xfreferences Reference or to a new one, and while I could see logs, I didn't see any changes in the output for the references pane. If you know of any other examples, that would be helpful, otherwise I think we'll have to stick with the path which is at least more helpful that the variation name alone.

 

Thanks,

Julia

Avatar

Correct answer by
Community Advisor

Did you see any references from custom implementation listed in response object for this call - /libs/wcm/core/content/reference.json in browser network tab? If you see it listed in response, you may have to write some custom js to show those in the References page. 

 

There are a couple of custom reference providers in ACS Commons repo which you can refer for your implementation. 

DesignReferenceProvider.java

PagesReferenceProvider.java