Drupal 8

Creating and registering custom routes for creating nodes of a certain content type

Imagine the following scenario: You have a “registration” content type, for registrations to certain events, by anonymous users. You also want a custom url per event. For example:

/register-form/event1 /register-form/event2 /register-form/event3 /register-form/event4

Of course, each endpoint, will eventually create a node of the “registration” content type.

How can this setup be accomplished?

By registering custom urls.

Tags

Create, register and contextually load a custom library in Drupal 8

In this example, we will create a custom module, where we will declare a custom library, and load it based on custom parameters.

The final file structure of the module will be this:

├── angular.info.yml
├── angular.libraries.yml
├── angular.module
└── js
    ├── angular.min.js
    └── app.js

I will name this custom module "angular", since it will be contextually loading AngularJS, for a progressive decoupled Drupal 8 setup.

Tags

How to install Drush 8 (for Drupal 8) in a shared hosting environment

Since Drush does not run as a daemon, it is very easy to install it in your shared hosting account.

First of all, uninstall Drush 7 if you have it installed. Removing the .drush folder is enough.

Then download latest stable release using the code below:

wget http://files.drush.org/drush.phar;

Test your install:

php drush.phar core-status;

Make it executable.

chmod +x drush.phar;

Rename to 'drush' instead of 'php drush.phar':

mv drush.phar drush;