thisto access our fields by their reference names using dot notation. For example, the following will output the content from our Title field:
getMediaURL()call. This call returns the original media DAM URL to the file.
getMediaURL()call, we will need to add a 'download' query parameter to the media item URL. This can be achieved within the
hrefof the anchor tag. Below illustrates how to achieve this using our example file field:
getMediaURL()call on an image will return the original file without the default optimization provided by Zesty. Additional query parameters are needed to complete the syntax. These will be added to the
downloadattribute has been added to the anchor tags after the
href. It specifies that the target provided by the
hrefattribute will be downloaded when a user clicks on the hyperlink. This is necessary for each downloadable link created.
downloadattribute can also be provided an optional value, which will be the new file name after the item is downloaded. For example, we would like our image to download with the file name 'fan-art.jpg'. To do so, we would use the following syntax: