generated from DFE-Digital/govuk-dotnet-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contentful schema schanges for breadcrumbs
- Loading branch information
1 parent
ebd6310
commit 0c58312
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.", | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.