[DOCU-1336] Doc for the template variant mechanism Created: 20/Feb/18  Updated: 30/Sep/19  Resolved: 30/Sep/19

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Neutral
Reporter: Julie Legendre Assignee: Unassigned
Resolution: Done Votes: 0
Labels: HowTo, outdated
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File productTeaser-component.ftl     File productTeaser-component.yaml     File productTeaser-componentJSON.ftl    
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Requested by jschulte
On https://documentation.magnolia-cms.com/display/DOCS56/How+to+get+content+as+JSON+-+an+overview#HowtogetcontentasJSON-anoverview-FreeMarkertemplate
Add the template variant mechanism approach. Namely that you can have multiple freemarker variants: one for html, one for json, etc.
The benefits are that you get proper preview and you don't need multiple templates.
See the files from Jan attached.

Also improve the content about variations on https://documentation.magnolia-cms.com/display/DOCS56/Template+definition



 Comments   
Comment by Antti Hietala [ 29/May/18 ]

Variations were documented in Magnolia 5.3 but then dropped. Please add the docs back if the mechanism still works. https://documentation.magnolia-cms.com/display/DOCS53/Site+definition#Sitedefinition-Variations

Use case:

When a visitor requests a site with a narrow-screen device such as a phone, any horizontally wide content doesn't fit on the screen nicely. As a developer, you have to do something about the non-fitting content. You have basically two options: 1) hide the content with CSS or 2) push it down to make the page longer. Magnolia gives you a third (3) option: you can create a template variation that doesn't render the extraneous content at all! Don’t render content that the user doesn’t need.

Comment by Julie Legendre [ 30/Sep/19 ]

In order to better focus our efforts on DOCU tickets that are still relevant and important, all tickets older than 18 months have been labelled as outdated and are being automatically closed.
If you think your ticket is still relevant and should remain open, please add a comment and set it back to open.

Generated at Mon Feb 12 01:17:14 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.