In the root directory of your Drupal site, create a folder called mytheme in the themes folder. Inside the mytheme folder, create a mytheme.info.yml le so that Drupal can discover the theme. We will then edit this le First, we...
Day: October 30, 2016
Drupal 8 study note 3: Providing the con guration on installation or update
Create a config folder in your module's base directory. All con guration YAMLs should be in a subfolder of Create a folder named install in the config folder. Con guration YAMLs in this folder will be imported on module installation....
Drupal 8 study note 2: Defining permissions
Permissions are stored in a mymodule.permissions.yml le. Add a mymodule. permissions.yml to the base directory of your module. First, we need to de ne the internal string used to identify this permission, such as view mymodule pages: view mymodule pages:...
Drupal 8 study note 1 Altering existing routes
Altering existing routes Create src/Routing/RouteSubscriber.php in your module. It will hold the route subscriber class: <?php namespace Drupal\mymodule\Routing; use Drupal\Core\Routing\RouteSubscriberBase; use Symfony\Component\Routing\RouteCollection; class RouteSubscriber extends RouteSubscriberBase { /** * {@inheritdoc} */ public function alterRoutes(RouteCollection $collection) { // Change path of...