Closed rcantin-w closed 1 month ago
Size Change: +154 B (+0.02%)
Total Size: 971 kB
Filename | Size | Change | |
---|---|---|---|
content/webapp/.next/static/chunks/pages/_app-e062c47b18476179.js |
0 B | -111 kB (removed) | đ |
content/webapp/.next/static/chunks/pages/cookie-policy-387baba12b7c55a6.js |
0 B | -6.31 kB (removed) | đ |
identity/webapp/.next/static/chunks/pages/_app-ce3585df54ed5703.js |
0 B | -99.9 kB (removed) | đ |
content/webapp/.next/static/chunks/pages/_app-16feea97c6433ffb.js |
111 kB | +111 kB (new file) | đ |
content/webapp/.next/static/chunks/pages/cookie-policy-d5851774f66ee5ce.js |
6.42 kB | +6.42 kB (new file) | đ |
identity/webapp/.next/static/chunks/pages/_app-10e98261be544478.js |
99.9 kB | +99.9 kB (new file) | đ |
Just to write down what I said when we discussed this at our catchup. The only other way I can think to do this is to create a slice which allows an editor to choose from a controlled list of things that could be added to the page, e.g. necessary_cookie_table, analytics_cookie_table etc. , rather than using the text slice and relying on the text being entered correctly. It would also mean that we wouldn't need to take these off the untransformedBody slice and render them separately. They would just be rendered by the SliceZone, like any other slice.
That might be overkill though.
I love the idea and had considered creating a "dynamic content" or "coded content" slice for situations like this one and the postOutroContent
trick, which is actually specific to only one (covid) page.
I think since it's only happened twice in over 4 years, though, I'm on the side of bringing that idea back to life if we come across another use-case, what do you think @gestchild ?
(add-on: Although I still think the searchResult
slice could be hard-coded as well.. used only once and not super editor-friendly)
Happy to go with this until another use case arises. It wouldn't be difficult to switch over if that happens
Who is this for?
Ease of maintenance of the cookie policy page; taking it off dev hands.
10891
What is it doing for them?
I created a Prismic page called Cookie Policy (editable here). That page is made up of
Text
slice, a new one being created as a placeholder for specific tables we want to display.I then modified our
pages/cookie-policy.tsx
file to fetch the data of that page. In that file, I then find the index of the placeholders and replace them with the table containing data of the same name.I also left the
policyUpdatedDate
line hard-coded, as I believe deploying changes to the value of that date is needed to re-trigger consent requesting from our users.One
TODO
has to do withuntransformedBody
vstransformedBody
as I only use the former at the moment, but I believe @gestchild is currently working on tidying that up as part of the Slice Machine work having been released. The otherTODO
is around what other data we think we should get from Prismic, should we like this solution enough (e.g. metadata)