Re: Extracting Copyright-value

Atle Enersen via opencms-dev <[email protected]> Mon, 2 Dec 2024 06:13:47 +0000
Newsgroups gmane.comp.cms.opencms.devel
Message-ID <VI1PR10MB206348E7B3E8AF7E67B82F64A9352@VI1PR10MB2063.EURPRD10.PROD.OUTLOOK.COM>
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&gt;>




Kind regards,
Alex.


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
https://lists.opencms.org/mailman/listinfo/opencms-dev