[MGNLSTK-616] Language switching links Created: 03/May/10  Updated: 23/Jul/15  Resolved: 23/Jul/15

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: templates
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Neutral
Reporter: Magnolia International Assignee: Unassigned
Resolution: Outdated Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File LanguageSwitchLinks.java     Text File LanguageSwitchLinks_4.5.java     Text File STK-langlinks.txt     XML File config.modules.billag-forum-poc.paragraphs.languageSwitchLinks.xml     XML File config.modules.extended-templating-kit.config.sites.billag-poc.templates.prototype.navigation.meta.paragraphs.languageSwitchLinks.xml     File languageSwitchLinks.ftl    
Issue Links:
supersession
is superseded by MGNLDEMO-67 When I browse the demo I can switch t... Closed
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

Since Magnolia/STK support multiple locales per site, it would be useful to provide a simple way for templates to display language switching links.

By adding the attached code to the default STK model classes, template scripts could then simply render the links with the following snippet:

<ul>
[#assign localizedLinks=model.localizedLinks!]
[#list localizedLinks?keys as lang]
  <li><a href="${localizedLinks[lang]}">${lang}</a></li>
[/#list]
</ul>

Note that the provided code is pretty much a hack, mimicing the same hack which i18nAuthoringSupport does; it should be marked as temporary and updated once we can update the i18nContentSupport API and link API to provide this in a cleaner way. (further issues should thus link to this one)



 Comments   
Comment by Magnolia International [ 26/Nov/10 ]

Here's another patch, meant to be used a paragraph in the meta-navigation area.

  • model class
  • ftl template
  • bootstrap file for paragraph definition
  • bootstrap file to allow the languageSwitchLink paragraph in metaNavigation
Comment by Philipp Bärfuss [ 18/Jan/11 ]

Thanks for the patch, now scheduling it for the over next bugfix release.

Comment by Petr Kadlec [ 05/Aug/12 ]

Added modified model class for magnolia 4.5

Comment by Gavan Stockdale [ 21/Nov/12 ]

See: http://wiki.magnolia-cms.com/display/WIKI/How+to+create+a+language+switcher+link?focusedCommentId=56368784&#comment-56368784

Generated at Mon Feb 12 07:28:45 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.