[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: |
|
||||||||
| Issue Links: |
|
||||||||
| 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.
|
| 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 ] |