Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Which is the best way to display image using image component? From /content or from /dam path?

Avatar

Level 3

Hi all,

 

Which is the best way to display image using image component?  From /content or from /dam path?

 

/content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png
or /content/dam/project/test.png ?  I think by default, foundational image component uses the dam location. Where as core image component uses the /content location.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

Content path -/content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png

  • This will take care of serving images based on defined renditions without implementing any custom logic.
  • multiple cache for same assets based on page where is it used.

DAM Path - /content/dam/project/test.png

  • This will requires implementation serving images renditions based on DAM renditions.
  • 1 copy of cache

 

Both has advantages and disadvantages but surely you should go with /content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi,

Content path -/content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png

  • This will take care of serving images based on defined renditions without implementing any custom logic.
  • multiple cache for same assets based on page where is it used.

DAM Path - /content/dam/project/test.png

  • This will requires implementation serving images renditions based on DAM renditions.
  • 1 copy of cache

 

Both has advantages and disadvantages but surely you should go with /content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png

 

Avatar

Community Advisor

I would like to add one point here -

If I follow /content/project/en/home/_jcr_content/root/content/responsivegrid/image.coreimg.100{.width}.png content path, in that case the image gets saved at the page level rather than the DAM path , which makes it very hard to find in the future. Imagine now that the same high-res image is used in 10 places and, each time, users are uploading from their system: we are now stocking 10 images instead of saving it once in the DAM and referencing it 10 times.

 

Sharing following article: https://levelup.gitconnected.com/aem-forcing-the-use-of-the-dam-for-images-by-closing-loopholes-b102...