Change infobox to be its own type

main v0.1.0
trivernis 4 months ago
parent c61a85e0cd
commit 43be59a361
Signed by: Trivernis
GPG Key ID: 7E6D18B61C8D2F4B

@ -40,7 +40,8 @@
"components": [ "components": [
"content.gallery", "content.gallery",
"content.image", "content.image",
"content.text-markdown" "content.text-markdown",
"content.infobox"
], ],
"pluginOptions": { "pluginOptions": {
"i18n": { "i18n": {

@ -0,0 +1,15 @@
{
"collectionName": "components_content_infoboxes",
"info": {
"displayName": "Infobox"
},
"options": {},
"attributes": {
"title": {
"type": "string"
},
"value": {
"type": "richtext"
}
}
}

@ -1,22 +1,13 @@
{ {
"collectionName": "components_content_text_markdowns", "collectionName": "components_content_text_markdowns",
"info": { "info": {
"displayName": "Text - Markdown", "displayName": "Paragraph",
"description": "" "description": ""
}, },
"options": {}, "options": {},
"attributes": { "attributes": {
"value": { "value": {
"type": "richtext" "type": "richtext"
},
"type": {
"type": "enumeration",
"enum": [
"paragraph",
"infobox"
],
"default": "paragraph",
"required": true
} }
} }
} }

@ -20,17 +20,25 @@ export interface ContentImage extends Schema.Component {
}; };
} }
export interface ContentInfobox extends Schema.Component {
collectionName: 'components_content_infoboxes';
info: {
displayName: 'Infobox';
};
attributes: {
title: Attribute.String;
value: Attribute.RichText;
};
}
export interface ContentTextMarkdown extends Schema.Component { export interface ContentTextMarkdown extends Schema.Component {
collectionName: 'components_content_text_markdowns'; collectionName: 'components_content_text_markdowns';
info: { info: {
displayName: 'Text - Markdown'; displayName: 'Paragraph';
description: ''; description: '';
}; };
attributes: { attributes: {
value: Attribute.RichText; value: Attribute.RichText;
type: Attribute.Enumeration<['paragraph', 'infobox']> &
Attribute.Required &
Attribute.DefaultTo<'paragraph'>;
}; };
} }
@ -39,6 +47,7 @@ declare module '@strapi/types' {
export interface Components { export interface Components {
'content.gallery': ContentGallery; 'content.gallery': ContentGallery;
'content.image': ContentImage; 'content.image': ContentImage;
'content.infobox': ContentInfobox;
'content.text-markdown': ContentTextMarkdown; 'content.text-markdown': ContentTextMarkdown;
} }
} }

@ -961,7 +961,12 @@ export interface ApiBlogPostBlogPost extends Schema.CollectionType {
'api::author.author' 'api::author.author'
>; >;
content: Attribute.DynamicZone< content: Attribute.DynamicZone<
['content.gallery', 'content.image', 'content.text-markdown'] [
'content.gallery',
'content.image',
'content.text-markdown',
'content.infobox'
]
> & > &
Attribute.SetPluginOptions<{ Attribute.SetPluginOptions<{
i18n: { i18n: {

Loading…
Cancel
Save