Skip to content

Commit

Permalink
chore(playground): add article component with blocks element
Browse files Browse the repository at this point in the history
Adds a new content type with the new blocks rich text format
  • Loading branch information
sargreal committed Oct 2, 2024
1 parent 18c00e6 commit 3caa95e
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"kind": "collectionType",
"collectionName": "blocks_articles",
"info": {
"singularName": "blocks-article",
"pluralName": "blocks-articles",
"displayName": "BlocksArticle",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {
"i18n": {
"localized": true
}
},
"attributes": {
"Title": {
"type": "string",
"pluginOptions": {
"i18n": {
"localized": true
},
"translate": {
"translate": "translate"
}
}
},
"Content": {
"type": "blocks",
"pluginOptions": {
"i18n": {
"localized": true
},
"translate": {
"translate": "translate"
}
}
},
"writer": {
"type": "relation",
"relation": "oneToOne",
"target": "api::writer.writer",
"pluginOptions": {
"translate": {
"translate": "translate"
}
}
},
"category": {
"type": "relation",
"relation": "oneToOne",
"target": "api::category.category",
"pluginOptions": {
"translate": {
"translate": "translate"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* blocks-article controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::blocks-article.blocks-article');
9 changes: 9 additions & 0 deletions playground/src/api/blocks-article/routes/blocks-article.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* blocks-article router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::blocks-article.blocks-article');
9 changes: 9 additions & 0 deletions playground/src/api/blocks-article/services/blocks-article.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* blocks-article service
*/

const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::blocks-article.blocks-article');

0 comments on commit 3caa95e

Please sign in to comment.