https://github.com/hypervillain/even-haven-heaven
https://github.com/hypervillain/even-haven-heaven
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hypervillain/even-haven-heaven
- Owner: hypervillain
- Created: 2021-08-25T15:32:28.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-25T15:41:10.000Z (almost 4 years ago)
- Last Synced: 2025-02-02T20:55:29.609Z (5 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a Prismic project bootstrapped with Next.js.
It features a single slice `MySlice`, that displays a Top Product, selected inside Prismic, from an external database.
It relies on Integration Fields (using external products from inside Prismic writing room).#### How?
I enabled Integration Fields inside my Prismic project and added my own endpoint (https://if-example-out.vercel.app/api/if) there.
Once, this was done, I added an IF field to my slice:```JSON
"topProduct": {
"type": "IntegrationFields",
"config": {
"catalog": "even-haven-heaven--my_catalog",
"label": "Top Product"
}
}
````👆 This has to be done manually right now, inside `MySlice/model.json`.
I then created a Page Custom type, which contains a uid and the `MySlice` slice.
From there, I was able to hand-pick a product from my catalog inside my Prismic document (uid: `my-page`), and save it.When querying the page `my-page`, I can now see that `slice.primary.topProduct` contains the JSON product that was selected by my content editor.