[opencms-dev] Extracting Copyright-value
Alex Kandzior
alex at opencms.org
Mon Nov 25 12:39:04 CET 2024
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
Kind regards,
Alex.
-------------------
Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org
> Am 25.11.2024 um 10:28 schrieb Atle Enersen via opencms-dev <opencms-dev at opencms.org>:
>
> Hello.
>
> I can find the title of a page using:
>
> <title><c:out value="${cms.title}" /></title>
>
> But I cannot find any way to extract the value of the Image-property of a regular Image object. I have consulted the documentation but found nothing. The image itself works and are displayed ok.
>
> Can anyone help?
>
> Here is the extracted definition from the xsd:
>
> <xsd:complexType name="OpenCmsEnersenArticleSimple">
> <xsd:sequence>
> <xsd:element name="ImageTop" type="OpenCmsVfsFile" />
> </xsd:sequence>
> <xsd:attribute name="language" type="OpenCmsLocale" use="required"/>
> </xsd:complexType>
>
> <Setting>
> <PropertyName>ImageTop</PropertyName>
> <Widget>imagegallery</Widget>
> <WidgetConfig>{useformat:true}</WidgetConfig>
> <Search>false</Search>
> </Setting>
>
> Alt godt/best regards, hilsen Atle Enersen.
> --
> Telefon: +47 48 06 31 71
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20241125/6fc5152d/attachment.htm>
More information about the opencms-dev
mailing list