Ahh now I got it! sure the locale can have a country code. What you would like
to do is to use the i18 content wrapper explicitly. Normally content passed to
the template is wrapped already and that is why content.title would for
instance load the property title_de if present. Nodes which are read directly
from JCR are normally not wrapped.
In templates you can use the cmsfn.wrapForI18n(node) function to add the
wrapper to a node. In case you use a template model I suggest to wrap the nodes
already in the model.
If the content object is of type ContentMap and not of type Node you need to
use cmsfn.asJCRNode(menuContent) first.
Here is what would work in your scenario I guess:
[#assign menuContent =
cmsfn.asContentMap(cmsfn.wrapForI18n(cmsfn.asJCRNode(menuContent)))]
${menuContent.navigationTitle}
I hope this solves your issue.
Philipp
> On 18 Mar 2016, at 15:11, Simon (via Magnolia Forums)
> <[email protected]> wrote:
>
> The wrapping is not the issue, that's just the way i18n works I believe.
> But what I did now was quite hacky but works:
>
> [code]
>
> [#assign currentLang = cmsfn.language () /]
>
>
> [#assign localNavigationTitle = "navigationTitle_"+currentLang]
> [#assign localTitle = "title_"+currentLang]
> [#assign strTitle =
> menuContent[localNavigationTitle]!menuContent[localTitle]!menuContent.navigationTitle!menuContent.title!menuContent.@name!""]
>
> [/code]
>
> --
> Context is everything:
> http://forum.magnolia-cms.com/forum/thread.html?threadId=6830c6dc-9892-42c5-945d-d9e4a4b8f3c8
>
>
> ----------------------------------------------------------------
> For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
> Alternatively, use our forums: http://forum.magnolia-cms.com/
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
Have a nice day!
Philipp Bärfuss / Advisor
[email protected]
Magnolia
Oslo-Strasse 2, 4142 Münchenstein (Basel), Switzerland
Office: +41 61 228 90 00 www.magnolia-cms.com
Register now for Magnolia Conference
San Francisco | May 10-11 2016
Basel | June 7-9 2016
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------