Third & Grove: Overriding Admin Views in Drupal 7

Planet Drupal - 7 July 2017 - 7:00am
Overriding Admin Views in Drupal 7 josh Fri, 07/07/2017 - 10:00
Categories: Drupal

Token Language

New Drupal Modules - 7 July 2017 - 6:52am

The token modules provides only tokens about the language a node is in.

There are use cases where, for example a field help text, needs to link to another page prefixed by the current interface language code.

This module adds the missing tokens about the interface language:

  • Current language name.
  • Current language code.

This module requires the token module.

Categories: Drupal

Mediacurrent: Friday 5: 5 Reasons to Attend a Drupal Camp

Planet Drupal - 7 July 2017 - 5:47am

Happy Friday everyone, and a happy 4th of July weekend. This week we have April Sides on the program to talk about how much fun Drupal Camps are and what you will take away from them. 


Categories: Drupal

Minimum Cardinality Required

New Drupal Modules - 7 July 2017 - 4:37am

Module to add unlimited cardinality with minimum field require.

Example : if suppose user set minimum cardinality -2 then user require to fill 2 data that field.

Categories: Drupal

Profile2 Regpath Exportable

New Drupal Modules - 7 July 2017 - 12:44am

This module enables you to export your Profile2 Registration Path
settings in features.

Categories: Drupal

Comic Relief Technology Blog: Why we made our platform product open-source

Planet Drupal - 6 July 2017 - 11:35pm
Drupal 8 at Comic Relief Over the last year a key objective for the Technology team at Comic Relief has… Read More
Categories: Drupal

Commerce ePayco

New Drupal Modules - 6 July 2017 - 7:31pm

ePayco is a Colombian payment gateway. With this module, you can:

  • Integrate ePayco Off-site payments with Drupal commerce 2.x (More features could be added later).
  • Set-up global gateway settings and override those settings per store (useful to allow sellers to have their own payment account at ePayco platform).
  • Alter payment data dinamically (a basic hook is provided if you need specific information).
Categories: Drupal

Site Access

New Drupal Modules - 6 July 2017 - 4:26pm

This project is inspired by the ban module in core but is a bit more configurable.

You are able to create a pipeline of different RequestCheckers that are configurable to decide whether to forbid the request or not.

RequestCheckers are plugins allowing any modules to add new ones. Currently, there are

Allows you to define a list of IPs that allow access.

Allows you to add Google Authentication to allow access.

Only allows HTTPS access to the site.

Categories: Drupal

Erik Erskine: DrupalCamp Bristol 2017

Planet Drupal - 6 July 2017 - 4:00pm

Drupal has a thriving community in Bristol and the south-west, and they've put on some excellent events over the last few years. Last weekend they had their third DrupalCamp Bristol, and I was fortunate to be able to attend and speak.

Read more

Categories: Drupal

Mediacurrent: DrupalCon Baltimore 2017 - SEO, i18n, and i18n SEO

Planet Drupal - 6 July 2017 - 11:09am

DrupalCon Baltimore 2017 was, without a doubt, a great event. The first DrupalCon to hit the US East Coast since DrupalCon DC in 2009 so this (ex-) New Englander was happy to have just a day's drive to get there.

Categories: Drupal

ThinkShout: Upgrading MailChimp eCommerce and an Introduction to Drupal 8's Event System

Planet Drupal - 6 July 2017 - 9:00am

If you’ve ever built a Drupal 7 module, then you’ll be familiar with hooks: functions that allow modules to react to things happening in other modules. The hook system is functionally fine but, with so many hooks to implement, .module files often become bloated and difficult to manage.

Drupal 8’s event system does a lot to reduce the clutter of hooks. Now, instead of using a hook, you can create an event subscriber that will execute your code every time a module triggers an event. This is similar to the hook system only in the effect; the execution is very different.

Porting our popular MailChimp eCommerce module to Drupal 8 gave me the perfect opportunity learn about the event system. I use the word “opportunity” to disguise the fact that I was forced to learn how events work because it was impossible to port the module without doing so.

The MailChimp eCommerce module depends on the Commerce module, naturally, and in Drupal 8, the Commerce module makes heavy use of events.

First, let’s look at an event. I’m using an example ripped straight from Commerce.

The Commerce submodule, Commerce Cart, contains a class named CartEntityAddEvent. You can find it here.

The class itself is simple; it’s designed to store a few values - the cart, the item being added to the cart, and the quantity of that item. The class also has a few getter functions for convenience.

Most importantly, this class represents an event that’s triggered every time a user adds an item to their shopping cart. This is done using just two lines of code:

$event = new CartEntityAddEvent($cart, $purchased_entity, $quantity, $saved_order_item); $this->eventDispatcher->dispatch(CartEvents::CART_ENTITY_ADD, $event);

The event class is created with all the relevant values, then “dispatched” to any event subscribers configured to pay attention to it. When dispatched, the event is identified by a constant - CartEvents::CART_ENTITY_ADD. This constant is used by event subscribers, which we’ll take a look at now.

This is a cut-down version of an event subscriber used by our world famous MailChimp eCommerce module.

/** * Event Subscriber for Commerce Carts. */ class CartEventSubscriber implements EventSubscriberInterface { /** * The Cart Handler. * * @var \Drupal\mailchimp_ecommerce\CartHandler */ private $cart_handler; /** * The Order Handler. * * @var \Drupal\mailchimp_ecommerce\OrderHandler */ private $order_handler; /** * CartEventSubscriber constructor. * * @param \Drupal\mailchimp_ecommerce\CartHandler $cart_handler * The Cart Handler. * @param \Drupal\mailchimp_ecommerce\OrderHandler $order_handler * The Order Handler. */ public function __construct(CartHandler $cart_handler, OrderHandler $order_handler) { $this->cart_handler = $cart_handler; $this->order_handler = $order_handler; } /** * Respond to event fired after adding a cart item. */ public function cartAdd(CartEntityAddEvent $event) { /** @var \Drupal\commerce_order\Entity\Order $order */ $order = $event->getCart(); /** @var \Drupal\commerce_order\Entity\OrderItem $order_item */ $order_item = $event->getOrderItem(); $product = $this->order_handler->buildProduct($order_item); $this->cart_handler->addCartLine($order->id(), $order_item->id(), $product); } /** * {@inheritdoc} */ public static function getSubscribedEvents() { $events[CartEvents::CART_ENTITY_ADD][] = ['cartAdd']; return $events; } }

Here’s the complete version, if you’re interested.

So what does it do, exactly?

Let’s start with the getSubscribedEvents() function. This is where we define which events we want to subscribe to, and assign each event a processing function. Here we are subscribing to just one event, the “cart entity add” event, and assigning the cartAdd() function as a processor.

Note that the cartAdd() function takes one argument, an instance of the CartEntityAddEvent class. That’s the same class we looked at earlier - the event class defined in the Commerce Cart module. This is where our module reacts to that event being triggered.

The cartAdd() function itself extracts the order and item information from the event and uses an instance of the CartHandler class, provided by the MailChimp eCommerce module, to send updated cart information to MailChimp’s API.

One final thing:

Event subscribers won’t work unless they are defined as a service. Services are defined in a module’s *.services.yml file, which you can learn more about here.

The service definition for the CartEventSubscriber looks like this:

mailchimp_ecommerce_commerce.cart_event_subscriber: class: '\Drupal\mailchimp_ecommerce_commerce\EventSubscriber\CartEventSubscriber' arguments: ['@mailchimp_ecommerce.cart_handler', '@mailchimp_ecommerce.order_handler'] tags: - { name: event_subscriber }

We identify the class using its namespace, inject the “cart_handler” and “order_handler” services, then, finally, tag the service as an “event_subscriber”. Check out the full file here. Just for completeness, the two injected services are defined in here.

I’m a big fan of how Drupal 8 has shifted towards a more object-oriented way of doing things. It’s more organized, promotes consistency between modules, and, best of all, finally signals an end to massive .module files.

Categories: Drupal

Advomatic: Using Configuration Split to have dev-only configuration in Drupal 8

Planet Drupal - 6 July 2017 - 8:07am

The problem If you are using Drupal’s Configuration Management subsystem to deploy configuration out to the production environment, you’ll run into a problem where the configuration .yml files contain your development settings.  To avoid this you’ll need to use the Configuration Split module.  I couldn’t find any good documentation for this, so I had to... Read more »

The post Using Configuration Split to have dev-only configuration in Drupal 8 appeared first on Advomatic.

Categories: Drupal

Zivtech: Drupal vs. WordPress for Higher Education Websites

Planet Drupal - 6 July 2017 - 7:32am

You’re about to begin a huge overhaul of your higher education website and one of the first steps is choosing a content management system. It’s likely that Drupal and WordPress have come up in your research, and you may be trying to decide between the two.

Drupal and WordPress are often compared to one another because they’re both open source content management systems. Both are capable of creating clean, responsive websites that are easy to manage for content editors. The functionality of both can be extended using third party code. And the code for both is openly available for anyone to use, change, and distribute, meaning there are no licensing fees like those required by closed source options. 

There are a significant number of higher education websites on Drupal; Harvard, Brown, and Oxford University all use the CMS, to name a few. According to Drupal.org, 71% of the top 100 universities use Drupal. And there’s some sound reasoning behind that.

Both WordPress and Drupal have strengths and are well suited for a diverse range of projects. WordPress was primarily built for standalone websites or blogs with minimal variation in content types. Drupal was built for more complex, feature rich websites that require significant interconnectivity between pages or site sections, like those required by higher education. 

Here are some factors to consider when choosing between the two content management systems. 

Read more
Categories: Drupal

Create user permission

New Drupal Modules - 6 July 2017 - 4:27am

This module makes it possible to make people be able to create users, without granting them the permission to "administer users".

Combined correctly, you can then make people create users of roles "beneath" them in the role hierarchy, both without passing out that permission and without enabling users to register themselves.

Categories: Drupal

One Time Password

New Drupal Modules - 6 July 2017 - 3:15am

One Time Password is an opinionated, lightweight, zero-configuration module with 100% test coverage. It provides two factor authentication to users by way of the Time-based One-time Password Algorithm (RFC 6238).

Many apps implement this spec, providing users lots of options for storing and managing their one-time-passwords. Some popular apps which will integrate with this module are:

Categories: Drupal

IDer login

New Drupal Modules - 6 July 2017 - 3:02am

With this plugin you can provide login and registration process using the IDer Service.
An additional “Login with IDer” button will appears along the regular one.

Categories: Drupal

Flocon de toile | Freelance Drupal: The 13 mythical (or not) defects of Drupal 8

Planet Drupal - 6 July 2017 - 3:00am
Having had the opportunity to read a recent comparative study between Drupal 8 and SPIP, I discovered a Drupal perception that is not mine. Far be it from me to want to compare Drupal and SPIP. Indeed, I know very badly SPIP, at least only as a basic user, and much less than Drupal, and so I will not venture on such a comparison. Also, I wanted to share these mythical, real or perceived defects of Drupal 8, which I recently discovered and which I think deserve a counterpoint.
Categories: Drupal


New Drupal Modules - 6 July 2017 - 1:53am
Categories: Drupal

heykarthikwithu: Setup Multiple Drush version's on your machine, make Drupal maintenance easier

Planet Drupal - 6 July 2017 - 1:36am
Setup Multiple Drush version's on your machine, make Drupal maintenance easier

How to setup Multiple Drush's in your machine, to manage the drupal 6, drupal 7 and drupal 8 sites..

heykarthikwithu Thursday, 06 July 2017 - 14:06:12 - IST, Asia/Kolkata
Categories: Drupal

Password Encrypt

New Drupal Modules - 6 July 2017 - 12:18am

This module encrypts the user password on user form submission. It prevents the propagation of plain password over internet on user form submission.

Categories: Drupal


Subscribe to As If Productions aggregator - Drupal