Added content group

This commit is contained in:
DrMint 2022-05-21 13:25:00 +02:00
parent acd81f8dea
commit 7403988c42
6 changed files with 107 additions and 12 deletions

View File

@ -42,22 +42,16 @@
"images"
]
},
"next_recommended": {
"type": "relation",
"relation": "oneToOne",
"target": "api::content.content",
"inversedBy": "previous_recommended"
},
"previous_recommended": {
"type": "relation",
"relation": "oneToOne",
"target": "api::content.content",
"inversedBy": "next_recommended"
},
"translations": {
"type": "component",
"repeatable": true,
"component": "translations.title"
},
"group": {
"type": "relation",
"relation": "manyToOne",
"target": "api::contents-group.contents-group",
"inversedBy": "contents"
}
}
}

View File

@ -0,0 +1,32 @@
{
"kind": "collectionType",
"collectionName": "contents_groups",
"info": {
"singularName": "contents-group",
"pluralName": "contents-groups",
"displayName": "🟡 Contents Groups",
"description": ""
},
"options": {
"draftAndPublish": false
},
"attributes": {
"slug": {
"type": "string",
"regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
"unique": true,
"required": true
},
"contents": {
"type": "relation",
"relation": "oneToMany",
"target": "api::content.content",
"mappedBy": "group"
},
"combine": {
"type": "boolean",
"default": true,
"required": true
}
}
}

View File

@ -0,0 +1,9 @@
'use strict';
/**
* contents-group controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::contents-group.contents-group');

View File

@ -0,0 +1,9 @@
'use strict';
/**
* contents-group router.
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::contents-group.contents-group');

View File

@ -0,0 +1,9 @@
'use strict';
/**
* contents-group service.
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::contents-group.contents-group');

View File

@ -399,6 +399,48 @@
},
"response_email_success": {
"type": "string"
},
"always_show_info": {
"type": "string"
},
"item_not_available": {
"type": "string"
},
"primary_language": {
"type": "string"
},
"secondary_language": {
"type": "string"
},
"combine_related_contents": {
"type": "string"
},
"previous_content": {
"type": "string"
},
"followup_content": {
"type": "string"
},
"videos": {
"type": "string"
},
"view_on": {
"type": "string"
},
"channel": {
"type": "string"
},
"subscribers": {
"type": "string"
},
"description": {
"type": "string"
},
"available_at": {
"type": "string"
},
"search_title": {
"type": "string"
}
}
}