Process plugin: substr

The substr plugin is used to return part of a string.

    plugin: substr
    source: some_text_field
      start: 2
      length: 7

If some_text_field was 'Marie Skłodowska Curie' then $destination['new_text_field'] would be Skłodowska.

The PHP equivalent of this would be:

$destination['new_text_field'] = substr($source['soume_text_field'], 6, 10)

Middleware API in Drupal 8

Drupal 8 has a Middleware API that it adopted from the broader PHP community: This one-liner from their project page captures it well:

Symfony's HttpKernelInterface provides a solid interface, which makes creating and sharing framework-agnostic HTTP filters a breeze!

So, StackPHP:

Sauce Labs

Sauce LabsThanks to for sponsoring testing and quality assurance tools for ERPAL

Create a Zen 8.x-7.x sub-theme - Manually (Tested with D8.17, 'zen-8.x-7.0-alpha14' / 'zen-8.x-7.x-dev [2016-Jul-14]')


The base Zen theme is designed to be easily extended by its sub-themes. You should Not modify any of the files in the Zen base-theme folder 'zen' at [D8-root]/themes/zen, but, instead, create a sub-theme located outside of the 'zen' base-theme folder. Put you subtheme at [D8-root]/themes/my_zen_subtheme_location.

Realname: Remove 15 character trim of username

In case your user has long realname (15+ character), by default username is trimmed and "..." added. If you wish to have full name displayed, then place this code (D7) into your template.php

 * Overrides template_process_username().
function THEMENAME_preprocess_username(&$variables) {
  $account = $variables['name_raw'];
  $variables['name'] = check_plain($account);


Subscribe with RSS Subscribe to RSS - Advanced