### Start Demo Environment with Docker Compose Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/contributing/pull-requests.md Use this command to spin up the demo environment for the KunstmaanBundlesCMS. Ensure Docker is installed and you are in the docker_demo directory of the KunstmaanBundlesStandardEdition. ```bash cd docker_demo docker-compose up ``` -------------------------------- ### Manual Installation Steps (Reference) Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/index.md These commands are executed as subcommands by `kuma:install`. They can be run manually if you prefer not to use the installer. Note that some commands are specific to Symfony versions. ```bash bin/console kuma:generate:bundle #Only do this for Symfony 3.x ``` ```bash bin/console kuma:generate:config #Only do this for Symfony 4.x ``` ```bash bin/console kuma:generate:default-site ``` ```bash bin/console doctrine:database:create ``` ```bash bin/console doctrine:schema:drop ``` ```bash bin/console doctrine:schema:create ``` ```bash bin/console doctrine:fixtures:load ``` ```bash bin/console assets:install ``` ```bash bin/console kuma:generate:admin-tests ``` -------------------------------- ### Start Symfony Web Server Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/index.md Use the default Symfony web server to start your application. This is useful for local development after installation. ```bash bin/console server:start ``` -------------------------------- ### Install Elasticsearch on Debian/Ubuntu Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/content-management/adding-a-search-engine.md Installs Elasticsearch using a .deb package and starts the service. Ensure you download the correct version. ```bash wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.3.deb sudo dpkg -i elasticsearch-0.90.3.deb sudo service elasticsearch start ``` -------------------------------- ### Example Article Generation Command Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/bundles/article-bundle.md An example of the article generation command, specifying a namespace, entity, and table prefix for the generated files. ```bash bin/console kuma:generate:article --namespace=Kunstmaan\NewsBundle --entity=news --prefix=news_ ``` -------------------------------- ### Install Kunstmaan CMS Skeleton Source: https://context7.com/kunstmaan/kunstmaanbundlescms/llms.txt Create a new project using the official skeleton and run the interactive installer. Ensure DATABASE_URL is configured in .env before running. ```bash composer create-project kunstmaan/cms-skeleton myproject # Configure DATABASE_URL in .env, then run the guided installer bin/console kuma:install ``` ```bash # The installer runs these steps in order: bin/console kuma:generate:config # generate package YAML configs bin/console kuma:generate:default-site # scaffold pages, fixtures, frontend build bin/console doctrine:database:create bin/console doctrine:schema:create bin/console doctrine:fixtures:load bin/console assets:install ``` ```bash # Build frontend assets (requires Node >=10) nvm use npm install npm run build ``` ```bash # Access admin at https://127.0.0.1/en/admin ``` -------------------------------- ### Install Project Dependencies and Build Assets Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/standard-edition.md Execute these commands to install all project dependencies and build the front-end website assets using npm and gulp. This is part of the KuMa workflow. ```bash npm install ``` ```bash npm run build ``` -------------------------------- ### Install Kunstmaan Site Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/standard-edition.md Run this command to perform a fast installation of the Kunstmaan site. Alternatively, follow the detailed steps provided in the documentation. ```sh bin/console kuma:install ``` -------------------------------- ### Install Translator Bundle with Composer Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/TranslatorBundle/README.md Install the KunstmaanTranslatorBundle and necessary Doctrine migration bundles using Composer. ```bash composer require kunstmaan/translator-bundle 2.3.*@dev composer require doctrine/migrations dev-master composer require doctrine/doctrine-migrations-bundle dev-master ``` -------------------------------- ### Setup and Populate Search Index Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/content-management/adding-a-search-engine.md Initializes the search index if it doesn't exist and then populates it with all available content. 'full' populates all data. ```bash bin/console kuma:search:setup bin/console kuma:search:populate full ``` -------------------------------- ### Install GitHub Flow Changelog Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/contributing/preparing-a-new-release.md Install the github-flow-changelog tool and its dependencies using composer. ```bash git clone https://github.com/Kunstmaan/github-flow-changelog.git cd github-flow-changelog composer install ``` -------------------------------- ### Install Elasticsearch on OS X using Homebrew Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/content-management/adding-a-search-engine.md Installs Elasticsearch via Homebrew and loads its launch agent. This is a convenient method for macOS users. ```bash brew install elasticsearch launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist ``` -------------------------------- ### Install Gulp CLI Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/standard-edition.md Install the gulp-cli globally. If you have a previous version of gulp installed globally, remove it first using `npm rm -gl gulp`. ```bash npm install -g gulp-cli ``` -------------------------------- ### DocumentAdminListController Setup Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/AdminListBundle/Resources/doc/AdminListBundle.md Sets up the base controller for managing Document entities, including the AdminListConfigurator. ```PHP use Your\Bundle\Form\DocumentType; use Your\Bundle\AdminList\DocumentAdminListConfigurator; use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Routing\Annotation\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; class DocumentAdminController extends AbstractAdminListController { /** * @var AdminListConfiguratorInterface */ private $configurator; /** * @return AdminListConfiguratorInterface */ public function getAdminListConfigurator() { if (!isset($this->configurator)) { $this->configurator = new DocumentAdminListConfigurator($this->getEntityManager()); } return $this->configurator; } ``` -------------------------------- ### AdminList Controller Setup Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/bundles/adminlist-bundle/intro.md Sets up the base controller for managing entities with AdminListBundle. Requires importing necessary classes and implementing the getAdminListConfigurator method. ```PHP use Your\Bundle\Form\DocumentType; use Your\Bundle\AdminList\DocumentAdminListConfigurator; use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController; use Symfony\Component\HttpFoundation\RedirectResponse; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; class DocumentAdminController extends AbstractAdminListController { /** * @var AdminListConfiguratorInterface */ private $configurator; /** * @return AdminListConfiguratorInterface */ public function getAdminListConfigurator() { if (!isset($this->configurator)) { $this->configurator = new DocumentAdminListConfigurator($this->getEntityManager()); } return $this->configurator; } ``` -------------------------------- ### Create Search Indexes Command Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/content-management/adding-a-search-engine.md Use the 'kuma:search:setup' command to create search indexes. This command iterates over all SearchConfigurations and calls their createIndex() method. ```bash kuma:search:setup ``` -------------------------------- ### Install Front-end CMS Assets Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/standard-edition.md Run this command to make all front-end CMS assets available after code generation. This command creates symbolic links for assets. ```bash bin/console assets:install --symlink ``` -------------------------------- ### robots.txt Example: Allow Subfolder Access Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/cookbook/administer-robots-txt.md This example shows how to disallow access to a main folder but allow access to a specific subfolder within it. This is useful for selectively indexing parts of a blocked directory. ```robots.txt User-agent: * Disallow: /folder/ Allow: /folder/subfolder/ ``` -------------------------------- ### Install KunstmaanTaggingBundle with Composer Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/TaggingBundle/README.md Use composer to require the tagging bundle and the doctrine extensions for tagging. ```bash composer require kunstmaan/tagging-bundle composer require fpn/doctrine-extensions-taggable ``` -------------------------------- ### Install npm Dependencies Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/AdminBundle/Resources/public/default-theme/ckeditor/skins/bootstrapck/readme.md Installs the necessary Node.js dependencies for the Grunt build process. Run this command in the root of the CKEditor folder after adding Gruntfile.js and package.json. ```bash npm install ``` -------------------------------- ### Install KunstmaanArticleBundle using Composer Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/ArticleBundle/README.md Use Composer to require the article bundle for your project. This command fetches the latest stable version. ```bash composer require kunstmaan/article-bundle ``` -------------------------------- ### Update Composer and Database Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/cookbook/google-analytics-dashboard.md Run composer update to install the new bundle and update the database schema. ```bash composer update ``` ```bash bin/console doctrine:migrations:diff && bin/console doctrine:migrations:migrate ``` ```bash bin/console doctrine:schema:update --force ``` -------------------------------- ### Frontend Build Script Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/index.md Execute the generated build script to install Node.js dependencies and build frontend assets using npm. Ensure Node.js v10 or higher is installed. ```bash nvm use npm install npm run build ``` -------------------------------- ### Translator Bundle Configuration: Custom Bundles Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/TranslatorBundle/README.md Example configuration to enable the bundle, set the default bundle to 'custom', and specify which bundles to use for import. ```yaml kunstmaan_translator: enabled: true default_bundle: custom bundles: ['MyCompanyCoolBundle', 'MyCompanyAwesomeBundle'] managed_locales: ['en', 'fr', 'es'] ``` -------------------------------- ### Fixture Class Example Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/FixturesBundle/README.md Extend FixtureLoader and implement OrderedFixtureInterface to define your fixtures. The getFixtures method should return an array of YAML file paths. ```php Text intro -- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam ab illum voluptatem illo optio, temporibus doloribus, quaerat vitae laboriosam dolorum, sequi deleniti beatae ea molestiae quis, asperiores!
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam ab illum voluptatem illo optio, temporibus doloribus, quaerat vitae laboriosam dolorum, sequi deleniti beatae ea molestiae quis, asperiores! Voluptate, ea, ipsam. Reiciendis ad architecto ea veritatis harum corporis quo fugit ut cumque, nostrum, dolores sed quia quisquam quos provident. Cupiditate aliquid harum, commodi laborum culpa fugiat, doloribus id eveniet asperiores repellat? Nostrum, exercitationem. Pariatur, ut saepe quae aperiam repudiandae animi, aspernatur facilis ipsum? Voluptatibus, impedit id libero eos ex magnam? Amet vero provident aliquid quas molestiae molestias ipsum, consequuntur. Deleniti, neque? Facere recusandae natus, reprehenderit ullam sunt temporibus earum ex accusantium vel quod. Provident laudantium tempore quo soluta adipisci, beatae autem, aut ex? Eligendi, dolores officia. Vero atque, repellat similique iste. Repellendus molestias odio exercitationem. Quasi, eius aperiam illo nulla vero impedit, modi asperiores quam nihil! Dignissimos fuga eveniet aperiam necessitatibus itaque, obcaecati magni doloremque possimus vitae vel quasi officia vero. Provident sit itaque modi fugit ad sed ullam, quae sapiente, corporis aut doloribus repellat quidem in aliquid nostrum officia odit, iste assumenda veniam harum qui fuga soluta. In, soluta, corporis! Voluptates, nisi, ratione. Temporibus distinctio vero ad eligendi iure assumenda quod sint dignissimos placeat, error ex cupiditate consequuntur ut corporis veniam architecto fugiat ipsa quos, consectetur aperiam autem, alias voluptatum! Cumque saepe aspernatur sit exercitationem sequi quae perferendis delectus praesentium, tempora voluptatum voluptate vero animi vitae dolor! Soluta asperiores praesentium omnis mollitia minima doloribus magni dolore blanditiis. Voluptates, deserunt, dolorum. Minus tenetur soluta nemo magni hic accusamus voluptatum delectus deleniti nostrum, eius rerum, natus non culpa, minima dolorum consectetur dignissimos quibusdam fuga ut nihil impedit fugiat earum. Incidunt, optio, vel? Necessitatibus officiis consequuntur quas eius est praesentium soluta neque obcaecati quos totam repudiandae iste odio velit vero modi dolorem ex, sed sunt aperiam, ducimus minus provident quidem quae similique. Earum.
``` -------------------------------- ### Build BootstrapCK4-Skin with Grunt Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/AdminBundle/Resources/public/default-theme/ckeditor/skins/bootstrapck/sample/bootstrapck-sample.html Steps to install npm dependencies and build the skin using Grunt. This is for users who want to modify the Sass files. ```bash npm install grunt build ``` -------------------------------- ### Translator Bundle Configuration: Custom Bundle and Debug Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/TranslatorBundle/README.md Example configuration setting the default bundle to 'own', specifying managed locales, and disabling debug mode. ```yaml kunstmaan_translator: default_bundle: own managed_locales: ['en', 'fr', 'es'] debug: false ``` -------------------------------- ### Configure Node/Page Tree Source: https://context7.com/kunstmaan/kunstmaanbundlescms/llms.txt Define page types, icons, searchability, and allowed children in the YAML configuration file. This example shows configuration for HomePage, ArticlePage, and SearchPage. ```yaml # config/packages/kunstmaan_node.yaml kunstmaan_node: pages: App\Entity\Pages\HomePage: name: Home page indexable: false icon: fa fa-home hidden_from_tree: false allowed_children: - App\Entity\Pages\ContentPage - name: Article overview class: App\Entity\Pages\ArticlePage App\Entity\Pages\ArticlePage: name: pages.article # translated key indexable: true icon: fa fa-newspaper search_type: article App\Entity\Pages\SearchPage: name: Search results page indexable: false icon: fa fa-search # Collaborative editing lock (prevents silent overwrites) lock: enabled: true threshold: 35 # seconds before lock expires check_interval: 15 # polling interval in seconds ``` -------------------------------- ### Run Default Site Generator Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/index.md Execute the default site generator for a manual KunstmaanCMS installation. It prompts for a table prefix and BrowserSync URL. ```bash php bin/console km:cms:install ``` -------------------------------- ### Run PHP CS Fixer Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/TranslatorBundle/README.md Apply code style fixes using PHP CS Fixer. Ensure PHP-CS-Fixer is installed system-wide first. ```bash php-cs-fixer fix . ``` -------------------------------- ### Add multiple PageParts to a page Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/PagePartBundle/Resources/doc/PagePartBundle.md This example demonstrates adding various PageParts to different regions of a page using a mix of instantiated objects, callables, and the convenience method. ```php $ppCreatorService = new PagePartCreatorService($this->container->get('doctrine.orm.entity_manager')); $logo = new Logo(); $logo->setUrl('https://kunstmaancms.be'); $pageparts = array( 'banners' => array(function() { $pp = new Satellite(); $pp->setType('sputnik'); return $pp; }, $logo ), 'main' => array( $ppCreatorService->getCreatorArgumentsForPagePartAndProperties('Kunstmaan\PagePartBundle\Entity\HeaderPagePart', array('setNiv' => 2, 'setTitle' => 'Some Title') ), $ppCreatorService->getCreatorArgumentsForPagePartAndProperties('Kunstmaan\PagePartBundle\Entity\TextPagePart', array('setContent' => 'A bunch of interesting content.
') ), $ppCreatorService->getCreatorArgumentsForPagePartAndProperties('Kunstmaan\PagePartBundle\Entity\LinePagePart'), function() { $pp = new InfoButtonPagePart(); $pp->setTitle('Show me more!'); return $pp; // Don't forget to return the PagePart ;) }, ) ); $ppCreatorService->addPagePartsToPage('homepage', $pageparts, 'en'); ``` -------------------------------- ### Generate Website Skeleton Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/standard-edition.md This command generates the basic structure for your website, including configuration files, UI elements, controllers, entities, and Twig templates. It sets up a starting point for development. ```sh bin/console kuma:generate:default-site ``` -------------------------------- ### Install KunstmaanVotingBundle with Composer Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/VotingBundle/README.md Use Composer to add the voting bundle to your Symfony project. Ensure you have Composer installed. ```bash composer require kunstmaan/voting-bundle ``` -------------------------------- ### Install BootstrapCK4-Skin Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/AdminBundle/Resources/public/default-theme/ckeditor/skins/bootstrapck/sample/bootstrapck-sample.html Instructions for adding the skin to your CKEditor installation. Ensure the skin name is updated in ckeditor.js and config.js. ```bash $ git clone git://github.com/Kunstmaan/BootstrapCK4-Skin ``` -------------------------------- ### Initialize Git Repository Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/index.md After creating the project, initialize a Git repository and push it to a remote origin. This ensures your project is under version control. ```bash git init git add . git commit -m "Clean install of the KunstmaanCMS" git remote add origin https://github.com/USERNAME/MyProject.git git push -u origin master ``` -------------------------------- ### robots.txt Example: Block a File Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/cookbook/administer-robots-txt.md This example demonstrates how to disallow all robots from accessing a specific file. This is useful for preventing indexing of individual pages or resources. ```robots.txt User-agent: * Disallow: /file.html ``` -------------------------------- ### Initialize Git Repository and Push to GitHub Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/standard-edition.md Commands to initialize a Git repository in your project directory, add all files, commit them, link to a remote origin on GitHub, and push the initial commit. ```sh git init git add . git commit -m "Clean install of the KunstmaanBundlesCMS" git remote add origin https://github.com/USERNAME/MyProject.git git push -u origin master ``` -------------------------------- ### Initialize ACL Database Structure Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/bundles/admin-bundle/permissions.md Run this command to import the necessary database structure for ACL permission support. ```bash bin/console init:acl ``` -------------------------------- ### Create Menu Directory Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/bundles/adminlist-bundle/creating-an-adminlist.md Create the directory for your menu adaptor class. This follows a conventional naming scheme. ```bash mkdir -p src/MyProject/WebsiteBundle/Helper/Menu ``` -------------------------------- ### robots.txt Example: Block a Folder Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/cookbook/administer-robots-txt.md This example shows how to disallow all robots from accessing a specific folder. Use this to prevent crawlers from indexing certain sections of your site. ```robots.txt User-agent: * Disallow: /folder/ ``` -------------------------------- ### Create Database Schema and Load Fixtures Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/standard-edition.md Commands to create the database schema based on your entities and load the generated fixtures to populate the database with initial data. This is a crucial step after generating the default site. ```sh bin/console doctrine:database:create bin/console doctrine:schema:create bin/console doctrine:fixtures:load ``` -------------------------------- ### Elasticsearch Status Response Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/content-management/adding-a-search-engine.md Example JSON response when Elasticsearch is running and accessible. ```json { "ok" : true, "status" : 200, "name" : "Smythe, Spencer", "version" : { "number" : "0.90.3", "build_hash" : "5c38d6076448b899d758f29443329571e2522410", "build_timestamp" : "2013-08-06T13:18:31Z", "build_snapshot" : false, "lucene_version" : "4.4" }, "tagline" : "You Know, for Search" } ``` -------------------------------- ### Overview Navigation Interface Implementation PHP Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/AdminListBundle/Resources/doc/PageAdminListBundle.md Implement OverviewNavigationInterface and use getOverViewRoute to provide a link back to the overview page. ```php ``` -------------------------------- ### Get URL Parameter Function Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/AdminBundle/Resources/public/default-theme/ckeditor/plugins/wsc/dialogs/ciframe.html Retrieves a URL parameter by its name. Handles special characters in parameter names. ```javascript function gup( name ) { name = name.replace( /[\[\]]/g, "\\\\\[" ).replace( /[\]\]]/g, "\\\\\]" ) ; var regexS = "[\\?&]" + name + "=([^]*)" ; var regex = new RegExp( regexS ) ; var results = regex.exec( window.location.href ) ; if ( results ) return results[ 1 ] ; else return "" ; } ``` -------------------------------- ### Search Page URL with Query Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/content-management/adding-a-search-engine.md Demonstrates how to access the search page with a query parameter. This simulates a user searching for 'Styles'. ```bash /app_dev.php/en/search?query=Styles&search=Search ``` -------------------------------- ### Update npm to Latest Version Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/standard-edition.md Ensure you have the latest version of npm installed globally. This is a prerequisite for the subsequent build steps. ```bash npm install npm@latest -g ``` -------------------------------- ### Initialization Function Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/AdminBundle/Resources/public/default-theme/ckeditor/plugins/wsc/dialogs/ciframe.html Initializes the WSC iframe by setting up an interval to send data to the master and starting to listen for post messages. ```javascript function onLoad() { interval = window.setInterval( sendData2Master, 100 ); listenPostMessage(); } ``` -------------------------------- ### Instantiate HeaderPagePart with properties Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/PagePartBundle/Resources/doc/PagePartBundle.md Use this method to create a PagePart instance and set its properties using a named array of method calls. ```php function() { $pp = new HeaderPagePart(); $pp->setTitle("General Conditions"); $pp->setNiv(1); return $pp; } ``` -------------------------------- ### Generate Article Section Command Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/bundles/article-bundle.md Use this command to generate the necessary classes for an article overview and its detail pages. The 'namespace' and 'entity' parameters are required, while 'prefix' is optional. ```bash bin/console kuma:generate:article --namespace=Namespace\NamedBundle --entity=Entity --prefix=tableprefix_ ``` -------------------------------- ### Configure Sub-Action Menu Listener (YAML) Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/bundles/node-bundle/configurable-action-menu.md Define a service in YAML to listen for the 'kunstmaan_node.configureSubActionMenu' event. This service requires the entity manager and router as arguments. ```yaml # src/Acme/MainBundle/Resources/config/services.yml services: acme_hello.configure_sub_actions_menu_listener: class: Acme\MainBundle\EventListener\ConfigureActionsMenuListener arguments: ["@doctrine.orm.entity_manager", "@router"] tags: - { name: 'kernel.event_listener', event: 'kunstmaan_node.configureSubActionMenu', method: 'onSubActionMenuConfigure' } ``` -------------------------------- ### Retrieve Vote Counts in PHP Source: https://context7.com/kunstmaan/kunstmaanbundlescms/llms.txt Get vote counts and total values for a given reference using the Upvote helper service. ```php // Retrieve vote counts from a controller or service $helper = $container->get('kunstmaan_voting.helper.upvote'); $count = $helper->getCount($reference); $totalValue = $helper->getValue($reference); ``` -------------------------------- ### Create Kunstmaan Bundles Standard Edition Project Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/installation/standard-edition.md Use Composer to download the standard edition of Kunstmaan Bundles and set up a new project. This command fetches the CMS and its dependencies. ```sh composer create-project kunstmaan/bundles-standard-edition myprojectname ``` -------------------------------- ### Elasticsearch Mapping Changes (v5.x and earlier) Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/NodeSearchBundle/Resources/doc/ElasticSearch.md Example of Elasticsearch mapping configuration for older versions of the library, including 'include_in_all' and 'index' settings. ```php 'node_id' => [ 'type' => 'integer', 'include_in_all' => false, 'index' => 'not_analyzed' ], ... 'view_roles' => [ 'type' => 'string', 'include_in_all' => true, 'index' => 'not_analyzed', ], ``` -------------------------------- ### Run Unit Tests Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/TranslatorBundle/README.md Execute the project's unit tests using PHPUnit. ```bash ./vendor/bin/phpunit -c phpunit.xml.dist ``` -------------------------------- ### Implement Menu Adaptor Interface Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/bundles/adminlist-bundle/creating-an-adminlist.md Create a PHP class that implements `Kunstmaan\AdminBundle\Helper\Menu\MenuAdaptorInterface`. This class is responsible for adding your admin list to the menu. ```php getRoute()) { $menuItem = new TopMenuItem($menu); $menuItem->setRoute('MyProjectWebsitebundle_admin_employee'); $menuItem->setUniqueId('employee'); $menuItem->setLabel('Employee'); $menuItem->setParent($parent); if (stripos($request->attributes->get('_route'), $menuItem->getRoute()) === 0) { $menuItem->setActive(true); $parent->setActive(true); } $children[] = $menuItem; } } } ``` -------------------------------- ### Check Elasticsearch Status Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/content-management/adding-a-search-engine.md Verifies if Elasticsearch is running by sending a GET request to its default port. A successful response indicates the server is active. ```bash curl -X GET http://localhost:9200/ ``` -------------------------------- ### Create Custom Column Template Directory Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/bundles/adminlist-bundle/creating-an-adminlist.md Create the directory structure for custom column templates following a consistent naming scheme. ```bash mkdir -p src/MyProject/WebsiteBundle/Resources/views/AdminList/Employee ``` -------------------------------- ### Populate Search Indexes Command Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/content-management/adding-a-search-engine.md Use the 'kuma:search:populate' command to populate search indexes. The 'full' argument can be used to delete and recreate indexes before populating. ```bash kuma:search:populate ``` ```bash kuma:search:populate full ``` -------------------------------- ### Programmatically Create Nodes Source: https://context7.com/kunstmaan/kunstmaanbundlescms/llms.txt Use the PageCreatorService to create multi-language pages with publish state from migrations, fixtures, or services. This example creates a 'Satellites' page. ```php use Kunstmaan\NodeBundle\Helper\Services\PageCreatorService; // Inside a DataFixture or migration (inject PageCreatorService via constructor) $nodeRepo = $em->getRepository('KunstmaanNodeBundle:Node'); $homePage = $nodeRepo->findOneBy(['internalName' => 'homepage']); $overviewPage = new ContentPage(); $overviewPage->setTitle('Satellites'); $translations = [ [ 'language' => 'en', 'callback' => function ($page, $translation, $seo) { $translation->setTitle('My collection of satellites'); $translation->setSlug('my-collection-of-satellites'); }, ], [ 'language' => 'nl', 'callback' => function ($page, $translation, $seo) { $translation->setTitle('Mijn collectie satellieten'); $translation->setSlug('mijn-collectie-satellieten'); }, ], ]; $pageCreator->createPage($overviewPage, $translations, [ 'parent' => $homePage, 'page_internal_name' => 'satellites', 'set_online' => true, 'creator' => 'Admin', ]); ``` -------------------------------- ### Configure Cookie Bundle Entities Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/src/Kunstmaan/CookieBundle/README.md Add the CookieConfig entity to your configuration to enable cookie management features. This requires prior setup of the Config Bundle. ```yaml kunstmaan_config: entities: - Kunstmaan\CookieBundle\Entity\CookieConfig ``` -------------------------------- ### Add a Global List Action Source: https://github.com/kunstmaan/kunstmaanbundlescms/blob/7.1/docs/bundles/adminlist-bundle/configuring-adminlists.md Configure a global action that applies to the entire admin list. Specify the route, button name, and icon. ```PHP public function buildListActions() { $listRoute = array( 'path' => 'acmewebsitebundle_route_name', 'params' => array() ); $this->addListAction(new SimpleListAction($listRoute, 'Action_name', 'Action_icon')); } ```