[opencms-dev] Extracting Copyright-value

Atle Enersen atle.enersen at gmail.com
Mon Dec 2 07:13:47 CET 2024


Thanks, Alex.

But I still have a problem I am afraid. I am not able to extract the actual path of the image, or the image name. Here noted as "path-to-your-image".

Alt godt/best regards, hilsen Atle Enersen. 
-- 
Telefon: +47 48 06 31 71 



Today's Topics:

1. Re: Extracting Copyright-value (Alex Kandzior)


You need to read the "Copyright" property from the file resource.

Traditional tag notation:
<c:set var="imageCopyright"><cms:property name="Copyright" file="%path-to-your-image%" default="" /></c:set>

More modern direct EL notation:
<c:set var="imageCopyright" value="${cms.vfs.readResource['%path-to-your-image%'].property['Copyright']}" />

For further inspiration, you may also look here (around line 230):
https://github.com/alkacon/mercury-template/blob/master/alkacon.mercury.template/resources/system/modules/alkacon.mercury.template/tags/image-vars.tag <https://github.com/alkacon/mercury-template/blob/master/alkacon.mercury.template/resources/system/modules/alkacon.mercury.template/tags/image-vars.tag> <https://github.com/alkacon/mercury-template/blob/master/alkacon.mercury.template/resources/system/modules/alkacon.mercury.template/tags/image-vars.tag> <https://github.com/alkacon/mercury-template/blob/master/alkacon.mercury.template/resources/system/modules/alkacon.mercury.template/tags/image-vars.tag>>




Kind regards,
Alex.




More information about the opencms-dev mailing list