Planet Drupal

Subscribe to Planet Drupal feed - aggregated feeds in category Planet Drupal
Updated: 3 min 41 sec ago

Drupal Watchdog: Got Game?

Fri, 07/08/2015 - 18:16

This is not an article about gamification. Unless your website is devoted to dragons, adding quests and hit points won’t improve your users’ engagement with your content. (If your website is devoted to dragons, well that’s just awesome.)

Content – be it text, images, video, data, or a combination of mediums – is the reason we build websites in the first place. It’s right there in the acronym: CMS. Drupal is a system – or more accurately, a framework – for managing content. We strongly believe that all website features, layout, and design choices must support the goal of serving your target audiences with the critical information – the content – they need to engage meaningfully with your organization.

Your content is the connection between your organizational goals and your audiences’ motivations. There’s usually a reason a piece of content is added to a website; somebody, at some point, thought it would be useful. Unless that content has meaning to your users, however, it has little value to your organization. Without a strategy guiding the creation and governance of that content, your quest, noble though it may be, is almost doomed to fail.

Fortunately, it’s not hard to start creating a strategy. We believe you can learn the foundations of content strategy for Drupal websites by breaking down what the team at BioWare did in creating Dragon Age: Inquisition.

Goals and Audiences

You have to start with goals.

BioWare’s basic goal is easy to suss out: they want to make money. To support such a massive undertaking – creating Inquisition involved programmers, writers, producers, graphic artists, vocal talent, project management, and more – the end result had to be a game that would appeal to enough people not only to pay for expenses, but to turn a profit. (We have a strong suspicion the team also wanted to turn around the negative reception Dragon Age 2 met by releasing something that would blow more than a few minds.)

Categories: Elsewhere

Drupal core announcements: Recording from Aug 7th 2015 Drupal 8 critical issues discussion

Fri, 07/08/2015 - 14:00

We met again today to discuss critical issues blocking Drupal 8's release (candidate). (See all prior recordings). Here is the recording of the meeting video and chat from today in the hope that it helps more than just those who were on the meeting:

If you also have significant time to work on critical issues in Drupal 8 and we did not include you, let me know as soon as possible.

The meeting log is as follows (all times are GMT real time at the meeting):

10:10 WimLeers
10:10 Druplicon => Auto-placeholdering for #lazy_builder without bubbling [#2543332] => 40 comments, 8 IRC mentions

10:11 WimLeers
10:11 Druplicon => XSS in Quick Edit: entity title is not safely encoded [#2503963] => 27 comments, 2 IRC mentions

10:12 plach
10:12 Druplicon => SqlContentEntityStorageSchema does not detect column-level schema changes in non-base-fields [#2544954] => 16 comments, 1 IRC mention

10:12 plach
10:12 Druplicon => Automatic entity updates are not safe to run on update.php by default [#2542748] => 60 comments, 14 IRC mentions

10:14 dawehner
10:14 Druplicon => Decide whether we need hook_upgrade_N()/upgrade.php front controller [#2540416] => 43 comments, 11 IRC mentions

10:17 webchick

10:17 webchick
10:17 Druplicon => [meta] The Drupal 8.0.0-rc1 Release Checklist [#2485119] => 32 comments, 11 IRC mentions

10:17 webchick
10:17 Druplicon => Install a module user interface does not install modules (or themes) [#2042447] => 178 comments, 25 IRC mentions

10:18 webchick
10:18 Druplicon => [meta] (websites/infra) blockers to a Drupal 8 release [#2267715] => 53 comments, 17 IRC mentions

10:19 alexpott
10:19 Druplicon => [meta] Remove or document every SafeMarkup::set() call [#2280965] => 109 comments, 24 IRC mentions

10:19 alexpott

10:21 dawehner
10:21 Druplicon => XSS in Quick Edit: entity title is not safely encoded [#2503963] => 27 comments, 3 IRC mentions

10:23 WimLeers dawehner: catch: alexpott:
10:23 Druplicon => [regression] Empty messages container appearing when a Notice occurs [#2547127] => 19 comments, 4 IRC mentions

10:37 alexpott
10:37 Druplicon => Review all usages of Xss::filter(), Xss::filterAdmin(), SafeMarkup::checkPlain() and SafeMarkup::escape() [#2527360] => 0 comments, 2 IRC mentions

10:38 alexpott
10:38 Druplicon => Remove SafeMarkup::checkPlain() from UrlHelper [
#2546232] => 3 comments, 1 IRC mention

10:40 dawehner
10:40 Druplicon => Decide whether we need hook_upgrade_N()/upgrade.php front controller [#2540416] => 43 comments, 12 IRC mentions

10:55 webchick
10:55 Druplicon => Automatic entity updates are not safe to run on update.php by default [#2542748] => 60 comments, 15 IRC mentions

10:58 alexpott
10:58 dawehner
10:58 Druplicon => Do not rely on loading php from shared file system [#2544932] => 6 comments, 2 IRC mentions
10:58 Druplicon => Rebuilding service container results in endless stampede [#2497243] => 208 comments, 48 IRC mentions

11:02 webchick Ok. Time to pass out. ;)

Thanks to @alexpott for the video and log.

Categories: Elsewhere

Tim Millwood: Composer in contrib: Step 1

Fri, 07/08/2015 - 13:38
Drupal 8 has seen a lot of love for Composer. As various posts have mentioned, it’s possible to...
Categories: Elsewhere

InternetDevels: Web developer tools for Drupal 7

Fri, 07/08/2015 - 10:18

To create a simple website on Drupal 7, an administrative interface and a simple text editor will be enough, but when it comes to more serious projects, you cannot do without additional Drupal web developer tools and powerful code editors.

Tools used in Drupal web development can be divided into two types:

Read more
Categories: Elsewhere

KnackForge: Drupal 8 Accelerate

Fri, 07/08/2015 - 07:48

Categories: Elsewhere

OSTraining: The Drupal Ecosystem is Consolidating Rapidly (Again)

Thu, 06/08/2015 - 19:57

Back in 2012, there was a wave of mergers and acquisitions amongst Drupal agencies.

The biggest merger involved four different companies forming Wunderkraut. However, there was also the Phase2 and Treehouse partnership, plus the merger of DrupalConnect and NorthStudio in Canada. And, although they were smaller deals, Acquia also picked up Cyrve, Growing Venture Solutions, Drupal Scout and Mollom around the same time.

In 2012, acquisitions became so common that they became a community joke.

Fast forward to 2015, and we're seeing a second round of mergers and acquisitions:

Categories: Elsewhere

DrupalCon News: Come for the Con, Stay for the Sprints

Thu, 06/08/2015 - 19:14

Each DrupalCon is filled with inspiration, networking, and fun — and while cutting-edge sessions are plentiful, sprints are the heart of the conference. A sprint is a get-together for focused work on a project, and a fantastic opportunity to make contributions to Drupal.

Even if you are not giving a session or leading a BoF ("birds of a feather" event) at DrupalCon, there is plenty of opportunity to give back and make a difference when you attend the sprints. There will be extended sprints taking place between 19-27 September, but the main sprint day is Friday 25 September.

Categories: Elsewhere

Mpumelelo Msimanga: Conditional Formatting of Data In Drupal Views

Thu, 06/08/2015 - 15:00
Conditional Formatting of Data In Drupal Views

A few years ago then Google CEO Eric Schmidt was quoted as saying, “There was 5 exabytes of information created between the dawn of civilization through 2003, but that much information is now created every 2 days, and the pace is increasing”. The great volumes of data available for analysis have necessitated the development of tools and methodologies to help users derive information from the vast volumes of data.

Categories: Elsewhere

Paul Johnson: Lightning talks at your Drupal Meetup

Thu, 06/08/2015 - 11:16

Last night NWUG held an evening of Lightning Talks at Madlab in Manchester. These are small talks that last up to 10 minutes long or can be run in the Pecha Kucha format with 20 slides in 6 minutes (1 slide every 20 seconds).

For me lightning talks are brilliant. In one evening you get to hear a wide palette of topics, discover from a high level subjects you might like to explore afterwards. They gave the opportunity for first time speakers to presenting in front of a friendly audience. It showed what a diverse and healthy Drupal community we in Manchester. Attracting 25 people, it was also the best turnout we've had in a while.

There were so many stepping up to speak that we ran out of time. There will be more lightning talks at NWDUG in November, so perhaps if you were inspired or curious and would like to join us, come along next time and see what it's all about!

Categories: Elsewhere

Forum One: Community Contribution: Our First Official “Sprint Day”

Wed, 05/08/2015 - 22:06

One of the biggest challenges for companies in the Open Source space, is how to make sure they contribute back to the community. Contribution is a core value at Forum One, but that doesn’t mean that it’s been any easier for us! This year we are testing a new structure for our community contribution. Once a month, we schedule a “sprint day.” All of our technical architects have the time blocked off on their calendar, and everyone who can make it spends a full day working on contributed code.

For our first sprint day we decided to focus on the Pane module, a module that Forum One maintains. This module allows administrators to create custom panes of translatable text or entity references, the content and/or placement of which can be easily moved between environments with the Features module. We spent a few hours in a Hangout, crunching through the active issues and pushing them forward.

Lucas Hedding and Andy Hieb added the ability to set permissions per pane. This is great for when you want to have some content that is editable by site admins, and some you need to lock down. These can be found on the permissions page.

Stephen Lucero got his patches for self-reported bugs reviewed and committed by William Hurley. 2473933 is a little obscure and was pretty tricky to track down! It broke the ability to use a display mode in a “read more” link, and it’s now resolved. The views display mode wasn’t working right either, but is now fixed by 2472553.

Andrew Morton worked on a new, easy-to-understand documentation page, including a full tutorial. We realize site builders can’t always comprehend the dev speak that explains the nuances of this module. The tutorial seeks to help builders breeze through configuration and understand Pane’s benefits.

At the end of the day, we were proud to mark a new release, version 2.7. It’s recommended for use in production sites right away.

We had a great time working together, and it was cool to see how quickly we could make progress when we all hammered on something together. I think we’ll try another “contrib day” like this next month. There’s plenty more to work on if you’re interested in this module. If you have any ideas or features we should add, please let us know!

Visit and use the pane module today!

Categories: Elsewhere

Drupal Watchdog: VIDEO: DrupalCon Los Angeles Interview: MortenDK

Wed, 05/08/2015 - 19:35

MortenDK (geek Röyale), our favorite bleeping curmudgeon, explains, in graphic detail, the extraction of Drupal 8’s front end from its back end.
And read his Angry Themer articles in Drupal Watchdog (Yo. Subscribe:

Tags:  Video Drupal DrupalCon LA Video: 
Categories: Elsewhere

Lullabot: Write Unit Tests for Your Drupal 7 Code (part 1)

Wed, 05/08/2015 - 18:00

Large software projects lead to many features being developed over time. Building new features on top of an existing system always risks regressions and bugs. One of the best ways to ensure that you catch those before your code hits production is by adding unit tests.

In this article series I will guide you through adding PHPUnit tests to your Drupal 7 modules. This article explores what unit tests are and why they are useful. And then looks at how to structure your Drupal 7 code in a way that is conducive to writing unit tests later on.


I encourage you to start testing your code. Here are the most important points of the article:

  • Start writing object-oriented code for Drupal 7 today. In your hooks you can just create the appropriate object and call the method for that hook.
  • Fake your methods to remove unmet dependencies.
  • Leverage PHPUnit to ease writing tests.
Unit tests to the rescue

In Drupal 7 core, Simpletest was added so everyone could write tests for their modules. While this has been a great step forward, executing those integration tests is very slow. This is a problem when you want to do Test Driven Development, or if you want to run those tests often as part of your workflow.

A part of Simpletest is a way to write unit tests instead of integration tests. You just need to create your test class by inheriting from DrupalUnitTestCase, but its drawback is that most of Drupal isn’t available. Most Drupal code needs a bootstrap, and it’s very difficult to test your code without a full (slow) Drupal installation being available. Since you don’t have a database available, you can’t call common functions like node_load() or variable_get(). In fact, you should think about your unit tests as standalone scripts that can execute chunks of code. You will see in the next section how PHPUnit can help you to create these testing scripts.

PHPUnit has you covered

In the greater PHP community, one of the leading unit test frameworks is PHPUnit, by Sebastian Bergmann and contributors. This framework is widely used in the community, attracting many integrations and extra features, compared to the aforementioned DrupalUnitTestCase.

Daniel Wehner comments on these integrations saying:

Since Drupal 8 started to use PHPUnit as it's unit test framework. One advantage of PHPUnit is that there are tools around which support it already.

Here is a screenshot of PhpStorm where you can see how you can execute your tests from the IDE:


PHPUnit is the PHP version of the xUnit testing framework family. Therefore, by learning it, you will be able to leverage that knowledge in other languages. Besides there’s a big documentation and support base for xUnit architectures.

The best part of PHPUnit is that it allows you to write easy-to-read test classes efficiently, and it has many best practices and helper tools –like the test harness XML utility–. PHPUnit also comes with some handy tools to mock your objects and other developer experience improvements to help you write your tests in a clearer and more efficient way.

To use PHPUnit with Drupal 7 you need to write object-oriented code. The next section will show you an example of the dependency problem, and one way to solve it using OOP with the fake object strategy.

A change in your mindset

The hardest part of unit testing your Drupal code is changing your mindset. Many developers are getting ready to use object oriented PHP for Drupal 8, but they keep writing procedural code in their current work. The fact that Drupal 7 core is not as object oriented as it might have been does not imply that custom code you write must also be procedural and untestable.

In order to start unit testing your code, you need to start coding using OOP principles. Only loosely coupled code can be easily tested. Usually this starts by having small classes with clearly defined responsibilities. This way, you can create more complex objects that interact with those small pieces. Done correctly, this allows you to write unit tests for the simple classes and have those simple classes mocked to test the complex ones.

Unit testing is all about testing small and isolated parts of the code. You shouldn’t need to interact with the rest of the codebase or any elements in your system such as the database. Instead, all the code dependencies should be resolved through the use of mock objects, fake classes, dummies, stubs or test doubles.

Mock objects avoid dependencies by getting called instead of the real domain objects. See the Guzzle’s documentation for an example.

Gerard Meszaros writes about test doubles in these terms:

Sometimes it is just plain hard to test the system under test (SUT) because it depends on other components that cannot be used in the test environment. This could be because they aren't available, they will not return the results needed for the test or because executing them would have undesirable side effects. In other cases, our test strategy requires us to have more control or visibility of the internal behavior of the SUT.

When we are writing a test in which we cannot (or chose not to) use a real depended-on component (DOC), we can replace it with a Test Double. The Test Double doesn't have to behave exactly like the real DOC; it merely has to provide the same API as the real one so that the SUT thinks it is the real one!

In typical Drupal 7 modules, which is our System Under Test (SUT), there are many parts of the code that we want to test that rely on external dependencies –our depended-on component (DOC). Good examples of those dependencies are Drupal core, other contributed modules, or remote web services. The fact that a method calls a Drupal function, such as cache_get(), makes it very difficult for the test runner to execute that code, since that function will not be defined during the test. Even if we manually included includes/, the cache_get() function might require other include files or even an active database connection.

Consider the following custom class:

class MyClass implements MyClassInterface { // ... public function myMethod() { $cache = cache_get('cache_key'); // Here starts the logic we want to test. // ... } // ... }

When we call myMethod() we will need to have the database ready, because it is calling to cache_get().

// Called from some hook. $object = new MyClass(); $object->myMethod();

Therefore, myMethod(), or any code that uses it, is not unit testable. To fix this, we wrap cache_get() in a class. The big advantage of this is that we now have a CacheController object that deals with all of our cache needs by interacting with the Drupal API.

class CacheController implements CacheControllerInterface { /** * Wraps calls to cache_get. * * @param string $cid * The cache ID of the data to retrieve. * @param string $bin * The cache bin to store the data in. * * @return mixed * The cache object or FALSE on failure. */ public function cacheGet($cid, $bin = 'cache') { return cache_get($cid, $bin); } }

And the custom class becomes:

class MyClass implements MyClassInterface { // ... public function __construct(CacheControllerInterface $cache_controller) { $this->cacheController = $cache_controller; } // ... public function myMethod() { $cache = $this->cacheController->cacheGet('cache_key'); // Here starts the logic we want to test. // ... } // ... }

The calling code stays the same.

Our test class will execute myMethod() with a fake cache controller that doesn’t need the bootstrap or the database.

// Called from the PHPUnit test case class. $cache_controller_fake = new CacheControllerFake(); $object = new MyClass($cache_controller_fake); $object->myMethod();

What our fake cache controller looks like:

class CacheControllerFake implements CacheControllerInterface { /** * Cache array that doesn't need the database. * * @var array */ protected $cache = array(); /** * Wraps calls to cache_get. * * @param string $cid * The cache ID of the data to retrieve. * @param string $bin * The cache bin to store the data in. * * @return mixed * The cache object or FALSE on failure. */ public function cacheGet($cid, $bin = 'cache') { return isset($this->cache[$bin][$cid]) ? $this->cache[$bin][$cid] : NULL; } }

The key is that the test will create a fake object for our CacheController and pass it to the SUT. Remember that you are not testing cache_get() but how the code that depends on it is working.

In this example, we have removed the dependency on includes/ and the existence of the database to test a method that calls to cache_get(). Using similar techniques you can test all your classes in your module.

The next article of the series will get deeper into the matter by covering:

  • Mocking tools like: PHPUnit mocking objects and the Mockery project.
  • Dependency injection in Drupal 7 to pass your dependencies easily.
  • Drupal Unit Autoload to reduce the number of classes to mock.
  • A real life example that applies all these concepts.

Do you add unit tests to your Drupal 7 modules? Share your experience in the comments!

Categories: Elsewhere

Drupal core announcements: Drupal 8 core updates for August 5th, 2015

Wed, 05/08/2015 - 16:45
What's new with Drupal 8?

Since the last Drupal 8 Core Update, 8.0.0-beta13 and 8.0.0-beta14 were released, work started on the Drupal 8 User guide, Code Drop and PreviousNext merged, and Holly Ross gave a summary of the latest Drupal Association board meeting.

Some other highlights of the month were:

How can I help get Drupal 8 finished?

See Help get Drupal 8 released! for updated information on the current state of the software and more information on how you can help.

We're also looking for more contributors to help compile these posts. Contact mparker17 if you'd like to help!

Drupal 8 In Real Life
  • Drupalaton 2015 - The Hungarian Drupal community meet will happen between 6-9 Aug 2015 at Lake Balaton in Hungary. The event will have great sessions, sprints, fun-filled beach sports and many more. Dont miss your chance to join the fun. Their schedule include sessions like:

    • Forms and Validation in Symfony2 by Márk Kiss
    • Build a Drupal 8 site with cutting-edge frontend technologies by Gergely Pap, Tamás Barna
    • Storing data with Drupal 8 by Károly Négyesi

    ... and many more

  • Drupal 8 Ready - Australian Seminar Series is going to be held on 6th Aug 2015 across all major cities in Australia. The seminars will provide a high level overview of the changes coming in Drupal 8, specific considerations for different types of users, and approaches for adopting the new CMS. The talk will be relevant to developers, content editors and decision makers alike, and we’ll finish the session with an in-depth Q&A. Feel free to check the venue details of your city and join here.
  • The Seacoast Drupal User Group meetup is on 6th Aug 2015 from 18:00 to 20:00 at Portsmouth, NH.
  • The Berlin Drupal User group meetup is going to be held on 6th Aug 2015 from 19:30 at betahaus. The topic is "Scaffolding with DrupalConsole".
  • The DrupalCamp Wisconsin Hackathon will be on 7th Aug 2015 from 12:00 to 17:00 at NuCivic office in Madison, WI
  • Drupal Rush in Sprints will be held on 8th Aug 2015 from 10:30 to 16:00 at Srijan office in Delhi, India.
  • CADUG Advanced Drupal Meet Up will be held on 11th Aug 2015 from 19:00 to 21:00 at Lake Street Suite 301, Chicago, IL. The event consists of few lightning talks (including one on the Demo Framework for Drupal 8), advanced Drupal discussions and many more.
Whew! That's a wrap!

Do you follow Drupal Planet with devotion, or keep a close eye on the Drupal event calendar, or git pull origin 8.0.x every morning without fail before your coffee? We're looking for more contributors to help compile these posts. You could either take a few hours once every six weeks or so to put together a whole post, or help with one section more regularly. If you'd like to volunteer for helping to draft these posts, please follow the steps here!

Categories: Elsewhere

Chromatic: Does your site show user names and allow weak passwords? A simple attack scenario.

Wed, 05/08/2015 - 16:15

Out of the box, Drupal does a good job of providing securely written code. For instance, core modules sanitize user input and interactions with the database use Drupal's database API to prevent SQL injection attacks. However, Drupal doesn't enforce strong passwords by default which can lead to a scenario that is not too hard to imagine.

Let's say a new content editor named David has been hired. To quickly get him up and running he is given the username david and a password of david123. David logs in and gets to work and doesn't bother changing his password - after all, david123 is easy to remember! (This scenario may seem contrived, but I fear it is all too common.)

It's not unusual for Drupal themes to add an author's actual username into content. An attacker can just scan the text or source code and find something like this:

<span class="username" about="/user/88" typeof="sioc:UserAccount" property="foaf:name">david</span> So...
  1. A quick glance and the attacker knows there is a valid username david
  2. The attacker tries logging in with some common weak password patterns (ex. david1, David1, david123) *
  3. ...and Bingo! With david123 the attacker has logged in and the site has been compromised

If the compromised user has admin privileges or can use a WYSIWYG editor that allows PHP execution (which we never recommend), then it's possible the whole server is at risk. In a nutshell, security's not just about depending on securely written code; enforce strong passwords from the start. (While you're at it, make sure admin pages are served over SSL.)

Try the following:

  • Password Policy module (enforce strong passwords and hey, expire them too?!)
  • Use a preprocess hook or edit your template files to remove the display of user info (Hint: sometimes themes will also add the username as a class class="author-david")
  • Secure Pages module (force admin pages to be served over SSL)

There is plenty more you can do, but using SSL and having a strong password policy without advertising your usernames is a solid start. Even better would be to explore two-factor authentication, but we'll leave that for another blog post.

* Yes, Drupal will lock the user out after 5 unsuccessful login attempts, but that in itself means an attacker can easily lock users out of their accounts.

Categories: Elsewhere

Zivtech: 5 Signs that Your Website Needs an Update

Wed, 05/08/2015 - 16:00

Did you create your website 5 or 10 years ago? It’s time for a redesign. According to a recent Pew Research Center study, 64% of American adults now own a smartphone, up from 35% in 2011. Forward thinking marketers understand that web is far more customer centered than ever. Web traffic has changed, but has your website?


1. Your bounce rate is high

Bounce rates show how long someone stays on your site after viewing one page. If your bounce rate is over 50%, that means 50% of the traffic to your site leaves without navigating deeper into your content. There are a variety of reasons why your bounce rate may be high (including bot traffic), but one key factor is information architecture. If you site was not created with the user in mind and designed in a way that allows visitors to intuitively navigate from page to page, that is likely the number one reason your bounce rate is suffering.


2. Your site isn’t responsive

Can users access your site from any device? The digital consumer, according to a Nielsen study, spends more time surfing the web from a smartphone than from a desktop or laptop. Your site should be responsive to the size and shape of the screen on which it’s viewed. These days, web developers can code a single site to work on every platform. When a mobile visitor comes to your page and sees the tiny font of a nonresponsive site, they’re going to bounce. Peace out. Word to your competitor.


3. You’re pivoting

Plateaus happen. Deciding to change your business or organization can be tough, but once you’ve made the decision, it’s time to update your website. You want the world to see your company as something new, and a few small changes to your site are not enough. Revamp the look and feel of your site--give it a facelift and let your new venture shine through.


4. Your content is outdated

If you haven’t updated your site in the past few months, chances are your content is outdated. Keeping content up-to-date and relevant to your messaging can be challenging, especially if you have a small team, but updating your entire site can give you the opportunity to look at your content with fresh eyes and re-evaluate your content strategy. A content audit, often performed by your web development company of choice, will allow you to identify the content on your site that reaches clients, and the content that is floundering. Removing or restructuring old content is a great way to increase traffic to your site.


5. Your clients (or your team) have trouble using it

Design. It’s your top priority. Think of a website like a house for sale. Is there curb appeal? Once you’re inside, is there an obvious path through the house? Same with your website. Users should be able to intuitively navigate through, find what they are looking for, and settle into a nice comfortable chair. Build your new site only after careful research. Observe how people use your current site, and see through your visitors’ eyes. Ask questions. Let people complain about what’s missing or difficult. Build a beta of your new site and repeat the process until you’ve worked out the kinks.


Thinking about updating your website? Feel free to reach out and let us know how we can help bring your site up to date with your goals.

Terms: site updatesite upgradeDesignDevelopmentDrupal Planet
Categories: Elsewhere

Sooper Drupal Themes: Module Spotlight #1: Smart Trim

Wed, 05/08/2015 - 08:29
Node teasers simply work right? Wrong...

Node teasers are broken and most developers don't even know it, meaning it can be a pain for content creators. If you're building large websites that constantly pump out content, then read on to learn how we fix Drupal's teasers with one simple module...

Categories: Elsewhere

Modules Unraveled: 143 The Role of Features in Drupal 8 with Mike Potter - Modules Unraveled Podcast

Wed, 05/08/2015 - 07:00
Published: Wed, 08/05/15Download this episodeFeatures
  • Let’s start off with the basics, if you don’t mind. Can you give us the 30 second pitch for what Features is? I’m sure there are people listening right now that don’t use Features regularly.
  • What kind of data or configuration can you package into a feature?
  • What does Features do well?
  • Where does Features fall short?
  • What are some of the things people currently use Features for, that perhaps it wasn’t intended? Are there issues as a result?
Configuration Management in Drupal 8
  • If you don’t mind, I think it’d also be helpful if you could explain what CMI is in Drupal 8 so that when we compare the two, everyone knows what we’re talking about.
  • What does CMI do well?
  • Where does CMI fall short?
When to Use Features in Drupal 8
  • With CMI in core, where does Features find its place in Drupal 8?
  • How will we use Features differently in D8 as compared to D7?
  • Talk about config packager
Developing in Drupal 8

What was your experience building Features in Drupal 8? Did you get to port code from D7, or was it all from scratch? Is Drupal 8 as “hard” as some people are claiming?

Questions from Twitter
  • Thomas Svenson
    Just want to say I like the direction #Features is taking for Drupal 8. Especially that it is not needed on live site. #UXwin
Episode Links: Mike on drupal.orgMike on TwitterFeatures Module on drupal.orgMike’s Blog on Phase2 websiteTags: Drupal 8FeaturesCMIplanet-drupal
Categories: Elsewhere

Realityloop: What gives Drupal the Edge?

Wed, 05/08/2015 - 06:37
5 Aug Jarkko Oksanen Drupal is a widely used and secure

Drupal is a very popular Open Source CMS solution. According to BuiltWith, 14.2% of top 10k Websites that use a CMS use Drupal. The total number of Drupal websites is more than a million. Popular and well known sites such as, and are using Drupal.

Drupal is popular among many different website verticals.
Drupal is not just a CMS

The functionality of Drupal exceeds what is defined as a CMS. When describing Drupal as a CMS within the Drupal community, I often get corrected that it is in fact a CMF (Content Management Framework). It means that Drupal can be used for other purposes such as simply working as the backend system for entering content, and then displaying the content in a completely different way. This could be for example a mobile application that gets its content from your Drupal website.

Drupal is fast to develop

Building the basic functionalities of complex sites often requires no custom code. This makes Drupal fast to develop. Handling content with different fields which can contain whatever data you as content creators want and being able to change these in a very quick way is Drupal's one of main strengths. Building your own “content type” takes minutes and not a single line of code.

The Custom code comes in play when you need something very specific and is often only used to add to alter or add to already existing code. This makes Drupal into a great tool for creating a Proof of Concept quickly. If you have a complex website that you need built, it is very likely that Drupal is the fastest way to provide the basic functionalities. In a short time you could already be demonstrating the main functionalities to your shareholders or peers.

Drupal has a large number of contributed modules

Drupal Modules are free to use and generally of high quality. Drupal's functionality can be extended in using contributed modules. A great Drupal website is always a combination of the best modules for the specific purpose of the website. Joomla and Wordpress have paid module ecosystems and many of the good modules you have to pay for, with Drupal they are all freely available on However not just everyone can release anything to which is where all the contributed modules live. To release a module, developers have to go through a process where your code is evaluated by long-term Drupal developers this goes a long way to keep the standards high.

There is a large number of modules that we as Drupal developers and enthusiasts find very standard, but are missing or hard to configure in other CMS’s.

The main contributed modules that give Drupal an edge

    Views gives you the ability to create nearly every kind of display for your content. You can display only the parts of your content that you want, and modify it to your liking. A view on your website could be for example “Related content” or “List of latest blog posts” but it could also be something more complex like a Masonry layout for your front page.

    Views allows your content can be then displayed in any way you want, from shiny slideshows to traditional HTML tables. With Views you can also build complex search systems without a line of code if that is what your project needs. There is a large number of sub-modules to the Views module that allow you to extend the functionality further.

    In the upcoming version Drupal (Drupal 8) this contributed module will have moved to be a part of the core Drupal installation.

    Example: In this image there is a view on the left displaying the Articles, and another on the right showing the listing.


  2. Features

    Features is a module that is more for the developers. It allows you to store your configuration for Drupal in the code base. This allows you to export configuration from different Drupal setups. It’s a part of every well thought after Drupal build.

  3. Commerce

    If your goal is an e-commerce site, commerce is your go-to module for Drupal. When it comes to ecommerce sites, Drupal is a great tool. Especially when your plan is to build a site where you will drive users with content to your site.

    You could have your content in Drupal and use the previously shown Views module to relate interesting products to your users. For example you have an article about “Tuning a guitar” with a tag “tuning” and a view on the page that shows products with the same tag. Drupal commerce provides everything you would need in a ecommerce solution, from cart to multiple payment gateway integrations, and all this for free.

    Or to think of it as the other way around, you can easily use Drupal to create a Paywall site that allows users to access your content only after they have purchased a membership.

    To test what Commerce can do for you, check out the demo site:

  4. Rules

    Rules is a module that allows you to initiate any action when something happens on your website. Let's say a user submits a form, and you want to send an email to that user. With Rules you could implement this. But rules doesn't stop there. You could even add numerous actions to that same submit action, for example you could on top of sending the email give the user a message on the page that “Form submitted” and redirect the user to a page you want them to go after submitting a form. All of this without writing any custom code, and done in the user interface.

    This module works well in conjunction with other modules, such as the pre-mentioned Commerce module. With the rules module you could create simple actions that affect product pricing for different user roles, or for example to create sales pricing. The possibilities are endless.

    Simple example:
    User clicks on a link -> Rules reacts by doing an action (send an email)

  5. Display suite

    Display suite allows you to create specific display modes for your content. Think about how you would want a teaser of an article to look like. You could specify it to look exactly like you want it to and then re-use the display mode in every parts of your site. And by just updating the display mode, all of your teasers will get the new layout. Compare this to having to go through all your layouts every time you're doing a change. A time saver for both developers and themers when working on complex websites.
Examples of simple modules for specific purposes

To give an idea of the extent where Drupal has gone with its contributed modules I will list 5 modules that are very good for their own specific purpose. It is very likely that one or more of these will be used in a Drupal site you're browsing.

  1. Honeypot

    Everyone hates spam. Honeypot kills the spam. It’s that simple. If you’re running a website with user-generated content, you’re going to have to handle this issue. This module does it for you without the annoyance of Captcha.

  2. CKEditor

    Drupal doesn't come out of the box with a Wysiwyg. This module solves that problem. It’s a plug-and-play module and by just enabling it you will have a fully functional Wysiwyg on your hands.
  3. Google Analytics

    Adding your Google analytics code to your website couldn't be more simple than it is with this high quality module. Just add your UA code and that's it. It also allows for complex customizations if that’s what you need.
  4. Getlocations

    Does your website need a map to show locations on? If so getlocations is one of the great solutions Drupal provides to solve all of your location based needs. It supports custom Google maps markers and different map providers.
  5. Pathauto

    A very important part of any website is the URL. A good URL structure helps your site to rank better on google, and also to be easily navigatable. That is what the Pathauto module is for. It creates clean, keyword rich URL’s.

    All CMS’s have implemented different solutions for this problem, but I believe Drupal's way to be easily the most configurable and complex the same time. With the pathauto module you can simply type in a default “path” for your content which could be for example: content/What gives Drupal the Edge? which will print out as This can be modified to your hearts content in the user interface without any code needed.
  6. Metatags

    Social media is more important than ever. Everyone wants their content to have a chance of becoming viral, your metatags have to be in order. Metatags and configuring them has been an issue as the defaults are constantly improving and changing. Drupal has a great solution for this, which is the metatags module. The metatags module works in a similar way to the before mentioned pathauto module. You can set simple defaults, or go into really complex setups if you desire to do so. The module supports all of the major social networks such as Facebook and LinkedIn (OG tags) and Twitter (Twitter cards). The configuration is very easy and can be done by virtually anyone who has a basic grasp of how they should work.

The Drupal community is large. There is over 1 million users on with almost a 100,000 of those actively contributing. In general the users in the community are highly skilled. A huge percent of the developers working with Drupal are actually doing it as their primary occupation. This makes the community very professional and helps to keep the high standards of contributed modules and projects.

It is fun being a part of the Drupal community. Around the world there are numerous events that are hosted in different countries that attract thousands of Drupal enthusiasts to collaborate, network and code together to make it even better. Being a part of these communities is great for everyone involved.


When you work with Drupal, you don't need to find security issues from your code yourself. There is a strong security focus within Drupal, and there is a team that continuously reviews contributed code. This keeps the costs of upkeep on a Drupal site low compared to custom platforms. I’ve ran into dozens if not hundreds of issues that I’ve figured out by going through community created patches which I’ve then applied to my Drupal sites. Also the modules you use constantly receive updates with new functionality you can decide to use if you deem it to be important for you.


The very high quality and a large of contributed modules, the free support you get from the community, great tools to structure and display content and fast build times on complex sites websites;

All of this is what makes Drupal the ultimate open-source solution for mid/large websites.

drupaldrupal planet
Categories: Elsewhere

INsReady: Testing a new Drupal 8 installation with 2 Docker commands

Wed, 05/08/2015 - 05:31

While I was mentoring GSoC 2015 Hawk Auth project, we wanted to test the project in D8 sandbox often. doesn't help here, because Hawk Auth uses Composer Manager to download extenal PHP library. (Another project using this set up is Commerce for D8.) There is an issue of supporting Composer in queue, but it hasn't been followed up.

Therefore, we tried to use Docker to spin up a new Drupal installation. It was very fast and simple. Below is the documentation:

Step 0: Install Docker

Step 1: Spin up a database

docker run --name drupaldb -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=drupal -d mariadb

(here we created a docker container called "drupaldb" using "mariadb" image, then we created a database "drupal" and set root password to be "password")

Step 2: Spin up Drupal 8

docker run --name d8docker --link drupaldb:mysql -p 80:80 -d drupal:8.0.0-beta13

(here we created a docker container called "d8docker" using "drupal:8.0.0-beta13" image, then used port 80 on localhost for access and linked to the database container we just created)

Done. Now, you can open localhost or on your browser to install Drupal the database. If your localhost port 80 is being used, then you can change this section "80:80" in the above command to something like "1234:80", which will use port 1234 on your localhost.

Step 2.1: if you need to access the terminal of this website

docker exec -ti d8docker bash
(once you in, execute "export TERM=xterm" in your terminal for using text editor)
(if you need to install other tools, execute echo "Find-a-Close-Debian-Repo-URL-FOR-YOURSELF" > /etc/apt/source.list)

Step 2.2: if you want to read the log

docker logs -f d8docker

Step 3: Cleaning up

docker stop d8docker
docker stop drupaldb
docker rm -v d8docker
docker rm -v drupaldb

Tag: Drupal Planet
Categories: Elsewhere