dotcom-rendering icon indicating copy to clipboard operation
dotcom-rendering copied to clipboard

Render Letters Byline On Editions

Open JamieB-gu opened this issue 3 years ago • 0 comments

When letters pieces have a proper byline, render that byline.

What are Letters pieces?

Represented by Design.Letter, and displayed using a specific letters layout on Editions. They are displayed using the same layout as comment pieces (Design.Comment) on apps and dotcom.

Examples can be found here: https://www.theguardian.com/tone/letters

When do they have a byline?

Typically letters pieces don't have a byline as such, they just have the word "Letters" in the byline field that we get from CAPI. There are often several short letters, written by multiple people, combined into one article. Sometimes the names of these people are in the standfirst, in bold text.

Occasionally, however, letters pieces do come with a byline. A common example is obituary letters (see #5628 for more information on these): https://www.theguardian.com/tone/letters+tone/obituaries

What's happening on Editions?

On dotcom and apps it doesn't matter if the byline field just says "Letters"; both render it as though it were a normal byline containing just that word. However, the Editions designs for letters say we shouldn't render a byline field for letters, because we already make it clear it's a letters piece elsewhere (kicker).

Unfortunately, as mentioned above, sometimes letters pieces do come with a normal byline (containing the names of authors). This isn't rendered at the moment, and the Editions production team are working around it by adding the byline to the article's trail text in fronts, which also overrides the standfirst in the article on the Editions app.

How do we simplify this?

While using the trail text override is a possible solution, we may be able to have the platform handle this to save the production team the extra work. We could, for example, choose to render the byline on letters pieces, but only if it's not the string "Letters". The relevant component is here:

https://github.com/guardian/dotcom-rendering/blob/1be769c18136cab1785e93fec513a00e95ccd8ad/apps-rendering/src/components/editions/header/index.tsx#L232-L240

JamieB-gu avatar Aug 08 '22 17:08 JamieB-gu