Colorfield: Update a project installed via composer_manager or drush to a CI based Composer template under Drupal VM

Planet Drupal - Tue, 2017/04/18 - 12:24pm
Update a project installed via composer_manager or drush to a CI based Composer template under Drupal VM christophe Tue, 18/04/2017 - 12:24

If you have to go for a Drupal core update from a previous install based on composer_manager or drush (both deprecated), consider installing something robust, Composer friendly, that also enables CI tools like Phing, Behat, PHPUnit, ...

If you don't have already Drupal VM installed, head to the documentation.


Valuebound: How to Sync Blocks Between different environments in a Drupal 8 website

Planet Drupal - Tue, 2017/04/18 - 9:32am

A custom block is made of two entities, one for the placement and one for the actual content. Only the actual placement can be exported with cim. The content can not. Therefore this will result in "Block description Broken/Missing" error on site where the config is imported. And since there is no option to disable custom blocks from being exported through Configuration management, this will break the functionality.

Steps to reproduce

On Site A:

Create custom block

Assign this custom block to any region

Export configuration of the site

On Site B:

Import configuration from site A…


Palantir: The Draven

Planet Drupal - Mon, 2017/04/17 - 7:09pm
The Draven brandt Mon, 04/17/2017 - 12:09 Allison Manley Apr 17, 2017

Let's connect at DrupalCon Baltimore, April 24 - 28, 2017.

In this post we will cover...
  • Sessions we'll be presenting at DrupalCon
  • A fun movie trailer for PM: The Musical!
  • An opportunity for you to sign up to meet with us

We want to speak with you at DrupalCon!

Schedule a Time

Heavily borrowing from “The Raven” by Baltimore’s own Edgar Allen Poe.

Once upon a laptop dreary, with its glow so blue and eerie,
Viewing travel sites where I could shop the online store —
While I purchased, looked at mapping, suddenly there came a tapping,
As of someone gently rapping, rapping at my office door.
“’Tis my colleague,” I muttered, “tapping at my office door —
Helping plan for Baltimore.”

DrupalCon! It is upon us! This conference of such colossus;
3,000 strong will be among us on the conference floor.
Many coming from Palantir to learn and join in Drupal’s cheer
Coming to learn and share with those of similar rapport,
Descending upon a convention center on this eastern shore.
Arriving to explore.

Palantir will have a presence: Booth 109 — and we’ll have presents:
Swag to give all those who visit our spot upon the floor.
A photo booth will offer chances to give our visitors some glances
Of how they look with props and hats of variety galore.
They can tweet and share photos beyond that building’s door.
Posterity forever more!

Three talks will come from Palantiri, who worked hard on each topic’s theory.
The first is 2:15 on Tuesday, and has a musical score:
“Project Management: The Musical” . . . could be slightly Seussical!
Allison and Joe will sing and dance on running scrums and more.
There’s much to learn! Don’t be fooled by the use of songs of yore.
Room 307 – Acquia in Baltimore.

The next are April 27. First at noon . . . is it hell or heaven?
Can separate teams together be something to desire or deplore?
“Successfully Integrating Teams” is the stuff of engineer dreams.
Mixing teams with thoughtful prep can much success ensure.
The tips to do this seamlessly Megh Plunkett will underscore.
Room 319 – in Baltimore.

The last is in the afternoon, and shows that no site is immune
From website content that has been continuously ignored.
“Content Before Code: A D8 Case Study” at 2:45. Grab a buddy!
So you too can learn how to gather content in ways to make all sure.
“Get your content ready for launch!” Michelle and Bec implore.
Room 307 – Acquia in Baltimore.

Palantir will host the fun at Trivia Night, where everyone
Can try for fame by answering questions about Core.
Doors will open right at 8, so hurry there and don’t be late!
Test your skills against your friends to gain the highest score.
Baltimore Soundstage is the place where we shall host the lore.
124 Market Place in Baltimore.

Our wish to see you there grows stronger; hesitating then no longer,
Please know we’d love to see you at our booth or on the floor.
Since we know that time can be fleeting, you can even set up a meeting.
To discuss how we can help your project take wing, and then to soar!
Contact us so we can meet that week in Baltimore.
DrupalCon forevermore!

We want to speak with you at DrupalCon!

Schedule a Time

Chromatic: How to Avoid the DrupalFlu

Planet Drupal - Mon, 2017/04/17 - 3:15pm

This year, don't take home the DrupalFlu along with your swag and business cards - here are some tips for staying healthy at a huge conference.


Palantir: Project Management: The Musical! DrupalCon Trailer

Planet Drupal - Fri, 2017/04/14 - 10:10pm
Project Management: The Musical! DrupalCon Trailer brandt Fri, 04/14/2017 - 15:10 Alex Brandt Apr 14, 2017

Come see Project Management: The Musical! at DrupalCon Baltimore. April 25th at 2:15pm.

In this presentation we will cover...
  • How to get your project organized
  • What analytics and KPIs to review
  • How to handle scope creep
  • ...and many more facets of project management

We want to make your project a success.

Let's Chat.

Additional information about this session can be found on the DrupalCon site



Stay connected with the latest news on web strategy, design, and development.

Sign up for our newsletter.

Agaric Collective: Doing links on Drupal 8

Planet Drupal - Fri, 2017/04/14 - 9:19pm

There are plenty of ways to create links when using Drupal 8 and I will share some of those ways in this post.

The easiest way to create internal links is using Link::createFromRoute

And it is used like this:

use Drupal\Core\Link; $link = Link::createFromRoute('This is a link', 'entity.node.canonical', ['node' => 1]);

Using the Url object gives you more flexibility to create links, for instance, we can do the same as Link::createFromRoute method using the Url object like this:

use Drupal\Core\Link; use Drupal\Core\Url; $link = Link::fromTextAndUrl('This is a link', Url::fromRoute('entity.node.canonical', ['node' => 1]));

And actually Link::fromTextAndUrl is what Drupal recommends instead of using the deprecated l() method. Passing the Url object to the link object gives you great flexibility to create links, here are some examples:

Internal links which have no routes:

$link = Link::fromTextAndUrl('This is a link', Url::fromUri('base:robots.txt'));

External links:

$link = Link::fromTextAndUrl('This is a link', Url::fromUri(''));

Using the data provided by a user:

$link = Link::fromTextAndUrl('This is a link', Url::fromUserInput('/node/1');

The param passed to fromUserInput must start with /,#,? or it will throw an exception.

Linking entities.

$link = Link::fromTextAndUrl('This is a link', Url::fromUri('entity:node/1'));

Entities are a special case, and there are more ways to link them:

$node = Node::load(1); $link = $node->toLink(); $link->setText('This is a link');

And even using the route:

$link = Link::fromTextAndUrl('This is a link', Url::fromRoute('entity.node.canonical', ['node' => 1]));

Drupal usually expects a render array if you are going to print the link, so the Link object has a method for that:


which will return an array.

Final tips:

Searching a route using Drupal Console

The easiest way to find the route of a specific path is using Drupal Console, with the following command.

$ drupal router:debug | grep -i "\/node"

That will return something like:

entity.node.canonical /node/{node} entity.node.delete_form /node/{node}/delete entity.node.edit_form /node/{node}/edit entity.node.preview /node/preview/{node_preview}/{view_mode_id} entity.node.revision /node/{node}/revisions/{node_revision}/view entity.node.version_history /node/{node}/revisions node.add /node/add/{node_type} node.add_page /node/add node.multiple_delete_confirm /admin/content/node/delete node.revision_delete_confirm /node/{node}/revisions/{node_revision}/delete node.revision_revert_confirm /node/{node}/revisions/{node_revision}/revert node.revision_revert_translation_confirm /node/{node}/revisions/{node_revision}/revert/{langcode} search.help_node_search /search/node/help search.view_node_search /search/node view.frontpage.page_1 /node

Listing all the possible routes with that word, we can choose one and do:

drupal router:debug entity.node.canonical

And that will display more information about a specific route:

Route entity.node.canonical Path /node/{node} Defaults _controller \Drupal\node\Controller\NodeViewController::view _title_callback \Drupal\node\Controller\NodeViewController::title Requirements node \d+ _entity_access node.view _method GET|POST Options compiler_class \Drupal\Core\Routing\RouteCompiler parameters node: type: 'entity:node' converter: paramconverter.entity _route_filters method_filter content_type_header_matcher _route_enhancers route_enhancer.param_conversion _access_checks access_check.entity

So in this way we can search the route without the needing to search in all the *.routing.yml files and in this example the route is entity.node.canonical and the param expected is node.

Print links directly within a twig template

It is also possible to print links directly on the twig template with the following syntax:

<a href="{{url('entity.node.canonical', {'node': ) }}"> {{ 'This is a link'|t }} </a>

Add links inside a t() method.

If you want to add a link inside the t() method you need to pass the link as a string, something like this:

use Drupal\Core\Link; $link = Link::fromTextAndUrl('This is a link', Url::fromRoute('entity.node.canonical', ['node' => 1])); $this->t('You can click this %link' ['%link' => $link->toString()]);

Drupal core announcements: Drupal core security release window on Wednesday, April 19, 2017

Planet Drupal - Fri, 2017/04/14 - 5:29pm
Start:  2017-04-19 12:00 - 23:00 UTC Organizers:  xjm catch cilefen David_Rothstein stefan.r Event type:  Online meeting (eg. IRC meeting)

The monthly security release window for Drupal 8 and 7 core will take place on Wednesday, April 19.

This does not mean that a Drupal core security release will necessarily take place on that date for any of the Drupal 8 or 7 branches, only that you should watch for one (and be ready to update your Drupal sites in the event that the Drupal security team decides to make a release).

There will be no bug fix or stable feature release on this date. The next window for a Drupal core patch (bug fix) release for all branches is Wednesday, May 03. The next scheduled minor (feature) release for Drupal 8 will be on Wednesday, October 5.

For more information on Drupal core release windows, see the documentation on release timing and security releases, and the discussion that led to this policy being implemented.


I Fix Drupal: Synchronising production Drupal database to a dev environment

Planet Drupal - Fri, 2017/04/14 - 4:13pm
Drush has a great feature that allows you to limit the data that will be exported when you dump a database. Using this feature you can pull the schema for the entire database while specifying tables who's data you wish to ignore. This can substantially reduce the time it takes to complete an sync operation, especially the time spent importing the DB on the target. The key to this piece of magic lies inside drushrc.php, where you can predefine those lists of tables that do not require data to be dumped using this option. $options['structure-tables']['common'] = array('cache', 'cache_*', '...

Dropsolid: Online payments in Drupal

Planet Drupal - Fri, 2017/04/14 - 9:36am
Online payments in Drupal Thierry Fri, 04/14/2017 - 09:36

In this day and age, it’s very hard to imagine a world without online payments. They permeate every possible sector and purpose, ranging from banking apps to online ticket ordering and charity donations.

Drupal has kept pace with this evolution and is offering enterprise-quality solutions to tackle most online payment needs, most notably Drupal Commerce with secure payment integrations. Drupal Commerce allows developers to implement different gateways to PayPal, Stripe, iDeal, Mollie and Ingenico (previously known as Ogone).

In this blog post, I will explain the possibilities of the Drupal Payment module and describe an example of how to apply it together with Mollie, a rising star in the realm of payment service providers.


Drupal Payment module

Are you looking to make people pay for their membership when they register for an account? Then you will have to integrate an easily manageable payment system into your application.

In situations like these and more, Drupal’s Payment module can act as a bridge to a secure payment integration. You can implement different payment gateways that communicate directly with the Payment module. This means that all incoming payments from various payment service providers are stored in a centralised location.

The Payment module integrates well with Drupal Commerce and Ubercart, but you can even integrate the module into any kind of entity with both the Payment form field and the Payment reference field.

Do you think this might suit your need as an out-of-the-box solution for a simple integration with Drupal Webforms or a basic donation form with Drupal Payment integration? They are available for download on

Payment Service Providers

If you would like to receive online payments through you website, you'll have to implement an actual payment service provider. The most commonly used payment providers in the Benelux are Ingenico, Paypal and Mollie.


Mollie has become very popular very quickly, because it charges a transaction-based fee instead of a monthly subscription. This means that you will not be charged if there are no transactions, which is perfect for projects that do not (yet) generate a lot of transactions.

To allow for easy integration, Mollie provides developers with a very good API. Drupal (and other) developers can access the available RESTful service or a PHP API library, which makes it possible to implement logic - for example to refund a customer through the API.
If your Drupal project does not require automatic refunding of customers, you can use the mollie_payment module, which uses Mollie’s PHP API library.

Example: enabling a payment method

To enable payments with Mollie, you have to define a payment method using the so-called MolliePaymentMethodController. The controller is defined in the Mollie Payment module and uses Mollie's PHP API library to process the requests.

You can add the Payment method through the module install file:

/** * Add payment method (Mollie) */ function MYMODULE_update_7001(){ $mollie = new PaymentMethod(array( 'controller' => payment_method_controller_load('MolliePaymentMethodController'), 'controller_data' => array('mollie_id' => 'test_AA11bb22CC33dd44EE55ff66GG77hh'), 'name' => 'pay_with_mollie', 'title_generic' => 'Pay with Mollie', 'title_specific' => 'Pay with Mollie', )); entity_save('payment_method', $mollie); }


Forms embedding a payment form

Start by defining a simple form, extendable with multiple form elements available in Drupal’s Form API.

/** * Callback function to build a basic payment form. * * @param array $form * The form build array. * @param array $form_state * The form state information. */ function MYMODULE_form($form, $form_state) { $form = array(); // Add form actions. $form['actions'] = array( '#type' => 'actions', ); $form['actions']['save'] = array( '#type' => 'submit', '#value' => t('Pay with Mollie'), ); return $form; }


This form is then capable to embed a payment form, provided by the Payment module. In order to do this, you should first define a Payment object. This will provide all the payment methods that have to be integrated in the payment form. You can pass context and context data for reference and later use, the currency you are making a payment in and the callback that has to be executed after a payment has been done.

// Define a payment object. $payment = new Payment(); $payment->context = 'donation'; $payment->context_data = array( 'time' => time(), 'type' => 'donation', ); $payment->currency_code = 'EUR'; $payment->description = 'Basic payment form'; $payment->finish_callback = 'MYMODULE_finish_callback';


A single payment object can contain multiple items. Useful if you would like to implement this in a commerce environment. In this example, a single line item will define the total amount that has to be paid. Don't forget to define the price without taxes, because the Payment module will handle all tax calculations.

// Define a payment line item. $line_item = new PaymentLineItem(); $line_item->amount = 100.00 / 1.21; $line_item->name = t('EUR 100'); $line_item->tax_rate = 0.21; $line_item->quantity = 1; // Add the payment line item to the payment object. $payment->setLineItem($line_item);


By assigning the payment object to the form, you can use the transferred information in a later stage - for instance during validation.

// Add the payment object to the form. $form_state['payment'] = $payment;

You can use multiple payment methods with the payment module. In this example, Mollie is forced as the only payment option available. It is of course also possible to add multiple methods in the payment options and to allow people to pick their payment method of choice.


// Get available payment methods and limit this form to Mollie payment. $payment_methods = $payment->availablePaymentMethods(); $payment_options = array(); foreach ($payment_methods as $payment_method) { if ($payment_method->enabled && $payment_method->name == 'pay_with_mollie') { $payment_options[] = $payment_method->pmid; } }

To include the payment form into your custom form, you have to call the payment_form_embedded function. The function will use the payment object and the available payment options to build the required form elements and form actions. Then assign the payment elements and submit action to your custom form in order to enable the payment.

// Get the payment embed elements. $payment_embed_form = payment_form_embedded($form_state, $payment, $payment_options); // Add the embedded payment form element. $form['payment'] = $payment_embed_form['elements']; // Define the form submit callback. $form['#submit'] = $payment_embed_form['submit'];

When defining the payment object, you actually define a finished callback. This callback will be triggered after a successful payment from the Mollie payment service provider. To be certain, you could check if there is a payment success status within the payment object and run any additional callbacks if needed.

/** * Handle successful payment from Mollie. * * @param \Payment $payment * The returned payment object containing all relevant information. */ function MYMODULE_finish_callback(Payment $payment) { $payment_complete = FALSE; // Check if the payment status contains a successful state. foreach ($payment->statuses as $status) { if ($status->status == 'payment_status_success') { $payment_complete = FALSE; break; } } if ($payment_complete) { drupal_set_message('Your payment has been received.', 'success'); // @TODO: Implement custom callbacks. } }



As you noticed, it's not that hard to implement a payment workflow in your own form! 

One final tip: use form validation to check if all requirements are met before people are redirected to the payment service provider.

I hope this blog post has helped you to make payments in Drupal easier. Feel free to leave a comment below if you have any questions or if you would like to share some thoughts on different possible approaches.

Add new comment Header image Tags Drupal 8 Tech Teaser image Publish to Drupal planet On

Aten Design Group: See you at DrupalCon Baltimore, hon!

Planet Drupal - Thu, 2017/04/13 - 7:56pm

It’s that time of year again when the Drupal community of developers, designers, strategists, project managers and more come together for the biggest Drupal event in the world: DrupalCon North America. This year, from April 24-28, we'll be in Baltimore and here’s where you can find us:

The Aten Booth

Be sure to stop by booth 216 in the exhibit hall, we’d love to chat about the successes and challenges you face in your web projects. We’ll also have our sought-after sketchbooks to add to your collection.

Monday, April 24 Nonprofit Summit

We are thrilled to support the newly added Nonprofit Summit at DrupalCon this year. Chris, Aten’s Director of Digital Strategy, and Joel, Aten’s Director of Engineering, work closely together and are sharing tips to create intuitive and compelling experiences for organizations to successfully connect with their users.

Tuesday, April 25

Mastering Drupal 8’s Libraries API
Matt Jager
2:45 p.m. - 3:15 p.m.
Room: 307 - Acquia

Wednesday, April 26

Powering an Interactive SVG and JavaScript Game Engine with Drupal
Peter Weber
2:45 p.m. - 3:15 p.m.
Room: 307 - Acquia

A Type System for Tomorrow
Gabe Sullice
3:45 p.m. - 4:45 p.m.
Room: 318 - New Target

Thursday, April 27

Testing for the Brave and True
Gabe Sullice
10:45 a.m. - 11:45 a.m. Room: 315 - Symfony


Mediacurrent: Inclusive Development: Using Style Guides to Improve Website Accessibility

Planet Drupal - Thu, 2017/04/13 - 5:58pm
What exactly is the role of a Front-end developer?

What exactly does it mean to be a 'front-end developer'? From company to company? From website to website? Really, from day to day? Does your colleague actually do the same job as you? For example, some days I’m working in InDesign or Photoshop all day, the next I’m writing jQuery or building theme components. The very next day I am writing a blog post, prepping for a presentation, or doing research on the latest trends.


Mediacurrent: Inclusive Development: Using Style Guides to Improve Website Accessiblity

Planet Drupal - Thu, 2017/04/13 - 5:58pm
What exactly is the role of a Front-end developer?

What exactly does it mean to be a 'front-end developer'? From company to company? From website to website? Really, from day to day? Does your colleague actually do the same job as you? For example, some days I’m working in InDesign or Photoshop all day, the next I’m writing jQuery or building theme components. The very next day I am writing a blog post, prepping for a presentation, or doing research on the latest trends.


Tag1 Consulting: Drupal Load Testing with

Planet Drupal - Thu, 2017/04/13 - 5:48pm
Apache JMeter and I have a long and complicated relationship. It is definitely a trusted and valuable tool, but I am also quite confident that certain parts of it will make an appearance in my particular circle of hell. Due to this somewhat uncomfortable partnership, I am always interested in new tools for applying load to an infrastructure and monitoring the results. is not exactly a new tool, but I have only recently begun to use it for testing. What Is Locust? Locust is a load-testing framework which allows you to write your load plan in regular Python. This is a welcome experiencRead more nnewton Thu, 04/13/2017 - 08:48

Mediacurrent: DrupalCon Baltimore - Mediacurrent&#039;s GamePlan

Planet Drupal - Thu, 2017/04/13 - 3:54pm

DrupalCon Baltimore here we come! We are Gold sponsors once again this year and there are a ton of ways to connect with our team. Here are some of the highlights:


Acquia Developer Center Blog: 12 Questions that Project Managers Should Ask Before a Drupal Project Kickoff

Planet Drupal - Thu, 2017/04/13 - 3:38pm

You are a Project Manager, sitting at your desk, maybe sipping a fresh-brewed coffee. Suddenly you receive a heads-up that a new Drupal Project is headed your way. Sprint 0 will be starting in the next two days.

You can assume that the SOW (Statement of Work) is signed, or almost signed, and a few SWAGs (Sophisticated Wild Ass Guesses) have already been ventured.

Tags: acquia drupal planet

Amazee Labs: Render a menu tree from custom code in Drupal 8

Planet Drupal - Thu, 2017/04/13 - 12:54pm
Render a menu tree from custom code in Drupal 8

Having menus rendered on a site in Drupal 8 is pretty simple. Most of the time this can be accomplished with site building, in a few clicks. And if you need some more advanced features on top of what the Drupal 8 core has, you can also have a look at modules like Menu Block, or have a look at this (a bit outdated) contributed modules for menus page.

However, you may have some special requirements, for example, to display some small portion of a menu inside the template of a node. There is no simple 'site building' solution for that. You most probably need to code a bit.

Vasi Chindris Thu, 04/13/2017 - 12:54

Let's say you have these requirements: a node which can be part of the main menu, and which could also have menu items bellow it, should display the first level of those menu items somewhere inside its template (so just as you would display a regular field).

The image above shows a very simple visual representation of what we'd like to achieve.

Now let's break this down into smaller and independent pieces. You can also skip to the entire code. Basically, you have to:

  • Load and render a menu (or parts of a menu).
  • Have a custom field available on the Manage display page for a content type, so that you can place it on the node page.

Let's actually start with the second part, as it is simpler.

Custom (extra) fields

There is the hook_entity_extra_fields_info hook which can be used to expose custom or extra fields on the entities. We'll use this hook to provide a custom field on a node.

The visible flag represents the default visibility setting of the field. Usually, you want this to be false, so you decide when the element is displayed and not when it is NOT displayed.

Now clear the cache and go to Structure >> Content types >> YourContentType, click on the Manage display tab and you should see your new field available there.

The next thing is to implement the hook_ENTITY_TYPE_view and particularly, in this case, hook_node_view. Here it is:

Save it, clear the cache, make sure that the field is visible in the display setting for that content type and visit a node of that type. You should see the custom text displayed.

So, we're done with the second part. Let's go and actually load the menu for this node and display the first level of menu items.

Render the menu

For this, we'll have to load a menu using a menu tree service and a set of parameters which define the root to start with, how many levels to load, and so on, then to apply a set of manipulators on the loaded tree that would check the access, do the sorting, etc, and finally to build the menu tree.

The root menu item

One of the tricky things is to get the correct root menu item. We know that the node can be part of a menu. It would be great if we could load a menu link based on the route name and some route parameters. For that, you can use the service.

Menu tree parameters

When loading a menu, we have to provide some parameters. For example, what the root of the menu you want to load (if you want to load a subtree, which is our case) is, or how many levels to load. These parameters are specified using a \Drupal\Core\Menu\MenuTreeParameters object.

More details about the MenuTreeParameters can be found here.

Load the menu

To load the menu, we will use the menu.link_tree service.

Menu tree manipulators

After we have the menu loaded, it is time to actually apply some manipulators on its menu items. These manipulators will deal with access checking, sorting according to the weights, or whatever other things you want to do with the menu tree. The code looks like that:

So, in this case, we want to check for the access and sort the items. There's a default tree manipulator service in Core which is Drupal\Core\Menu\DefaultMenuLinkTreeManipulators. That already provides a few basic manipulators you can apply to a menu tree, which is enough in our case. But of course, you can add any other callable to that array and use the implementation from Core as a guideline.

Build the menu

Finally, we have to build the menu. This is as simple as:

This would replace the

$build['my_custom_menu'] = [   '#markup' => 'Some custom menu', ]

that you used as a placeholder in the custom_node_view() hook.

And that's it. The first level of navigation, having the current node as root, will be displayed inside the template of your node.

Here is the entire code:

Categories: Blog: AGILEDROP: Agiledrop going to the WebCamp

Planet Drupal - Thu, 2017/04/13 - 9:19am
We must admit that in the past we were not so informative about where we will be and on which (Drupal) event we will go. We promise we'll do better from now on. This means that if you would like to talk to us in person, you'll know where to find us (you can also find us in our office of course). We'll start with a Web Camp we will attend next. A WebCamp will be held in Ljubljana on Saturday 22nd April 2017 in the Faculty of Computer and Information Science, Ljubljana. This is a place very familiar to our development director Bostjan Kovac because he got his bachelor’s degree there. An event… READ MORE

Valuebound: How to build a simple form using AJAX in Drupal 8

Planet Drupal - Thu, 2017/04/13 - 9:15am

Ajax is a script on the client side communicating asynchronously with the server without a complete page refresh.The best description I came across about Ajax as “the method of exchanging data with a server, and updating parts of a web page – without reloading the entire page.”

In our project, while creating a new account if we give the existing username, on submitting the page it will throw an error. But, instead of reloading the page, we can just update certain parts of DOM. This can be achieved using AJAX. So, here is the example how to implement this ajax in drupal 8 forms.

In order to build a simple form using AJAX in Drupal 8 , we created a form with Username field. Using ajax we are going to validate that field. To achieve this, create a…


erdfisch: Drupal Camp Northern Lights (Part 3)

Planet Drupal - Wed, 2017/04/12 - 6:03pm
Drupal Camp Northern Lights (Part 3) 12.04.2017 Michael Lenahan Body: 

This has, for reasons we are not quite sure of, ended up being a three-part blog post.

Part 1 is here and part 2 is here.

So, where we left off was at the tomato farm, where it felt like being in a future farm in outer space.

But the tomato farm is not only that. It is a pony (sorry, "Icelandic horse") farm as well!

On our way back to Reykjavik that evening, we were told "we have to hurry because a big storm is on its way".

When we woke up the next day, Reykjavik had experienced the biggest snow fall in 80 years, and all roads were closed.

There are some beautiful pictures of this here:…

None of this extraordinary weather deterred the incredible team who organized this event.

The Drupal camp at Drupal Camp Northern Lights

The amount of effort that went in to making sure we had a great time was truly amazing, and this was carried over into the sessions as well.

Sprint room

Oftentimes, I don't go into the sprint room at Drupal camps, you can have the feeling that you are interrupting something very important that you don't understand.

This time I thought "no, I'm among friends now" so I ventured in to the sprint room, and sheepishly explained that I'm new and looking for something to work on.

Enzo was there, and he helped me get started on a Drupal Console issue.

Here's how you get started:

And here is the issue I fixed a few weeks after coming back. I feel so proud!

Thanks, Enzo!

Drupal Twig - Mauricio Dinarte

This session was full of insider tips on how to get the most out twig, with lots of entertaining examples out of Drupal core.

You can see the slides here: - real version control of content - Rouven Volk

Rouven explained an interesting way of managing content using a git repository. We're used to having code in git, but there are times when the content needs to be equally trackable.

Rouven's approach is to use Drupal's content revisioning system together with git-wrapper to write all content revisions as commits into a git repository.

That means you can track changes to your content like this:

If you want to get involved with this, join us and work on it at

The Continuing Saga of Layouts in Drupal 8 - Tim Plunkett

Despite being a "certified" front-end developer I'm not really a front-end developer at all.

For this reason I'm very supportive of efforts to make Drupal front-end work less insane.

I was surprised and happy to discover that Tim's talk on Layouts was easy to understand, I even asked a question related to the way panels can be used without a UI.

I think all of this must have had something to do with the magic of Iceland, and this particular Drupal camp, where the entire atmosphere was so friendly that you felt you could chat with anyone about anything.

The Flexibility of Drupal 8 - Michael Miles (mikemiles86)

Mike Miles is a very entertaining and fun speaker to listen to. His talk showed 8 different ways to do a simple change in Drupal.

Slides and link to the code are here:

Or just go and watch the video already

Wrapping up

All that's left to say is thank you, thank you, thank you.

To the organizers and and all the others who I haven't named here.

As you said, Baddy: this was the coolest Drupal camp ever and an experience I think all of us will always remember.

Schlagworte/Tags:  planet drupal-planet Ihr Name Kommentar/Comment Kommentar hinzufügen/Add comment Leave this field blank

erdfisch: Drupal Camp Northern Lights (Part 2)

Planet Drupal - Wed, 2017/04/12 - 5:35pm
Drupal Camp Northern Lights (Part 2) 12.04.2017 Michael Lenahan Body: 

Thanks for sticking around. There will be more than just photos of us goofing around in Iceland, I promise.

For stuff about the actual Drupal Camp, please jump to the end of part three.

So, when we left you in part one, we were exploring the beautiful Golden Circle in Iceland.

We did, indeed, feel like true explorers.

We saw this awesome waterfall, the same one that was made famous by Kim Kardashian in her "Iceland Waterfall" tweet.

And then we went for dinner at this incredible place that grows tomatoes year-round using geothermal energy

More in part three which also features an Icelandic horse.

Schlagworte/Tags:  planet drupal-planet Ihr Name Kommentar/Comment Save Leave this field blank