Hi,
I am trying to create a SQL2 query that will find all of the adaptive image components that are being uses inside our vehicle detail templates.
Right now I have this as for my query.
SELECT * FROM [cq:Page] AS s WHERE ISDESCENDANTNODE([/content]) AND [jcr:content/cq:template] LIKE '/apps/gm/templates/vehicledetail'
but I am not sure how I can query the component into this.
Any suggestions?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @StrawHatM23
SELECT * FROM [nt:unstructured] AS node
node.[sling:resourceType] = 'gm/components/content/adaptiveimage'
Hi @StrawHatM23
SELECT * FROM [nt:unstructured] AS node
node.[sling:resourceType] = 'gm/components/content/adaptiveimage'
Hi @StrawHatM23,
Try executing below query, this helps to find all the pages created using vehicle detail template and having the adaptive image component in it.
select page.[jcr:path] from [cq:Page] AS page INNER JOIN [cq:PageContent] AS jcrContent ON ISCHILDNODE(jcrContent, page) INNER JOIN [nt:unstructured] AS child ON ISDESCENDANTNODE(child, jcrContent) where ISDESCENDANTNODE(page, '/content') and jcrContent.[cq:template] LIKE '/apps/gm/templates/vehicledetail' and child.[sling:resourceType] = 'project/components/adaptiveImage'
Hope this helps!!
@StrawHatM23 Did you find the suggestion helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies