How can you contact us

2By phone at +40 749 014 360

If you still have problems, please let us know, by sending an email to info@westweb-solutions.com Thank you!

OFFICE HOURS

Mon-Fri 9:00AM - 6:00AM
Sat - 9:00AM - 1:00PM
Sundays by appointment only!

In this 'How to' I will show you how to subscribe to an exisitng event.

You can read my previous article on How to dispatch an event.

1 Create a new file mymodule.services.yml in root if your module

In this file, we need to create a new service and tag it as an 'event_subscriber' so Drupal will know that this service is an event subscriber.

Drupal 8 Event Dispatcher

In this 'How to' I will show you how to dispatch an event from a module called 'othermodule'.

First, we need a class that is extending the \Symfony\Component\EventDispatcher\Event class.
This calss will contains all the information we want to send when we dispatch the event.

Place this class in \othermodule\src\Event\OtherModuleEvent.php

Drupal 8 Event Dispatcher

In Drupal 7 we used the function drupal_alter() to allow other modules to alter our data.

This function is not available any more in Drupal 8.
For Drupal 8 we have to use the following code, supposing that $data is our data that can be altered by other modules.

Drupal 8 drupal_alter alter

How to force link break word css

!You might need to make a link with a specific width, but it has too many words and it won't break words so it can be displayed on multiple rows.

You might have tried to add the CSS properties and didn't work:

a {
  word-wrap: break-word;
  word-break: break-all;
}

The solution for you might be:

CSS Front-End

Drupal 8 - How to use Devel

How to use Devel in Drupal 8 (kint):

1 Download devel module and enable devel and devel kint modules.

2 You have to copy default.services.yml and rename it services.yml

3 Search for the variable "debug: false" and change it to "debug: true".

Drupal 8 devel kint

We want to present you 4 steps to add a region to your theme.

1 Edit your theme's .info.yml file

We will call our region "My Custom Region", we declare it in our THEMENAME.info.yml file. Each region is declared as a subkey of the regions element as you can see below:

Drupal 8 region

Drupal 8 - How to create a sub-theme

How to create a Bootstrap LESS sub-theme in 6 steps:

1 Download Bootstrap theme from https://www.drupal.org/project/bootstrap

2 Copy LESS folder from the themes/bootstrap/starterkit to themes/bootstrap/

3 Rename LESS to mytheme and all THEMENAME occurrences to mytheme.

Drupal 8 Bootstrap sub-theme LESS

Sign in your account to have access to different features

Forgot your details?

TOP