Creating Content with YAML Content Module

Posted by Mediacurrent - 6 hours 12 min ago
Creating Content with YAML

In my previous post, I introduced the YAML Content module and described the goal and usage for it at a high level. In this post, I aim to provide a more in-depth look at how to write content for the module and how to take advantage of a couple of the more advanced options included.

Config Management Roundup

Posted by Glassdimly tech Blog - 13 hours 44 min ago

Quite the problem—Drupal config management on local and prod.

Drupal 8 can be quite punctilious: it will simply refuse to work if there's a mismatch between database and config objects on the filesystem.

So... how do we manage two sets of configurations—one for local, and one for production?

The Problem

I have modules like varnish installed on production that shouldn't be enabled on local, and modules that are enabled on local that shouldn't be enabled on production.

See what’s new in Drupal Commerce 2.0-rc1

Posted by Drupal Commerce - 21 Jul 2017 at 20:34 UTC

Eight months ago we launched the first beta version of Commerce 2.x for Drupal 8. Since then we’ve made 304 code commits by 58 contributors, and we've seen dozens of attractive, high-performing sites go live. We entered the release candidate phase this month with the packaging of Commerce 2.0-rc1 (release notes), the final part of our long and fruitful journey to a full 2.0.

Introducing a new Promotions UI:

Some of the most exciting updates this Summer center around our promotions system. This work represents a huge leap forward from Commerce 1.x, as we've made promotions first class citizens in core. They power a variety of discount types and coupons, and now that they are in core we can ensure the systems are designed to look and work well on both the front end and back end.

Read on to learn more about what's new in promotions, payment, taxes, and more...

Parse HTML in Drupal 8 to Get Attributes

Posted by Glassdimly tech Blog - 21 Jul 2017 at 16:50 UTC

Often one finds oneself needing to parse HTML. Back in the day, we used regexes, and smoked inside. We didn't even know about caveman coders back then. Later, we'd use SimpleHtmlDom and mostly just swore when things didn't quite work as expected. Now, we use PHP's DomDocument, and in Drupal we create them using Drupal's HTML utility.

Hook 42 goes to Washington!

Posted by Hook 42 - 21 Jul 2017 at 16:38 UTC
Drupal GovCon Logo

Hook 42 is expanding our enterprise Drupal services to the public sector. It’s only logical that our next trek is to Drupal GovCon!

We are bringing some of our colorful San Francisco Bay Area love to DC. We will be sharing our knowledge about planning and managing migrations, as well as core site building layout technologies. The most exciting part of the conference will be meeting up with our east coast Drupal community and government friends in person.

Dependency injection and Service Containers

Posted by Anubavam Blog - 21 Jul 2017 at 11:43 UTC
Dependency injection and Service Containers

A dependency is an object that can be used (a service). An injection is the passing of a dependency to a dependent object (a client) that would use it. The service is made part of the client's state. Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern." Dependency injection is an advanced software design pattern and applying it will increase flexibility. Once you wrap your head around this pattern, you will be unstoppable.

A practical example of accessing services in objects using dependency injection

For the following example, let's assume we are creating a method that will use the service of A, we need to pull the dependencies of B and C into the plugin which we can use to inject whichever services we require.

  • Application needs A so:
  • Application gets A from the Container, so:
  • Container creates C
  • Container creates B and gives it C
  • Container creates A and gives it B
  • Application calls A
  • A calls B
  • B does something

Types of Dependency Injection

There are different types of Dependency Injection:

  • Constructor injection
  • Method injection
  • Setter and property injection
  • PHP callable injection

Constructor Injection

The DI container supports constructor injection with the help of type hints(Type hinting we can specify the expected data type) for constructor parameters. The type hints tell the container which classes or interfaces are dependent when it is used to create a new object. The container will try to get the instances of the dependent classes or interfaces and then inject them into the new object through the constructor.

Method Injection 

In constructor injection we saw that the dependent class will use the same concrete class for its entire lifetime. Now if we need to pass separate concrete class on each invocation of the method, we have to pass the dependency in the method only.

Setter & Property Injection

Now we have discussed two scenarios where in constructor injection we knew that the dependent class will use one concrete class for the entire lifetime. The second approach is to use the method injection where we can pass the concrete class object in the action method itself. But what if the responsibility of selection of concrete class and invocation of method are in separate places. In such cases we need property injection.

PHP Callable Injection

Container will use a registered PHP callable to build new instances of a class. Each time when yii\di\Container::get() is called, the corresponding callable will be invoked. The callable is responsible to resolve the dependencies and inject them appropriately to the newly created objects

Dependency Injection: Advantages & Disadvantages


Reducing the dependency to each other of objects in application.
Unit testing is made easier.
Loosely couple 
Promotes re-usability of code or objects in different applications
Promotes logical abstraction of components.


DI increases complexity, usually by increasing the number of classes since responsibilities are separated more, which is not always beneficial.
Code will be coupled to the dependency injection framework.
It takes time to learn
If misunderstood it can lead to more harm than good


Dependency injection is a very simple concept of decoupling your code and easier to read. By injecting dependencies to objects we can isolate their purpose and easily swap them with others. 

The service container is basically there to manage some classes. It keeps track of what a certain service needs before getting instantiated, does it for you and all you have to do is access the container to request that service. Using it the right way will save time and frustration, while Drupal developers will even make it easier for the layman. 


admin Fri, 07/21/2017 - 07:43 Drupal developer Drupal Application Development

CiviProxy and CiviMcRestFace sprint in Bonn

Posted by CiviCRM Blog - 21 Jul 2017 at 08:40 UTC

CiviCooP and Systopia and Palasthotel have been working together on CiviProxy and CiviProxy. This blog is a round up of what we have achieved in the last couple of days. The first thing we have achieved is that we had fun and a very good work atmosphere. We made long days and made lots of progress.

What are CiviProxy and CiviMcRestFace?

CiviProxy is a script to act as an application firewall for CiviCRM. It could be used to put your civicrm in secure network. CiviProxy is the gatekeeper to which external systems, such as your website, connect (this is for example when a user signs a petition on your website and the website submits this data to your CiviCRM). CiviProxy will make sure the call is from the right place (ip-adress) and is only doing what allowed to do. 

CiviMcRestFace (CiviMRF) is a framework to be used in other systems (such as your external website) to connect to CiviCRM. The framework itself is divided in three parts: the abstract core (CMS/System independent), the core implementation (e.g. a Drupal 7 implementation), and lastly the module who is doing the actual submission (for example the cmrf_webform module which provides the functionality to submit a webform to CiviCRM).

What we have achieved:

  • Completed the documentation on CiviProxy:
  • Got a working drupal 7 module with CiviMcRestFace:
    • Completed screens for set up connection profiles (you can also provide the connection credentials through your module with an api; so that you can store them somewhere outside the database)
    • Completed screen for the call log (a call is submission to CiviCRM through CiviMcRestFace)
    • Added functionality to queue calls and run them in the background and added functionality to retry failed calls
    • Added a basic webform integration module to submit a webform to the CiviCRM Api
    • Added a rules integration module so that you can perform additional actions when a call succeeds or fails. Probably a use case is when a call fails you want to send the data by e-mail to the CiviCRM Administrator so that he or she can enter the data manually.
    • Added an example module so you can see how you could use the cmrf_core module in your durpal projects
    • Code:
  • Got a start with the drupal 8 module for CiviMcRestFace:


ToolsAPIArchitectureCiviCRMCommunityDocumentationDrupalDrupal 8Sprints

Connecting with the Community at Drupal Camp Asheville 2017

Posted by Ryan Szrama - 20 Jul 2017 at 22:30 UTC

Last weekend I had the pleasure of attending Drupal Camp Asheville 2017 ('twas my fourth year in a row : ). I absolutely love this event and encourage you to consider putting it on your list of Drupal events to hit next year. The Asheville area is a beautiful (and delicious) place to spend the weekend, but the bigger draw for me is the people involved:

Drupal Camp Asheville 2017 group photo
(Check out all the pictures in the album on Flickr.)

Drupal Camp Asheville is always well organized (seriously, it's in the best of the best small conferences for venue, amenities, and content) and attended by a solid blend of seasoned Drupal users / contributors and newcomers. I live only an hour away, so I get to interact with my Drupal friends from Blue Oak Interactive, New Valley Media, and Kanopi on occasion, but then on Camp weekend I also get to see a regular mix of folks from Mediacurrent, Code Journeymen, Lullabot, Palantir, FFW, CivicActions, end users like NOAA, and more.

This year we got to hear from Adam Bergstein as the keynote speaker. Unfortunately, that "we" didn't include me at first, as I managed to roll up right after Adam spoke ... but his keynote is on YouTube already thanks to Kevin Thull! I encourage you to give it a listen to hear how Adam's experience learning to work against his own "winning strategy" as a developer (that of a honey badger ; ) helped him gain empathy for his fellow team members and find purpose in collaborative problem solving to make the world a better place.

I gave a presentation of Drupal Commerce 2.x focusing on how we've improved the out of the box experience since Commerce 1.x. This was fun to deliver, because we really have added quite a bit more functionality along with a better customer experience in the core of Commerce 2.x itself. These improvements continued all the way up to our first release candidate tagged earlier this month, which included new promotions, coupons, and payment capabilities.

Many folks were surprised by how far along Commerce 2.x is, but now that Bojan has decompressed from the RC1 sprint, I expect we'll start to share more about the new goodies on the Drupal Commerce blog. (If you're so inclined, you can subscribe to our newsletter to get bi-weekly news / updates as well.)

Lastly, I loved just hanging out and catching up with friends at the venue and at the afterparty. I played several rounds of a very fun competitive card game in development by Ken Rickard (follow him to find out when his Kickstarter launches!). I also enjoyed several rounds of pool with other Drupallers in the evening and closed out the night with cocktails at Imperial Life, one of my favorite cocktail bars in Asheville. I treasure these kinds of social interactions with people I otherwise only see as usernames and Twitter handles online.

Can't wait to do it again next year!

Arsenal using Drupal

Posted by Dries Buytaert - 20 Jul 2017 at 19:11 UTC

As a Belgian sports fan, I will always be a loyal to the Belgium National Football Team. However, I am willing to extend my allegiance to Arsenal F.C. because they recently launched their new site in Drupal 8! As one of the most successful teams of England's Premier League, Arsenal has been lacing up for over 130 years. On the new Drupal 8 site, Arsenal fans can access news, club history, ticket services, and live match results. This is also a great example of collaboration with two Drupal companies working together - Inviqa in the U.K. and Phase2 in the US If you want to see Drupal 8 on Arsenal's roster, check out!


Memory Management with Migrations in Drupal 8

Posted by Mediacurrent - 20 Jul 2017 at 16:32 UTC
Memory Management with Migrations in Drupal 8

When dealing with a site migration that has hundreds of thousands of nodes with larger than usual field values, you might notice some performance issues.

In one instance recently I had to write a migration for nodes that had multiple fields of huge JSON strings and parse them.  The migration itself was solid, but I kept running into memory usage warnings that would stop the migration its tracks.

Sometime during the migration, I would see these messages:

Fine Arts Museums of San Francisco

Posted by Palantir - 20 Jul 2017 at 16:00 UTC
Fine Arts Museums of San Francisco FAMSF site displayed on a laptopbrandt Thu, 07/20/2017 - 11:00 Creating a Modular, Interactive Learning Tool for Art Exhibits

Creating a Modular, Interactive Learning Tool on Drupal 8

  • A media-rich, modular template built on Drupal 8
  • Innovative feature components to create context with a variety of content
  • Expansion of existing brand elements to create cohesive but unique identities

We want to make your project a success.

Let's Chat. Our Client

The Fine Arts Museums of San Francisco (FAMSF) is the largest public arts institution in the city of San Francisco and one of the largest art museums in the state of California. With an annual combined attendance of 1,442,200 people for the two museums (the Legion of Honor and the de Young), FAMSF sought a way to expand the experience for attendees beyond the reach of the physical exhibits themselves and to deepen visitors’ engagement with the art. From this goal, the idea of ‘Digital Stories’ was born.

The Challenge of ‘Digital Stories’

FAMSF had an interesting challenge:

  • They wanted to create engaging, interactive websites for each future exhibition. 
  • They wanted each exhibit website to be unique – not employing the same template over and over. 
  • They wanted these websites to serve as educational tools for their exhibits over the course of many years. 
  • They required a platform that museum staff could use to author without starting from scratch. 
  • They needed to create these website for their two museums — the Legion of Honor and the de Young — with different branding appropriate to each museum and to their respective exhibitions. 

In short, they required a tool that allowed them to “spin up” unique, interactive educational microsites for multiple exhibits, across two museums, for several years.

FAMSF had seen various treatments of text, images, audio, and video on the web that they felt could be used as inspiration for interactive features for their content, that when combined together could provide a larger learning experience for visitors. Those treatments included an expansive use of the standards in HTML5 and CSS3, along with a series of exciting Javascript libraries that expand interactions further than what is offered through HTML and CSS.

The problem also required more than a front-end solution to create the interactions. It needed to be built on a content management system — Drupal 8 in this case — that could support their content editors, providing them with a tool where they could simply upload and arrange content to produce amazing, dynamic exhibit sites.

The Solution

Understanding the brands

In order to create an adaptable template for the museums, we needed to first understand the two brands. The Legion of Honor displays a European collection that spans ancient cultures to early modernism.. The exhibits are seen as authoritative manifestos. The de Young, on the other hand, houses diverse collections including works from Africa, Oceania, Mesoamerica, and American Art. The exhibits are challenging and exploratory, and invite visitors to think about art in new and different ways. The framework for the microsites needed to be flexible enough to convey either brand effectively.

Understanding the content

The FAMSF project was unique in that it wasn’t the typical content strategy we do for websites. Because this project was more interaction and feature driven, our content strategy was focused on the different elements of the stories to be told, and how we could showcase those elements to create an expansive experience for visitors. For example, users should be able to zoom in on a painting to get a closer look, or be able to click on a question and see the answer display.

Creating the right interactive features

With so many different possible elements, it was important to narrow down the interactions and feature components that they needed. These components needed to match their content and also have the ability to be executed in a tight timeline.

For overall presentation treatment, we introduced a flexible content area where individual sections could be introduced as revealable “card sections”. Within each card section, a site administrator can first choose to add hero content for that section which could include either background images or background video, plus various options for placement and style of animated headers.

Next within the card section, a series of “Section Layout Components” were available, such as single column or two columns side-by-side that they could choose from. Within the column sections they could place modular content components that included media (video, images, audio) and text.

Menu features for the Early Monet site, one of the Digital Stories for the Legion of Honor Museum.Menu features for the Early Monet site, one of the Digital Stories for the Legion of Honor Museum.

We used a custom implementation of several JavaScript and jQuery libraries to achieve the card-reveal effect (pagePiling.js) and animated CSS3 transitions as slides are revealed, using a suite of CSS3 animation effects, particularly for Hero sections of slides. Additionally, implementation of a JavaScript library (lazyloadxt) for lazy-loading of images was critical for the success of the desired media-rich pages in order to optimize performance. All were coded to work on modern mobile and desktop browsers, so that every experience would be rich, no matter the type of device it was displayed on.

Many interactive components went through a process of discovery and iteration achieved through team collaboration, taking into account the strategic needs of each component to increase user engagement, along with content requirements of the component, look, feel and interactivity. Components as well as the general treatment were presented as proof-of-concept, where additional client feedback was taken into account. Most interactivity on individual components was done by creating custom jQuery behaviors and CSS3 animation for each component. This often included animated transitional effects to help reveal more pieces of content as users look more closely.

Collapsible content displayed on the “Summer of Love” site, one of the Digital Stories for the de Young MuseumCollapsible content displayed on the “Summer of Love” site, one of the Digital Stories for the de Young Museum

Applying the FAMSF brand to design components

Although the same colors and typefaces employed in FAMSF’s main website were used, it was agreed from the beginning that the Digital Stories and the main website were going to be “cousins” within the same family as opposed to “siblings,” so they could definitely have their own unique feel. This supported the goal of designing the microsites to be an immersive and very targeted experience. This was achieved by expanding upon the existing color palette and using additional fonts within the brand’s font family.

 playful / challenging / contemporary / exploratoryStyle tile created for the de Young: playful / challenging / contemporary / exploratoryThe de Young style tile creates a sense of excitement and delight through the use of whimsical icons and graphics. Easily recognizable iconography is incorporated in order to communicate effectively with a wide audience, with the added bonus of fun details such as saturated drop shadows and stripes. The de Young style tile creates a sense of excitement and delight through the use of whimsical icons and graphics. Easily recognizable iconography is incorporated in order to communicate effectively with a wide audience, with the added bonus of fun details such as saturated drop shadows and stripes.

In order to make sure the FAMSF team could reliably reproduce new, unique exhibit sites without having to change any code, we had to systematize the structure of the content and application of the interactions.

The Digital Story Content type for each exhibition had modular and reusable interactive features including the following:

  • An image comparison component for comparing two or three images side by side, where revealable text can give more context for each image 
  • An audio component for uploading audio files that included custom playback buttons and a revealable transcript
  • The ability to add a highly customizable caption or credit to any instance of an image or video
  • A zoomable image component where markers can be positioned on the initial image and that marker can be clicked, revealing a more detailed image and an area for more commentary on that detail
  • A revealable “read more” section that can contain further subsections
  • An image with an overlay, to be able to reveal a new image on top of the existing image. This was used to demonstrate aspects of the composition of a painting, showing a drawing on top of the painting.
  • A video component that could support uploaded videos or embedded streaming video
  • A horizontal slider that could contain images and captions with a variety of configuration
  • A stand-alone quotation with display type and an animated transition
The Results

The resulting platform we built allowed FAMSF to launch two exhibit sites in rather quick succession, which would have been incredibly difficult if they had to build each from scratch. In a matter of weeks, FAMSF launched two quite different interactive learning experiences:

Both exhibit sites have received praise, not only internally at FAMSF, but from online reviews of the exhibits, which mention the accompanying Digital Stories online learning tool.

Since the completion of the engagement with Palantir, FAMSF has already leveraged this tool to create an additional Digital Stories site (, and they have plans to create at least three more before the end of the year. Because of the simplicity of using the platform, they anticipate being able to spin up 4 - 5 different exhibit sites per year.

Current success for the Digital Stories sites is being measured by individual views and actual participation rate, and the initial results are on track with FAMSF’s initial goals:

  • The Monet site has over 30,000 views
  • The Summer of Love site has just under 30,000 views
  • Visitors are typically spending 4 - 5 minutes on each page

We’re pleased to have been part of a project that helps expand visitors’ understanding of important artists and their works. FAMSF was a great partner, allowing for a true collaboration focused on both pairing the nest technologies to fit the material and also providing the best learning mechanism for those engaging with the content.

We want to make your project a success.

Let's Chat. Drupal 8

Week 7: GSoC 17 Creating First Social Post Implementer

Posted by Himanshu Dixit | Blog - 20 Jul 2017 at 11:11 UTC
Week 7: GSoC 17 Creating First Social Post Implementer himanshu-dixit Thu, 07/20/2017 - 16:41

Integrate third-party media with URL embed on Drupal 8

Posted by Flocon de toile | Freelance Drupal - 20 Jul 2017 at 10:00 UTC
You want to allow your content editors to easily retrieve and integrate media, images, videos, sounds, presentations from third-party platforms? The Media entity suite has an extra string to its bow with the URL embed module. This module uses the PHP Embed library, and allows you to simply retrieve from a url a media from a third-party platform like Twitter, YouTube, Instagram, SoundCloud, Spotify, Vimeo, Slideshare, etc. To mention only the best known. This module allows you to integrate a remote media within a text field or from a dedicated link field type. Let us discover how this module works, very simply besides.

The entity initial commit week--#7

Posted by Boby Aloysius Johnson | GSoC Blog - 20 Jul 2017 at 08:14 UTC
The entity initial commit week--#7 boaloysius Thu, 07/20/2017 - 04:14


We are in the seventh week of GSoC 17 to integrate Google Cloud Machine Learning Engine to Drupal. Before proceeding, please have a look at our previous blogs and mainly the major planning week. This week started with the aspiration to create a basic version of the ml_engine module, but we could reach only till creating basic entities. The major problem we faced was the daunting bugs in creating the entities. I made a mistake by spending almost a week trying to solve the issue without updating the issue queue. Recently have added it to the issue page. Let me share a screencast of the progress.



Our initial reference in creating the entity was the examples module. It has a sub module content_entity_example that explains how to create a content entity to store Contacts. We made a similar one called Project by tweaking few functionalities. Here is the code. It gave a problem of having the same Tensorflow input fields for all projects. The fields we created using entity manage fields were getting reflected in all the project entities. It was a good place to start playing with entities. With the design to use different inputs for each project in mind, the Contact and Node modules that ships with the core was referred. It gave the insight to store the ML Engine Project and its Input as separate Drupal entities.

The Project is a config entity that handles the ML Engine settings data. It holds job, model and version names, training steps, deployment URL etc. The Argument is a content entity that handles the command line arguments to the Tensorflow code. The Argument entity fields for Tensorflow code can be varied but Projects fields are fixed.

With one week left for the second major evaluation, we have some major works to be completed to achieve the deliverables. The first one is to complete coding the entities. Second, convert the selected Drupal Views to CSV. Third, enable each project entity to run training, deployment, and prediction. Finally to create a plugin to format the prediction output. The second and the final tasks are the hard ones. I am expecting the coming week to be hectic. We will complete the coding and submit it for mentor review. 

AGILEDROP: How to improve the SEO on your Drupal site

Posted by Blog - 20 Jul 2017 at 05:32 UTC
Everybody wants to be high on web search engines results because when people look for information, they rarely get past the first page of Google, Yahoo, Bing ... So, if you don’t show up high in a search engine results, the potential customers will have hard times finding you. Or, most likely, they won’t find you at all. Luckily, there are some ways to boost your rankings in search engine results. With Modules There are many Drupal modules, which will help you enhance the search engine optimization (SEO). In fact, we have already made a list of the best Drupal SEO modules to optimize your… READ MORE

Acquia Dev Scan: Taming Expanding Databases in Drupal 8, Reservoir on DrupalEasy, and a Conference for Decoupled Drupal Developers

Posted by Acquia Developer Center Blog - 19 Jul 2017 at 19:57 UTC

When Acquia-related developer content starts piling up around the Web, it's time for an Acquia Dev Scan.

In this edition: Taming Expanding Databases in Drupal 8, Reservoir on DrupalEasy, and a Conference for Decoupled Drupal Developers

Dealing with expanding cache_render tables in Drupal 8

There are a number of scenarios in Drupal 8 where you might notice your MySQL database size starts growing incredibly fast, even if you're not adding any content.

Tags: acquia drupal planet

GSoC17 : Client Side File Crypto : Week 7

Posted by Tameesh Biswas | Blog - 19 Jul 2017 at 14:12 UTC
GSoC17 : Client Side File Crypto : Week 7

This blog post summarises the seventh week of writing code for Drupal for the Google Summer of Code.

tameeshb Wed, 07/19/2017 - 19:42 Tags GSoC Google Summer of Code 2017 Drupal Drupal Blog

Top 5 Lessons I’ve Learned Working with Drupal 8

Posted by Acquia Developer Center Blog - 19 Jul 2017 at 13:49 UTC
an explorer

Now that Drupal 8 is “production ready,” and agencies are ready to expand their capabilities by building in Drupal 8, clients are asking about it, and the community’s focus has shifted to developing for it.

Drupal 8’s predecessor, Drupal 7, has been around since January 2011, which means that by late 2016 everyone working in Drupal was very familiar with the ins-and-outs of how Drupal 7 worked.

Tags: acquia drupal planet

Interactive HTML5 content on Drupal site

Posted by InternetDevels - 19 Jul 2017 at 11:37 UTC
Interactive HTML5 content on Drupal site

Since content is king, content marketing is a must-have strategy. With the content you present on the web, you can attract visitors and keep them interested. But have you ever wanted to interact and collaborate with your users through the content? Do you need them not just passively perceive your content, but take some actions with it? This is possible with H5P (HTML 5 Package).

Read more

How to Determine Whether You Can Upgrade From Drupal 6 to Drupal 8 (Yet)

Posted by - 18 Jul 2017 at 23:06 UTC
Drupal 6 to 8 Upgrades!

Like many of you, I have a few sites that are fairly complex, utilize dozens of modules - and still run on Drupal 6. At this point, I don't want to invest the time to migrate them to Drupal 7 because I feel the momentum is finally beginning to shift into high gear for Drupal 8.

So, how do you know whether the Drupal 8 ecosystem is ready for a relatively straightforward migration? Thankfully, there are some great resources available!


Subscribe with RSS Subscribe to aggregator - Planet Drupal