-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prismic slice machine work #10789
Comments
Notes I've made that will be relevant to some of the above issues (will add to the appropriate tickets when they are created) Notes on Body.tsxFiltering body slicesWe filter out slices of type standfirst. We do this because we pull these out so we can display them separately from the rest of the body and we don't want to then replicate the content when we do render the body. We filter out slices of type picture (type of editorialImage before it gets transformed) with a weight of featured. I'm not sure why we do this and I don't think we need to. As far as I can tell we do sometimes want to render featured images separately from the rest of the body, but we only seem to do this in [pageId].tsx and if so, we remove them from the body array property in that file, before passing it to Featured textA text slice can be rendered one of several ways inside Body.tsx
N.B. If a text slice has a featured label but is not the first item in the body, it will not be rendered, e.g. /pages/Wvl00yAAAB8A3y8p |
More notes: FeaturedMedia/HeroPictureWe can pass FeaturedMedia and HeroPicture props into the N.B. It will display both if they exist. HeroPictureThis is used in a It is square on small screens and 16:9 on larger screens. We currently (03/03/2024) assign a value to this prop in the following places: ExhibitionOn the exhibition page the HeroPicture comes from the Promo image via transformGenericFields. articleIdNot shown if isShortFilmFormat || isImageGallery || isPodcast FeaturedMediaThis can be a video or an image. We currently (03/03/2024) assign a value to this prop on the following places: ExhibitionIf the first body slice is an embedded video it will be that, else it will be the promo image. // TODO find out - will the video show twice on the page, once in the header, once in the body? If the promo image has a 16:9 crop it will be that. InstallationIf the first body slice is an embedded video it will be that, else it will be the promo image. // TODO find out - will the video show twice on the page, once in the header, once in the body? If the promo image has a 16:9 crop it will be that. articleIdNot shown if isShortFilmFormat || isImageGallery || isPodcast // TODO find out - will the video show twice on the page, once in the header, once in the body? If the promo image has a 16:9 crop it will be that. bookIdFrom book.cover from promo image via transformBook eventSeriesIdIf the first body slice is an embedded video it will be that, else it will be the promo image. // TODO find out - will the video show twice on the page, once in the header, once in the body? If the promo image has a 16:9 crop it will be that. pageIdIf there is a featuredPicture we use that. The featuredPicture comes from the body. If the body has more than one slice and the first slice is of type picture (editorialImage), then that becomes the featuredPicture. If there is no featuredPicture but there is a featuredVideo we use the latter. The featuredVideo comes from the body. If the body has more than one slice and the first slice is of type videoEmbed, then that becomes the featuredVideo. If either of these exist then we remove them from the body array, so they don't get rendered twice. TODO - WHY DO WE THEN REMOVE THE SLICE AS WE DO THIS IN THE BODY TOO? seriesIdIf the first body slice is an embedded video it will be that, else it will be the promo image. // TODO find out - will the video show twice on the page, once in the header, once in the body? If the promo image has a 16:9 crop it will be that. |
Prismic slice machine work:
Follows on from #10664
NCI = need to create issue with full details
Next steps:
Refactor logic for displaying AdditionalContent #10773- done in Featured text slice machine #10783Render OnThisPageAnchors outside of AdditionalContent component #10776- done in Featured text slice machine #10783Render /collections and /visit-us correctly with sliceMachine toggle active #10780- done in Featured text slice machine #10783At this point we'll be rendering our current custom types (and slices) with Prismic's SliceZone component and will be ready to update the models in Prismic to use the slice machine slices, rather than our legacy slices
Get set up with a development Prismic environment and make sure we can query it(DONE)At this point we will be using slice machine to manage our custom types and the editors will be able to utilise the new UI in Prismic.
Scope for improvements that have become apparent during this work:
standfirst
(and maybe featured images) a field on the Prisimic types where it is used, instead of a slice #10753The text was updated successfully, but these errors were encountered: