Used on: A page that have collections inside
This is a page where you added /collection and shows a list of items (have the CollectionElement in the page).
A page that have collections inside
This page would have page.customization.collection_data in the customization to hold metadata on each CollectionElement instance.
For example, you have a CollectionElement that listed out table “Blog”, and have element[COLLECTION_DATA_ID] = abc
In customization, you’ll see
{ "collection_data": { "abc": { "integration": "notion", "tableID": "xyz_blogtable_id" } }}Why is this put in the Page Customization?
Because we want to grab the data needed for all CollectionElements in that page during getStaticProps call to the API when fetching the page. This means, the API would parse through page customization and use the collection_data to call Notion’s API and pre-populate the collection_data.abc.queryResp before returning to getStaticProps
Used on: an Item Page Template
An Item Page Template is the template that is used to render a single data row from the table. It's a page, and the page content is the template. Think of this as the Blog Post.
This is very similar to page.customization.collection_data , except it wouldn't have multiple IDs, just 1. Because essentially the whole page is a template, so this stores information for the table and metadata for the current table.
Item Page Template is used to render a single data row from a table
This looks like the following:
{ "item_page_data": { "integration": "notion", "tableID": "xyz_blogtable_id", "pageSchema": { "name": "Name", "metadata": "TD:metadata", ... }, "contentSchema": { "title": "Name", "author": "Author", ... } }}This holds all the metadata that is needed to display a data row from Notion using this template.
Only 1 Item Page Template For Each Table
This is used to know where is the "Item Page Template" for a specific table. Following from the example above, we have a table xyz_blogtable_id. No matter how many times the user display a list of blogs from this table, there will only be 1 Item Page Template for this table (1 template to show how each item look like)
This mainly looks like the following:
{
"collection_item_data": {
"notion_xyz_blogtable_id": {
"integration": "notion",
"childrenTemplatePageID":
"pageid_abcde"
}
}
}Note that the "id" here is deterministic, would be the same for every integration-tableID pair
notion_xyz_blogtable_id = `${integration}_${tableID}`From this customization, we can know how to link to the item page from any page.