[opencms-dev] coding question param.value vs. cms.element.settings['']
Filip Kratochvil
filip.kratochvil at nelasoft.cz
Mon May 2 14:33:44 CEST 2016
Hi Chris,
i hink it’s better to use your second example:
${cms.element.settings['setting_name']}
http://documentation.opencms.org/opencms-documentation/demos/element-settings/index.html
1. define settings in xmlcontent’s formatter config
2. read settings value
--
How request parameters works?
You can read param value from URL query string, example:
www.domain.com/abou-us/?key=value
${param.key} = value
You can send param value to JSP using dynamic function:
http://documentation.opencms.org/opencms-documentation/content-in-opencms/special-predefined-content-types/dynamic-functions/index.html
You can send param value to JSP using JSP include, example starts at line 102:
https://github.com/alkacon/modules-v8/blob/branch_8_5_x/modules/com.alkacon.opencms.v8.list/resources/system/modules/com.alkacon.opencms.v8.list/formatters/center.jsp
--
S pozdravem / Kind regards
Filip Kratochvil
------------------------------------------------
NELASOFT Technologies, s.r.o.
E-mail: <mailto:filip.kratochvil at nelasoft.cz> filip.kratochvil at nelasoft.cz
Web: <http://www.nelasoft.cz/> www.nelasoft.cz
Twitter: <https://twitter.com/NELASOFT> @NELASOFT
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Christoph Kukulies
Sent: Monday, May 2, 2016 12:21 PM
To: The OpenCms mailing list
Subject: [opencms-dev] coding question param.value vs. cms.element.settings['']
I have the following code in a formatter:
<h3>
${content.value.Title}
</h3>
<c:set var="showdate"><c:out value="${param.showDate}" default="true" /></c:set>
<c:if test="${showdate}">
<p><i><fmt:formatDate value="${cms:convertDate(content.value.ProjektDatum)}" dateStyle="LONG" type="date" /></i></p>
</c:if>
<p>${content.value.Text}</p>
vs.:
<c:if test="${cms.element.settings['enable_untertitel']}">
<h3 class="post-title" ${content.rdfa.Title}>
${content.value.Title}
</h3>
</c:if>
Actually, what I want to achieve is to make the output of the date dependent on the widget setting "showDate".
But just for the understanding: where is param.showDate wired resp. how does it function?
--
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20160502/bb0c6568/attachment.htm>
More information about the opencms-dev
mailing list