I need an AEM query to get all the assets which are being used by pages in the path /content/mycompany/companycom/en/legal-contacts. I don't want to write code, I am looking to handle this via query itself.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
@touseefk2181136 Try below query in Query builder
map.put("path", path); // The path where you want to search (e.g., "/content/mysite")
map.put("type", "dam:Asset"); // The node type you want to retrieve (e.g., dam:Asset)
map.put("1_property", "jcr:content/cq:tags"); // Property to check for tags (optional, remove if not needed)
map.put("1_property.operation", "exists"); // Operator for the property check (optional, remove if not needed)
map.put("2_property", "jcr:content/renditions/original/jcr:content/jcr:lastModified"); // Property to check for last modified date (optional, remove if not needed) map.put("2_property.operation", "exists"); // Operator for the property check (optional, remove if not needed)
map.put("orderby", "@jcr:content/jcr:lastModified"); // Order the results by last modified date (optional, remove if not needed)
http://localhost:4502/libs/cq/search/content/querydebug.html
@touseefk2181136 you don't we need to use query.. AEM have internal service to get images. See below link for reference:
@touseefk2181136 Try below query in Query builder
map.put("path", path); // The path where you want to search (e.g., "/content/mysite")
map.put("type", "dam:Asset"); // The node type you want to retrieve (e.g., dam:Asset)
map.put("1_property", "jcr:content/cq:tags"); // Property to check for tags (optional, remove if not needed)
map.put("1_property.operation", "exists"); // Operator for the property check (optional, remove if not needed)
map.put("2_property", "jcr:content/renditions/original/jcr:content/jcr:lastModified"); // Property to check for last modified date (optional, remove if not needed) map.put("2_property.operation", "exists"); // Operator for the property check (optional, remove if not needed)
map.put("orderby", "@jcr:content/jcr:lastModified"); // Order the results by last modified date (optional, remove if not needed)
http://localhost:4502/libs/cq/search/content/querydebug.html
Views
Likes
Replies