Magnolia 6.0 reached end of life on June 26, 2019. This branch is no longer supported, see End-of-life policy.
This page describes how to handle images with Magnolia. This includes both storing the image or a reference to an asset with a dialog and rendering the image in a template script.
LinkField
and damfn
Manage your assets in one central location and reuse them in many different contexts. For example, you can add the same image to a page on your website or to a content item from a content app. To do so:
damfn
to create a link for an image based on the reference.This approach is explained in more detail in working with images using damfn.
BasicUploadField
and imgfn
imgfn
templating functions provide access to images stored in every workspace in the JCR.
You can store images in every workspace. Depending on your use case, you may prefer to store the image in the same workspace as other data in your context. For example, you want store images used on pages in the website workspace, or to store images for a specific content app in the specific content app workspace. With this approach you can publish all the content in one publish action. To do so:
imgfn
to create an image link with the subnode.This approach is explained in more detail in working with images using imgfn.