Drupal

Appnovation Technologies: Simple Website Approach Using a Headless CMS: Part 1

Planet Drupal - 6 February 2019 - 12:00am
Simple Website Approach Using a Headless CMS: Part 1 I strongly believe that the path for innovation requires a mix of experimentation, sweat, and failure. Without experimenting with new solutions, new technologies, new tools, we are limiting our ability to improve, arresting our potential to be better, to be faster, and sadly ensuring that we stay rooted in systems, processes and...
Categories: Drupal

Kalamuna Blog: Drupalistas Spent Our Entire Swag Budget. Where did the Money Go?

Planet Drupal - 22 May 2018 - 3:09pm
Drupalistas Spent Our Entire Swag Budget. Where did the Money Go? Shannon O'Malley Tue, 05/22/2018 - 15:09

This April at DrupalCon Nashville, in addition to wanting to meet colleagues and soak up the great talks, we wanted to create a forum for the international Drupal community to do good. That’s why we used our sponsor booth wall as a space for attendees to promote nonprofits that work for causes that matter to them.

Categories Articles Community Drupal Nonprofits Author Shannon O'Malley
Categories: Drupal

Data Policy

New Drupal Modules - 22 May 2018 - 10:28am

The Data Policy module helps site owners or administrators with informing their users about which (personal) data is collected.

Next to providing functionality for informing users it also has the ability to add a data policy. It can be configured that users are prompted to accept the latest active data policy.

Categories: Drupal

UI Patterns Block

New Drupal Modules - 22 May 2018 - 9:02am

A simple module that allows UI patterns previews to be exposed as blocks. To use, install the module and visit the blocks page. Click "Place block" by a region of your choice, select the UI Patterns block and then select the desired pattern preview to render.

Categories: Drupal

Cuzzle

New Drupal Modules - 22 May 2018 - 8:37am

Cuzzle is a PHP library that formats Guzzle HTTP requests as a cURL command. With this module, all outbound HTTP requests are logged in a way that can be copied and run locally.

Categories: Drupal

GovUK Pay

New Drupal Modules - 22 May 2018 - 2:21am

This Drupal 8 module provides an integration with GOV.UK Pay, a secure payment service that is easy to integrate with and designed to meet the Digital Service Standard. Give your users a trusted GOV.UK-branded payment experience.

Categories: Drupal

Web Omelette: How to render entity field widgets inside a custom form

Planet Drupal - 21 May 2018 - 11:43pm

In an older article we looked at how to render an entity form programatically using custom form display modes. Fair enough. But did you ever need to combine this form with a few form elements of yours which do not have to be stored with the corresponding entity? In other words, you need to be working in a custom form…

What I used to do in this case was write my own clean form elements in a custom form and on submit, deal with saving them to the entity. This is not a big deal if I am dealing with simple form elements, and of course, only a few of them. If my form is big or complex, using multivalue fields, image uploads and stuff like this, it becomes quite a hassle. And who needs that?

Instead, in our custom form, we can load up and add the field widgets of our entity form. And I know what you are thinking: can we just build an entity form using the EntityFormBuilder service, as we saw in the previous article, and just copy over the form element definitions? Nope. That won’t work. Instead, we need to mimic what it does. So how do we do that?

We start by creating a nice form display in the UI where we can configure all our widgets (the ones we want to show and in the way we want them to show up). If the default form display is good enough, we don’t even need to create this. Then, inside the buildForm() method of our custom form we need to do a few things.

We create an empty entity of the type that concerns us (for example Node) and store that on the form state (for the submission handling that happens later):

$entity = $this->entityTypeManager->getStorage(‘node’)->create([ 'type' => ‘article’ ]); $form_state->set(‘node’, $node);

Next, we load our newly created form display and store that also on the form state:

/** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */ $form_display = $this->entityTypeManager->getStorage('entity_form_display')->load('node.article.custom_form_display'); $form_state->set('form_display', $form_display);

You’ll notice that the form display is actually a configuration entity whose ID is made up of the concatenation of the entity type and bundle it’s used on, and its unique machine name.

Then, we loop over all the components of this form display (essentially the field widgets that we configure in the UI or inside the base field definitions) and build their widgets onto the form:

foreach ($form_display->getComponents() as $name => $component) { $widget = $form_display->getRenderer($name); if (!$widget) { continue; } $items = $entity->get($name); $items->filterEmptyItems(); $form[$name] = $widget->form($items, $form, $form_state); $form[$name]['#access'] = $items->access('edit'); }

This happens by loading the renderer for each widget type and asking it for its respective form elements. And in order for it to do this, it needs an instance of the FieldItemListInterface for that field (which at this stage is empty) in order to set any default values. This we just get from our entity.

And we also check the access on that field to make sure the current user can access it.

Finally, we need to also specify a #parents key on our form definition because that is something the widgets themselves expect. It can stay empty:

$form['#parents'] = [];

Now we can load our form in the browser and all the configured field widgets should show up nicely. And we can add our own complementary elements as we need. Let’s turn to the submit handler to see how we can easily extract the submitted values and populate the entity. It’s actually very simple:

/** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */ $form_display = $form_state->get('form_display'); $entity = $form_state->get('entity'); $extracted = $form_display->extractFormValues($entity, $form, $form_state);

First, we get our hands on the same form display config and the entity object we passed on from the form definition. Then we use the former to “extract” the values that actually belong to the latter, from the form state, into the entity. The $extracted variable simply contains an array of field names which have been submitted and whose values have been added to the entity.

That’s it. We can continue processing our other values and save the entity: basically whatever we want. But we benefited from using the complex field widgets defined on the form display, in our custom form.

Ain't that grand?

Categories: Drupal

Mark Shropshire: CharDUG Presents Drupal 8 Training Series

Planet Drupal - 21 May 2018 - 8:09pm

During the past few CharDUG (Charlotte Drupal User Group) meetings, I realized that we have a real need to help our existing Charlotte area Drupalers using Drupal 7 to move on to Drupal 8. There is also a huge opportunity to train those completely new to web development and Drupall. Out of some recent conversations, I have put together a training series that will span the next 6 months and become the focus for each of our monthly meetings on the 2nd Wednesday of each month.

The CharDUG Drupal 8 Training Series is a comprehensive set of training workshops to get attendees up to speed with all aspects of Drupal 8. Whether you are brand new to Drupal, focused on content management, a frontend or backend developer, or devops engineer, this series contains what you will need to utilize Drupal 8 to its potential. Attendees should bring friends, laptops, and questions. There is no need to attend all sessions, though recommended for those new to Drupal. An outline of what to expect is provided below. If you have questions or suggestions, don’t hesitate to reach out on meetup.com or @chardug.

Drupal 8: Installation and Features
  • June 2018
    • What is Drupal?
      • Community
      • Open Source
      • Contributing to Drupal
    • How to install Drupal 8
    • Important features of note
    • Changes since Drupal 7
    • Drupal release schedule
Drupal 8: Site Building
  • Julu 2018
    • Installing Drupal 8
    • Using Composer with Drupal
    • How to build a site without any development
      • Installing modules and themes
    • Top Drupal 8 contributed modules
    • Users, roles, and permissions
    • Configuring Drupal
Drupal 8: Managing Content
  • August 2018
    • Content management concepts
      • Content types
      • Content authoring experience
      • Content moderations
      • Permissions and roles
      • Content scheduling
    • Creating and editing content
    • Blocks
    • Layout Builder
    • Paragraphs
Drupal 8: Layout and Theming
  • September 2018
    • Layout options
    • Responsive design
    • Images and media
    • Developing a Drupal theme
    • Drupal and responsive layouts
    • Decoupled Drupal frontends
Drupal 8: Module Development
  • October 2018
    • Developing a module
      • Menus and routes
      • Permissions
      • Creating pages and admin forms
      • Event subscribers
    • Writing and running tests
Drupal 8: Deployment and Next Steps
  • November 2018
    • Deploying to production
      • Development workflows
      • Security
        • Guardr
      • SEO
    • Next steps for Drupal
      • Drupal 9
      • New initiatives
      • Decoupled Drupal
Blog Category: 
Categories: Drupal

Loopit

New Drupal Modules - 21 May 2018 - 1:38pm
Introduction
  • Unified and centralised helper to recursively traverse an aggregate. Have a nested array of the traversal output as a transformation of the root level aggregate.
  • Each aggregate is responsible how it exposes his elements. There are traversal events that are fired from the recursive aggregate iterator trait (for use in the extended SPL recursive iterators).
  • Filter to match for « array parents » based subset with wild card capability like « starts with », « ends with », « contains » and « all »
  • Implementation for « object to array » transformation with unlimited depth. Sub module for display it that uses the Krumo library and has a copy of the javascript code from the Drupal 7 Search Krumo module.
Categories: Drupal

Hide All

New Drupal Modules - 21 May 2018 - 8:56am

Hide all modules and themes from the UI.

Categories: Drupal

GDPR Form Compliance

New Drupal Modules - 21 May 2018 - 7:21am
Overview

According to the EU General Data Protection Regulation (GDPR) you have to optain the permission of your users whenever a form collects and saved personal data (e. g. contact forms).

This module helps you to add a single mandatory checkbox to each formular of your page. You are free to configure the formulars and the checkbox text you want to add.

Categories: Drupal

Multi Type Image Slider

New Drupal Modules - 21 May 2018 - 5:30am

The Multitype Slider entity type is a simple custom entity type that allow management to add slider with many slider type option in the content. This module are used to created a different type of slider.

Available Slider Option

Full Width Slider',
Image Slider
Simple Fade Slideshow
Image Gallery
Image Gallery With Vertical Thumbnail
Scrolling Logo Thumbnail Slider
Thumbnail Navigator With Arrows
Vertical Slider
Nearby Image Partial Visible Slider
Carousel Slider
Banner Slider
Banner Rotator

Categories: Drupal

old reset link

New Drupal Modules - 21 May 2018 - 4:31am

When you submit for reset password to create new one and you request multiple times to reset password and get mail regarding reset password link so by default you can reset your password with any link for the first time.

But after enabling this, it provides user to restrict the all old reset password link. You can reset password with latest reset password link only within timeout.

Categories: Drupal

Expire reset password link

New Drupal Modules - 21 May 2018 - 2:55am

On multiple submitting of reset password form causes to multiple email notifications to a user in a sequence. Any random email notification can be use to reset password, which causes to vulnerability issue i.e. only last generated notification email should be valid to reset the password, all others notifications should get expired.

To solve this vulnerability issue, this module expires all the multiple notifications except last notification email sent to user.

Categories: Drupal

Expire link

New Drupal Modules - 21 May 2018 - 2:30am
Categories: Drupal

Axe

New Drupal Modules - 21 May 2018 - 2:13am
Categories: Drupal

Jeff Geerling's Blog: Hosted Apache Solr's Revamped Docker-based Architecture

Planet Drupal - 20 May 2018 - 6:18pm

I started Hosted Apache Solr almost 10 years ago, in late 2008, so I could more easily host Apache Solr search indexes for my Drupal websites. I realized I could also host search indexes for other Drupal websites too, if I added some basic account management features and a PayPal subscription plan—so I built a small subscription management service on top of my then-Drupal 6-based Midwestern Mac website and started selling a few Solr subscriptions.

Back then, the latest and greatest Solr version was 1.4, and now-popular automation tools like Chef and Ansible didn't even exist. So when a customer signed up for a new subscription, the pipeline for building and managing the customer's search index went like this:

Original Hosted Apache Solr architecture, circa 2009.

Categories: Drupal

Jeff Beeman: Rebuilding jeffbeeman.com: My local development environment and workflow

Planet Drupal - 20 May 2018 - 1:20pm
Rebuilding jeffbeeman.com: My local development environment and workflow Last week I talked about setting up a new project using BLT, Dev Desktop, and Lightning. Today, I’ll talk more about my local environment setup and give a brief overview of my development and deployment workflow. Jeff Beeman Sun, 05/20/2018 - 13:20
Categories: Drupal

GraphQL Redirect

New Drupal Modules - 20 May 2018 - 10:42am

GraphQL Redirect is a simple module extending contributed GraphQL module. It replaces default route handling so that GraphQL query follows redirect path and returns query result for the destination route. It supports multilingual environment and recursive redirects.

Categories: Drupal

Say Hello Dialogflow

New Drupal Modules - 20 May 2018 - 10:29am
Categories: Drupal

Pages

Subscribe to As If Productions aggregator - Drupal