[opencms-dev] include tag problem

Christian Steinert christian_steinert at web.de
Sun Aug 13 19:03:11 CEST 2006


Y. Glebov schrieb:
> Hello, thanks for the answer, but still
> 
> I need to display a page in locale, that differs from locale of all other
> elements on this page, how can I define it?
> 
> Yuriy.
> 
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Pavel Peringer
> Sent: Saturday, August 12, 2006 2:42 PM
> To: The OpenCms mailing list
> Subject: Re: [opencms-dev] include tag problem
> 
> Hello
> 
> I am using param too with cms.include ("function" for tag <cms:include>):
> 
> Map params = new HashMap();
> params.put(name, value);
> cms.include(file, element, params);
> 
> in jsp get value with request.getParameter(name);
> 
> cms.getRequestContext().getLocale() returns locale defined on resource, 
> ie you have one english site so set property locale = en, another in 
> french so set locale = fr and cmsRequest returns this value, not 
> parameter value from parent jsp.
> 
> HTH
> 
> Pavel Peringer
> 
>> Hi guys.
>>
>> Have a little problem here.
>>
>> Have a template file that contains this lines:
>>
>> <cms:include page="../elements/promo_block.jsp">
>>
>> <cms:param name="__locale">en</cms:param>
>>
>> </cms:include>
>>
>> And element file that contains:
>>
>> org.opencms.jsp.CmsJspActionElement cms =
>>
>> new org.opencms.jsp.CmsJspActionElement(pageContext, request, response);
>>
>> String locale = cms.getRequestContext().getLocale().toString();
>>
>> out.println(locale);
>>
>> Locale appears not "en", and content from file is displayed in another 
>> language that English.
>>
>> Locale "en" properly added to locales list in config file.
>>
>> What's the problem?
>>
>> Thanks, Yuri.
>>

The alkacon docs have an example on this as part of the explanation of
cms:include. Quote:
_________________
<cms:include attribute="body">
    <cms:param name="__locale"><%= locale %></cms:param>
</cms:include>
___________________


c.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060813/b59a30f3/attachment.bin>


More information about the opencms-dev mailing list