Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Bestpractice

Magnolia recommends using the Digital Asset Management module to manage binary assets such as images (videos and so on) by using the Assets app - 5 UI.

damfn templating functions let you access images stored in the DAM.

...

This approach is explained in more detail in working with images using damfn.

Storing in the same workspace with 

...

UploadField and imgfn

Info

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:

  • Use a Basic an upload field - 5 UI to  to store the image (the real binary data) on the workspace of your context. The system creates a subnode of the node of your context. For example, for a subnode of the component node or of a content item, the binary data is stored on a property of the subnode created.
     
  • In the template script, use imgfn to create an image link with the subnode.

...