Skip to content

Commit

Permalink
contentful schema schanges for breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattb-hippo committed Oct 14, 2024
1 parent ebd6310 commit 0c58312
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Contentful-Schema/migrations/0010-breadcrumbs.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module.exports = async function (migration, { makeRequest }) {

/*
* Add fields required for breadcrumbs to Content content type
*/

const contentTypeId = "content";

migration.editContentType(contentTypeId)
.createField("parentPages")
.name("Parent Page(s)")
.type("Array")
.localized(false)
.required(false)
.validations([])
.disabled(false)
.omitted(false)
.items({
type: "Link",

validations: [
{
linkContentType: ["content"],
},
],

linkType: "Entry",
});

migration.editContentType(contentTypeId)
.changeFieldControl("parentPages", "builtin", "entryLinksEditor", {
helpText:
'What pages are parent pages to this page. Any page which should display breadcrumbs should have at least one parent page. Breadcrumbs will only display on a page with Show Content Header set to Yes.',
bulkEditing: false,
showLinkEntityAction: true,
showCreateEntityAction: true,
});

migration.editContentType(contentTypeId)
.createField("breadcrumbText")
.name("Breadcrumb Text")
.type("Symbol")
.localized(false)
.required(false)
.validations([])
.disabled(false)
.omitted(false);

migration.editContentType(contentTypeId)
.changeFieldControl("breadcrumbText", "builtin", "singleLine", {
helpText:
"Text to represent this page in a breadcrumb trail. Optional - Page Title will be used instead if left blank.",
});
};
1 change: 1 addition & 0 deletions Contentful-Schema/migrations/manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
0007-add-header-field-to-navigation-menu.cjs
0008-details-component.cjs
0009-asset-download-component.cjs
0010-breadcrumbs.cjs
Binary file modified Contentful-Schema/migrations/migrations.tar.gz
Binary file not shown.

0 comments on commit 0c58312

Please sign in to comment.