kunstmaan/bundles-cms
Kunstmaan CMS is a full-featured, multilingual CMS built on the Symfony full-stack framework. It offers page and form assembly, versioning, workflow, translation tools, and media management, plus integrations with community bundles.
Installation:
composer require kunstmaan/bundles-cms
Follow the official documentation for full setup instructions.
First Use Case:
Kunstmaan\NodeBundle\Entity\Node and configuring it in config.yml:
kunstmaan_node:
node_types:
my_custom_type:
class: AppBundle\Entity\MyCustomNode
title: "My Custom Page"
php bin/console generate:crud
Where to Look First:
src/Kunstmaan/AdminBundle/ for core CMS functionality.src/Kunstmaan/NodeBundle/ for page management.src/Kunstmaan/MediaBundle/ for media handling.Creating a Page Type:
Extend AbstractNode and configure in kunstmaan_node.node_types:
kunstmaan_node:
node_types:
blog_post:
class: AppBundle\Entity\BlogPost
title: "Blog Post"
icon: "fa fa-newspaper-o"
NodeTypeInterface to define custom fields and behaviors.Page Assembly: Use the Page Builder to assemble pages from components. Components are defined in YAML:
kunstmaan_pagebuilder:
components:
my_custom_component:
class: AppBundle\Component\MyCustomComponent
title: "My Custom Component"
icon: "fa fa-cog"
$media = $mediaManager->upload($file, 'my_media_folder');
MediaFieldType in your node entity.kunstmaan_node:
node_types:
blog_post:
translations: true
TranslatableInterface for translatable entities.config.yml:
kunstmaan_workflow:
workflows:
page_workflow:
type: state_machine
supports: [AppBundle\Entity\Node]
transitions:
draft:
from: draft
to: published
$workflow->apply($node, 'draft');
kunstmaan_admin:
menu_items:
- route: app_my_custom_route
label: "My Custom Module"
parent: ~ # Attaches to "Modules" by default
class MyMenuAdaptor implements MenuAdaptorInterface {
public function adaptChildren(MenuBuilder $menu, array &$children, MenuItem $parent = null, Request $request = null) {
if ($parent->getRoute() === 'KunstmaanAdminBundle_modules') {
$children[] = new TopMenuItem($menu)
->setRoute('app_my_route')
->setLabel('Custom Menu Item');
}
}
}
Register the service in services.yml:
services:
my_menu_adaptor:
class: AppBundle\Helper\Menu\MyMenuAdaptor
tags:
- { name: kunstmaan_admin.menu.adaptor }
php bin/console init:acl
$maskBuilder = new MaskBuilder();
$maskBuilder->add('view')->add('edit');
$aclProvider->createAcl($objectIdentity)->insertObjectAce($securityIdentity, $maskBuilder->get());
{% if is_granted('EDIT', node) %}
<button>Edit</button>
{% endif %}
public function findAllWithPermission(AclHelper $aclHelper, PermissionDefinition $permissionDef) {
$qb = $this->createQueryBuilder('n');
return $aclHelper->apply($qb, $permissionDef)->getResult();
}
ACL Initialization:
php bin/console init:acl will break permission checks. Always initialize ACLs in a post-install script or migration.Node Type Configuration:
kunstmaan_node.node_types can lead to runtime errors. Validate your YAML syntax and ensure the entity class exists.Media Paths:
kunstmaan_media service to resolve paths dynamically:
$mediaPath = $this->get('kunstmaan_media.manager')->getWebPath($media);
Translation Handling:
TranslatableInterface and be configured in orm/translatable.yml. Missing this will cause translation fields to be ignored.Workflow Transitions:
Menu Adaptor Order:
priority in the tag to control execution order:
tags:
- { name: kunstmaan_admin.menu.adaptor, priority: 10 }
Enable Debug Mode:
var/log/dev.log. Enable debug mode in config.yml:
framework:
profiler: { only_exceptions: false }
Check ACL Permissions:
kunstmaan_admin.acl.debug service to dump ACL rules:
$aclDebug = $this->get('kunstmaan_admin.acl.debug');
$aclDebug->dump($entity);
Validate Node Types:
php bin/console debug:kunstmaan-node-types to list and validate configured node types.Media Upload Issues:
kunstmaan_media.storage configuration in config.yml and ensure the storage directory is writable.Workflow State:
php bin/console debug:kunstmaan-workflow to inspect workflow states and transitions.Custom Components:
AbstractComponent to create reusable UI elements. Register them in kunstmaan_pagebuilder.components.Custom Media Providers:
MediaProviderInterface to integrate with external storage (e.g., AWS S3):
class S3MediaProvider implements MediaProviderInterface {
public function upload(File $file, string $folder) { ... }
public function getWebPath(Media $media) { ... }
}
services.yml and configure it in kunstmaan_media.storage.Custom Node Fields:
AbstractFieldType. Example:
class CustomFieldType extends AbstractFieldType {
public function getName() { return 'custom_field'; }
public function getType() { return 'text'; }
public function getOptions() { return []; }
}
kunstmaan_node.field_types.Event Listeners:
node.publish) to trigger custom logic:
$dispatcher->addListener(NodeEvents::NODE_PUBLISH, function(NodePublishEvent $event) {
// Custom logic on publish
});
Override Twig Templates:
vendor/kunstmaan/bundles-cms to templates/Kunstmaan/AdminBundle/ in your bundle.Caching:
php bin/console cache:clear
Environment-Specific Config:
%kernel.environment% in config.yml to load environment-specific settings:
kunstmaan_media:
storage:
default:
adapter: local
options:
directory: %kernel.root_dir%/../media/%kernel.environment%
Version Check:
config.yml:
parameters:
version_checker.enabled: false
How can I help you explore Laravel packages today?