Skip to content

Commit

Permalink
Added FAQ Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
martendegroot committed Dec 24, 2024
1 parent d82cf2a commit 1361daa
Show file tree
Hide file tree
Showing 2 changed files with 146 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cms/collections.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DynamicFaqCollection, FaqCollection } from '../layouts/faq/collection';
import { Collection as ArticlesCollection } from '../layouts/newsroom/collection';

export default [ArticlesCollection];
export default [ArticlesCollection, DynamicFaqCollection, FaqCollection];
144 changes: 144 additions & 0 deletions layouts/faq/collection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
export const FaqCollection = {
name: 'faq',
label: 'FAQ',
files: [
{
label: 'Fixed FAQ',
name: 'fixedfaq',
file: 'content/faq/_index.en.md',
slug: '_index',
create: false,
fields: [
{
label: 'Title',
name: 'title',
widget: 'string',
default: 'faq',
i18n: true,
},
{
label: 'Opener',
name: 'opener',
widget: 'string',
i18n: true,
},
{
label: 'Intro',
name: 'intro',
widget: 'text',
i18n: true,
},
{
label: 'FAQ groups',
name: 'faqgroups',
widget: 'list',
i18n: true,
fields: [
{
label: 'heading',
name: 'heading',
widget: 'string',
i18n: true,
},
{
label: 'FAQs',
name: 'faqs',
widget: 'list',
i18n: true,
fields: [
{
label: 'Title',
name: 'title',
widget: 'string',
i18n: true,
},
{
label: 'Description',
name: 'description',
widget: 'markdown',
i18n: true,
},
],
},
],
},
],
},
],
};

export const DynamicFaqCollection = {
name: 'dynamicfaq',
label: 'Dynamic FAQ',
folder: 'content/faq',
create: true,
slug: '{{slug}}',
i18n: true,
fields: [
{
label: 'Title',
name: 'title',
widget: 'string',
default: 'faq',
i18n: true,
},
{
label: 'Opener',
name: 'opener',
widget: 'string',
i18n: true,
},
{
label: 'Intro',
name: 'intro',
widget: 'text',
i18n: true,
},
{
label: 'Button text',
name: 'button_text',
widget: 'string',
i18n: true,
},
{
label: 'Button url',
name: 'button_url',
widget: 'string',
i18n: true,
},
{
label: 'FAQ groups',
name: 'faqgroups',
widget: 'list',
i18n: true,
fields: [
{
label: 'heading',
name: 'heading',
widget: 'string',
i18n: true,
},
{
label: 'FAQs',
name: 'faqs',
widget: 'list',
i18n: true,
fields: [
{
label: 'Title',
name: 'title',
widget: 'string',
i18n: true,
},
{
label: 'Description',
name: 'description',
widget: 'markdown',
i18n: true,
},
],
},
],
},
],
};

0 comments on commit 1361daa

Please sign in to comment.