wellcomecollection.org
wellcomecollection.org copied to clipboard
Use variations for ContentLists
ContentLists be made into slice variations, so their layout can be decided in Prismic. We then wouldn't need to render it separately from the rest of the Body in the AdditionalContent component and can simplify the code.
Background
What is AdditionalContent used for? The AdditionalContent component is used to shoehorn content, that can't/shouldn't be added as a slice, into the component, so that it can be rendered among the body slices.
It can display 3 things:
Any static content that belongs on the page. This is only use by the /collections and /visit-us pages.
On /collections page it is used to display the search form.
On the /visit-us page it is used to display the address and opening times.
The OnThisPageAnchors if they are required. These show if the showOnThisPage is set to true in Prismic and there are more than 2 links to display.
If the page is a landing page, then we display the content from ContentList body slices here (with a bespoke layout) and don't render them as part of the body. Where we do this:
Visit us /pages/X8ZTSBIAACQAiDzY Library facilities - not used for Additional content in this way Get involved /pages/YDaZmxMAACIAT9u8 Young people /pages/Wuw2MSIAACtd3Ssg Collections /pages/YBfeAhMAACEAqBTx About us /pages/Wuw2MSIAACtd3Stq - not used for Additional content in this way
N.B. AdditionalContent may not be the appropriate name for this. I think originally it was used only for the static content, but it's role has expanded.
Where/how is it rendered? The AdditionalContent is rendered one of two ways.
If there is no body content, then it is rendered straight to the page.
If there is body content it is rendered inside the body.map(). This is because we want it to appear beneath FeaturedText, if there is any FeaturedText. This is being refactored in #10773, so we don't need to render it inside the body.map()