Render Obituary Letters As Letters
We probably want to render pieces that are letters about obituaries using a letters layout rather than an obituaries layout.
What are Letters and Obituaries?
- Letters
- Represented by
Design.Letter, and displayed using the same layout as comment pieces (Design.Comment) on apps and dotcom. - Obituaries
- Represented by
Design.Obituary, and displayed using the same layout as standard articles on apps and dotcom.
Examples of letters: https://www.theguardian.com/tone/letters Examples of obituaries: https://www.theguardian.com/tone/obituaries
What are Letters about Obituaries?
Sometimes there are letters about (or which are themselves?) obituaries, which are given both the tone/letters and the tone/obituaries tag. These can be seen in the "Letters" section on the obituaries page linked above, and also here: https://www.theguardian.com/tone/obituaries+tone/letters
Whilst these are related to obituaries, they are primarily letters, and should probably have the same design treatment as other letters pieces.
How do we change this?
DCR uses the CAPI client to parse CAPI data into the Format type, which in turn is used to determine how an article should look. For both obituaries and letters the tone tag is used, and the current parsing logic prioritises obituaries over letters:
https://github.com/guardian/content-api-scala-client/blob/8ebb4296c3f417d3e3a478d02bb10f40b7661954/client/src/main/scala/com.gu.contentapi.client/utils/CapiModelEnrichment.scala#L103-L106
Therefore anything that has both tags will be parsed as an obituary. Changing the order of the checks to prioritise letters instead should solve this.
@ajbreuer @HarryFischer does this sound correct to you?
@DanielCliftonGuardian can this be closed given the linked change to the Scala client and the fact that I think frontend picked up these changes in https://github.com/guardian/frontend/pull/25411?
This has been resolved with https://github.com/guardian/content-api-scala-client/pull/364