How to setup Drupal 8 Multi site on nginx web server with different domain. In this example we are going to use three different domain for our drupal-8 multi site ex: drupal-main.com, drupal-first.com, drupal-second.com Here drupal-main.com will be main site pointing to our drupal-8 installation, while two others will be pointing directory site1 and site2 respectively. Directory structure will be as follows: var/www/drupal-main.com/public - will contain drupal-8 installation var/www/drupal-main.com/public/sites/site1 var/www/drupal-main.com/public/sites/site2 Create above directory structure on your server. Now create a copy of sites/default/default.settings.php to sites/default/settings.php and also make a copy of example.sites.php to sites.php available in sites folder and put the following site alias at the end of file: $sites['drupal-first.com'] = 'site1'; $sites['drupal-second.com'] = 'site2'; After that also m...
With reference to my previous post, Setup development environment for Drupal on windows 10 , I noticed that installing drush on WSL using composer doest work by default, in this post I am going to demonstrate how to install drush globally using composer on WSL. I am assuming you have composer install, in order to install drush we have to follow below mentioned steps: $ composer global require drush/drush Now check drush installed path by running: $ composer config --global home This will print path for drush currently install i.e. /home/my-user-name/.config/composer , now we have to set this in PAHT so that drush command can be run from anywhere, using command replace my-user-name with your own: $ echo 'export PATH="/home/my-user-name/.config/composer/vendor/bin:$PATH"' >> ~/.bashrc $ source ~/.bashrc Now check that drush command is working by running $ drush
Lets assume there is requirement where we need to create a views exposed filter that will filter node content for the selected year. Here I am going to create a module with name custom_views_filter for demonstration Create custom_views_filter.module file and add below code /** * Implements hook_views_data_alter(). */ function custom_views_filter_views_data_alter(array &$data) { $data['node']['year_filter'] = [ 'title' => t('Year'), 'filter' => [ 'title' => t('Year'), 'help' => t('Provides a custom filter for nodes to search yearly.'), 'id' => 'year_views_filter', ], ]; } This will register filter with views plugin, now create views plugin filter. Create folder Plugin/view/filter under src folder and add file with name ContentYearViewsFilter.php , then add below code: ...
Comments
Post a Comment
There is comment posted on your blog, chandu7929@blogpost.com