May 27 2015
May 27

DrupalCon is a wonderful experience (even if it's in downtown LA!). We come together as a community to learn and share and have a fun time. The Hook 42 team grew a bit from last year and was fortunate to have 8 team members in LA. We had a great time and wanted to share some of our highlights with you.

Downtown LA from rooftop. Photo credit: Kristen Pol.

Session/BoF/Sprints

As usual, there were tons of great keynotes, sessions, BoFs, and sprints. The keynotes and sessions were recorded so check those out.

Having fun at the Dries Q&A. Photo credit: Paul Johnson.

Aimee's Favorite Session/BoF

So many… but basically all things Drupal 8. :) Schnitzel’s application of Drupal 8 in production, Matt Cheney’s review of the D8 CMI in a managed workflow was informative and thought provoking, and of course MortenDK’s Drupal 8 Theming with <3. I did love the Princess Cruises case study since it is a wonderfully complex but elegantly deployed combination of multilingual workflow, services, and content syncing. Their team did an amazing job!

Kristen's Favorite Session/BoF

The "hallway track" was strong at this 'con for me. I only went to two BoFs (one was Aimee's D8 multilingual workshop and the other one was multilingual therapy) and one session (my own multilingual D7 talk). So… I guess my favorite organized non-party thing was helping at the sprints on Friday! :)

Tom's Favorite Session/BoF

  1. Estimation - A science not an art
  2. Building Your (Drupal-based) Business: Or... What Keeps You Up At Night?

K2's Favorite Session/BoF

My favorite session was MortenDK’s Drupal 8 Theming with <3. He’s fun to watch and got me really jazzed to use twig in Drupal 8.

Darryl's Favorite Session/BoF

I really enjoyed Jeff Eaton’s Battle for the Body Field, but I cheated by watching it after I got home. I learned about Entity Embed module, for which I think I’m going to find a lot of use!

Lindsay's Favorite Session/BoF

The winner is … CI for CSS: Creating a Visual Regression Testing Workflow. Wow, that’s a mouthful of a title, but quite an informative session. Lots of great things to know that were presented clearly. Thanks for the great session by Kate Kligman.

Patrick's Favorite Session/BoF

I greatly enjoyed the “I Survived Drupalgeddon” session by Matt Korostoff. It was a fun personal story of how hackers invaded his site, what happened after they did, and how one can prevent it from happening to their site.

Genevieve's Favorite Session/BoF

My two unrelated favorites were - 1) Designing for Brains: The Psychology of User Experience & 2) How to Run a Drupal Agency.

Tshirt/Swag

There were some really fun tshirts and swag in LA. We brought two new designs of our own (California Drupalin' and It Takes a Village), thanks to the very talented artist, Joe To, along with some previous favorites including Drup Oil, Features Reaper (happy version), and Multilingual Drupal to fill out our growing number of awesome doodles. Going to camp or con and want some swag? Ping us to see if we'll be there. ;)

DrupalCon LA monkey hats from Mailchimp were a big hit. Photo credit: Paul Johnson.

Aimee's Favorite Tshirt/Swag

Four Kittens v2! Backdrop DRAGON! Pantheon’s I BUILD THE INTERNET, LA edition! Hangover helper survival kits!

Kristen's Favorite Tshirt/Swag

Monkey hat is super cute and the Backdrop dragon but I think my kids liked the backscratcher the best… makes for a good extra hand.

Mom… I can scratch your back! Photo credit: Kristen Pol.

Tom's Favorite Tshirt/Swag

I BUILD THE INTERNET!

K2's Favorite Tshirt/Swag

My favorite T-Shirt was the monkey hats from Mailchimp, wa hoo! I just wish I had gotten a picture of Lindsay in it!

Darryl's Favorite Tshirt/Swag

What am I supposed to do with a hockey stick? I did get another Jet Brains PHPStorm yo-yo, which I do play with.

Lindsay's Favorite Tshirt/Swag

Definitely the Backdrop sticker. I mean, seriously, look at this dragon. So cool.

Backdrop's Dragon Drop is pretty darn cute. Image credit: Backdrop Press Kit.

Patrick's Favorite Tshirt/Swag

My favorite shirt was the Golden State Warriors Tshirt that had Pantheon’s logo on the back. Apparently they bought the Golden State Warriors Tshirt right down the street of their SF office and just added their logo to the back!

Food

Not sure if great food is what comes to mind when going to LA like it did for Portland or Austin but we still managed to get in some good eats.

Pantheon partner dinner at the Palm. Image credit: Kristen Pol.

Aimee's Favorite Food

The Original Pantry for the early-risers breakfast with Darryl and the 2 am post-party breakfast for the night owls. Yay for 24 hour comfort food!

Kristen's Favorite Food

Who needs words? This was my dessert at Local Table.

Local Table has pastry chef who makes masterpieces. Image credit: Kristen Pol.

Tom's Favorite Food

Grand Central Market

K2's Favorite Food

My favorite meal was the Hook 42 dinner at what I will refer to as “the home cooked hipster joint in Hollywood.” So much fun to just be us all together - it felt like family.

Darryl's Favorite Food

I had breakfast 3 times at The Original Pantry. It was right on the way, and I was always there a bit ahead of the crowd, so I never had to wait. I think that’s one more time than I ever ate there in the 33 years I lived in LA (well, in The Valley, so, not very convenient).

Lindsay's Favorite Food

That filet mignon at the Pantheon dinner. Like butta.

Patrick's Favorite Food

My favorite food was the Guinness vanilla ice cream float I received at the Hook 42 dinner because it was an efficient way to drink and eat at the same time.

Genevieve's Favorite Food

What K2 said. So tasty.

Person

DrupalCon is all about the people! We love seeing our old friends and meeting new ones. We <3 the community. :)

DrupalCon LA mentors. Photo credit: amber_is_i.

Aimee's Favorite Person

ALL THE PEOPLE! It is wonderful to see the extended family of community members. Schnitzel, Ryan Weal, YesCT, and more! Patrick Storey and Lindsay Gaudinier were two shining examples of a successful second DrupalCon. Patrick was heavily engaged with mentoring and volunteering and Lindsay dove in deeply to the front end technical sessions. Austin + community + practice + LA is a great springboard for success.

Patrick mentoring the new recruits. Last DrupalCon he was a recruit! Photo credit: Kristen Pol.

Kristen's Favorite Person

Tough one! Was nice to finally meet Damien McKenna in person and see his rabbit ears.

Gotta love them ears! Photo credit: Kristen Pol.

Tom's Favorite Person

Were there people there?!?

K2's Favorite Person

I didn’t have a standout favorite, but I can note that I feel like this time I really knew a lot more people and felt like part of the Drupal community. Wave to all!

Darryl's Favorite Person

I had a great time playing “Germanic Ping Pong” with the Amazee Labs folks at their party! (Yes, I know they’re Swiss, but I learned this game in Germany…)

Amazee Labs ping pong party including Germanic ping pong. Video credit: Kristen Pol.

Lindsay's Favorite Person

Ryan Weal. Him, K2 and I hung out in the coders lounge and it was tons of fun.

Patrick's Favorite Person

I’ll say Amy Vaillancourt-Sals. First off, great name! She came to the Mentor Core Sprint where I was mentoring and I showed her how to re-roll a patch. Then a couple hours later I saw her pushing the “return” button on Dries’ computer for the Live Commit! And I was able to think to myself “I knew her before she was famous”.

Genevieve's Favorite Person

It was my first DrupalCon - so everyone was new and interesting!

Social Event

The social event calendar was extra packed for LA. We couldn't get to everything but did what we could. Too many fun things, too little time! ;)

Pantheon Party. Photo credit: Kristen Pol.

Aimee's Favorite Social Event

The Pantheon party. Hands down. Thank you, Pantheon!

Kristen's Favorite Social Event

Ok, this one was tough. You know bubble wrap? Addicting, right? Well… try one of these ping pong ball collectors when you have a room of crazy Drupalers hitting (or dumping!) balls to the floor at an amazing rate. OCD heaven! On a more relaxing note, I had a wonderful soak in a hot tub with K2 instead of going to trivia night (first one I've missed!)... that was a relaxing type of heaven (with lightning to boot).

Kristen Pol on duty at the Amazee Labs ping pong party. Photo credit: Amazee Labs.

Tom's Favorite Social Event

Meh

K2's Favorite Social Event

Without a doubt the big outdoor party that Pantheon threw - amazing!

Darryl's Favorite Social Event

The Pantheon party and the Amazee Labs parties were both great!

Lindsay's Favorite Social Event

The outdoor Pantheon party. There was dancing and the nicest porta potties ever.

Patrick's Favorite Social Event

Definitely the L.A. Live Pantheon party. Shut down a street in one of the biggest cities in the world? Sure, why not!

Genevieve's Favorite Social Event

You can never forget Ping Pong!

K2, Patrick & Genevieve at the Amazee Labs ping pong party. Photo credit: Amazee Labs.

Weird/Strange LA Thing

No matter where you go, there's gotta be something weird. Here's some interesting things we came across in Los Angeles.

Not sure really what this is but it was in Kristen & Kristin's airbnb. Photo credit: Kristen Pol.

Aimee's Favorite Weird/Strange LA Thing

On Google Maps, the “Urban Core” was called Skid Row. Every time I searched for directions, the late ‘80s metal music played in my head.

Kristen's Favorite Weird/Strange LA Thing

Our Airbnb was pretty eclectic. There were steampunky things adorning the surfaces and artsy things on the walls and even super heroes hanging from the bathroom ceiling.

This punk was protecting us from a good vantage point in our Airbnb. Photo credit: Kristen Pol.

Tom's Favorite Weird/Strange LA Thing

How could the LA downtown “Urban Core” have fewer cars than San Francisco? It’s LA. Car town.

K2's Favorite Weird/Strange LA Thing

Fruit on the street with chili and salt on it. Yum! Also the crazy amount of shutdown theaters in the area we stayed. Who knew LA had such beautiful architecture downtown.

Darryl's Favorite Weird/Strange LA Thing

The coded magnetic door lock keys to our AirBnB apartment were kind of weird. Insert the key into the lock, wait until the lock mechanism activates, then turn. And you had to turn it to the right to unlock the door.

Lindsay's Favorite Weird/Strange LA Thing

All of the dogs out for walks in the morning! I wanted to pet every single one! [Cue Oprah] You get a dog, and you get a dog, everyone gets a dog!

Patrick's Favorite Weird/Strange LA Thing

Apparently between 9-11pm it’s dog walk o’clock. You will not see any dogs all day, and all of a sudden everyone is walking dogs everywhere downtown.

That’s a wrap!

Thanks to the Drupal Association and all the volunteers for making DC LA a huge success. Please leave a comment with some of your favorite things! And… see you in L.A. again… this time as in Lousiana. :)

Epilogue

In case you didn't see enough photos…

Mentor dinner at Local Table. Photo credit: Kristen Pol.

Darryl hanging out with Schnitzel. Photo credit: Amazee Labs.

Aten+Kalamuna+Four Kitchens bowling party. Photo credit: Kristen Pol.

Pantheon pinball party. Photo credit: Kristen Pol.

Still smarting from pantheon party last night @getpantheon #DrupalConLA #hook42 @hook42inc pic.twitter.com/oUGT3zI61Z

— K2 (@K2Hook42) May 14, 2015
May 27 2015
May 27
136 Details on the NodeSquirrel Acquisition by Pantheon with Drew Gorton and Ronan Downling - Modules Unraveled Podcast | Modules Unraveled

Skip to main content

NodeSquirrel

  • What is NodeSquirrel?
    • Backup and Migrate (over 300,000 sites using it)
    • Only cloud backup-as-a-service for Drupal
    • Backup database and Files
    • Every site should have automatic off-site backups configured.
  • That leads great into the pantheon acquisition, because now everyone can create free off-site backups with NodeSquirrel.

Pantheon Acquisition

  • How did the aqcuisition come about?
    • Drew - BadCamp October 2014. Sitting at a Pantheon party, ended up talking to Zack about running a services firm and product at the same time. The excitement, issues etc. involved with that. And it happened.
  • Did you pitch it to him? Did he pitch it to you?
  • So, what’s in it for them? Why did Pantheon buy NodeSquirrel?
    • They want to build great tools that developers can love and trust and use.
  • What’s new now that it’s been acquired by Pantheon?
    • It’s FREE! (There’s a new free tier)
    • It’s not a trial. It’s always free.
    • It’s not just for Pantheon customers.
    • We have access to Pantheon’s resources to further the development and continue improving support.
    • It’s been a side project from the start, but now that it’s backed by a real product company, we’re officially here for the long-haul. So, if you’ve been holding off because you didn’t want to risk storing your backups with something that might not be there in a year, you can rest assured that we’ll be here.
    • (Ronan) Now I’m able to dedicate more time and effort to the Backup and Migrate module (instead of only using my free time), which helps the community as a whole.
  • What happens to current users?
    • Higher storage limits
    • Might even be able to downgrade and pay less.
    • Won’t lose any features. Still use local backup, etc. (except maybe email)
  • What’s in the future?
    • Drupal 8
    • Wordpress
    • More features for both Backup and Migrate and NodeSquirrel
    • Bringing Pantheon features to NodeSquirrel and NodeSquirrel features to Pantheon (Notes)
May 27 2015
May 27

Why is this important

How to size the PHP setting max_memory is actually really important for the health of your Drupal application. Size this too small, and you risk getting PHP fatals due to not enough memory allocated. Size this too large, and you are essentially under-utilising your hardware, which in turn can lead to more cost.

How to record every Drupal requests PHP max memory usage

Tim Hillard created this really nice module called Memory profiler, which probably wins some sort of award for being around one of the smallest modules on drupal.org. Essentially this module registers a shutdown function that gets called at the end of every normal Drupal request.

The module is lightweight enough to run on production and only produces an extra syslog line per request.

Analyse the data

The data for memory profiler flows into watchdog, so if you run syslog (which you should), you can use CLI tools to analyse the data.

What does a single request look like

$ grep "memory profiler" drupal-watchdog.log | head -n 1

May 26 06:25:21 10.212.4.16 sitename: https://www.sitename.com|1432621521|memory profiler|1.152.97.17|https://www.sitename.com/|https://www.sitename.com/home|0||4.75 MB - home request_id="v-fc9573dc-036f-11e5-a8c0-22000af91462"

This comes from your syslog format (which can be changed on a per site basis):

$ drush vget syslog_format

syslog_format: '!base_url|!timestamp|!type|!ip|!request_uri|!referer|!uid|!link|!message'

Extract the data from syslog

From here you can tokenise the parts you actually care about, in other words the:

  • URL requested (part 5)
  • PHP max memory (part 9)

Using more bash foo

$ grep "memory profiler" drupal-watchdog.log | head -n 1 | awk -F'|' -v OFS=',' '{print $5, $9}'

https://www.sitename.com/,4.75 MB - home request_id="v-fc9573dc-036f-11e5-a8c0-22000af91462"

On Acquia Cloud a request ID is added to all requests, we don’t need this. Also having the string ‘MB’ there is superfluous.

$ grep "memory profiler" drupal-watchdog.log | head -n 1 | awk -F'|' -v OFS=',' '{print $5, $9}' | sed 's/ MB.*//'

https://www.presto.com.au/,4.75

Perfect.

So in order to create a CSV for analysing in a spreadsheet you could do:

$ echo "request_uri,max_memory" > /tmp/memory.csv && grep "memory profiler" drupal-watchdog.log | awk -F'|' -v OFS=',' '{print $5, $9}' | sed 's/ MB.*//' >> /tmp/memory.csv

And then you can make pretty graphs if you want:

Graph showing PHP memory usage sorted by smallest to largest

Or if you just want to find the top requests to your application by memory you can do

$ grep "memory profiler" drupal-watchdog.log | awk -F'|' -v OFS=',' '{print $5, $9}' | sed 's/ MB.*//' | sort -t, -k+2 -n -r | head -n 20

Conclusions

Based on your findings in the logs, you should be able to come up with:

  • A better understanding of your request memory profile
  • Better max memory settings for your Drupal application
  • Potentially identify poor performing pages (memory wise) and can look to optimise them

Gotchas

This module will only work if:

  • hook_boot() is called (which might not be the case if you run custom lightweight PHP scripts that do not bootstrap Drupal)
  • The Drupal request is not terminated with a SIGTERM or SIGKILL signal

Let me know if you found this helpful, or if you have any changes to my bash foo. If you have profiled your Drupal application recently, what methods and tools did you use?

May 26 2015
May 26

Want to help us make DrupalCon Barcelona the best event it can be? Get training! We’re currently accepting training proposals for DrupalCon Barcelona, so if you want to share your Drupal knowledge and get a little cash doing it, submit your great training idea to our team.

Along with sprints and sessions, training is critical for growing the Drupal community and sharing knowledge at DrupalCon. Training is a great way to help increase the power and strength of the Drupal community, to help us grow Drupal as a platform, and to earn a little money in the process. All of our trainers receive a significant portion of the proceeds from tickets sold to their training sessions, so offering a training course is one great way to offset the cost of traveling to DrupalCon Barcelona.

We are currently accepting proposals for all levels of Drupal training: from helping out absolute beginners to covering advanced material, if you’ve got special Drupal know-how, we want to hear about it! Submit your training proposals no later than 23:59 Barcelona Local Time (UTC +2) on Friday, 8 June 2015.

To help you plan your training proposal, here are a few tips from our selection team.

Above all, be detailed!

Submitting a detailed proposal is essential to being selected because it empowers the selection team to fairly compare the important elements of each proposed training, apples to apples. Make sure that, at the bare minimum, that your proposal covers the following points:

Tell us who (exactly) will benefit from this training and what the prerequisites are

Clearly listing out the audience, who will benefit and why, as well as the required prerequisites, helps potential trainees confidently self-select, which increase both sales and satisfaction.

What (exactly) will be covered over the course of the day?

The backbone of a successful training is effectively covering material at a strong pace with no gaps or lags in the day. Experienced trainers know how to create a strong agenda and the selection team benefits from seeing how they’ll do it.

What (exactly) will attendees do and what will they leave with?

Trainings that receive high ratings from attendees include hands-on exercises and real-world examples. Training is an investment, so the more relevant resources and skills an attendee leaves your classroom with, the better.

Will this course sell?

Every training has a minimum number of attendees required in order to run. The goal after selection is for every training to run and ideally, to sell out. Be ready to commit time and resources to producing quality courses and providing experienced training teams to help attendees master the material

How do I train at a DrupalCon?

DrupalCon training courses are offered by experienced trainers and the trainings themselves have been tested and improved prior to DrupalCon. Trainings which have not previously run are never selected.

Want to get your feet wet? Volunteer to proctor a course at DrupalCon Barcelona with a selected experienced trainer and learn about training from the inside or offer to train at a local Drupal camp.

Propose a Training

May 26 2015
May 26

The Drupal Association is thrilled to announce the start of two new employees. Many of you may have met Mark and Gener at DrupalCon Los Angeles, but for those of you who were unable to make it, or who didn’t run into them, here’s the info about our newest additions to the team.

Mark Brandstetter headshotMark Brandstetter, Account Manager for Technology and Hosting, Revenue Team

Mark Brandstetter is helping to take over Don Page's role as one of the new Account Manager's for technology and hosting based out of the Portland office. Mark is originally from the Midwest, but most recently spent 5 years living in Brooklyn, New York. Previously, Mark worked at Yelp and AdRoll, and his background in digital marketing and strategy will prove helpful to the team! In his free time, Mark enjoys cooking, hiking and hopes to one day join his his fellow Portland-Drupalers at the DA in owning his very own urban chicken(s). Fingers crossed!!

Gener Umali headshotGener Umali, Drupal.org Advertising, Revenue Team

Gener Umali will be focused on Drupal.org Advertising, with an emphasis on thoughtfully creating connections between the right people and products. Prior to joining the Drupal Association, Gener worked as a Director of Advertising Sales. In a ten-year advertising career ranging from startups to big-names like CNET, Gener has worked with Mac and Linux Developers, but has never encountered a group as passionate as Drupal developers. He is humbled and inspired by their dedication. In his free time, Gener enjoys tinkering with cars, motorcycles, or anything with a motor. He enjoys travel, and has been to more than thirty countries. He also enjoys snowboarding, skiing, fitness, photography, and collecting old mechanical watches.

Please help us give a warm welcome to Mark and Gener. They’ll be working hard to generate funding for the project we all love, and are already proving to be fantastic additions to the Drupal Association team.

Welcome, Mark and Gener!

May 26 2015
May 26

 Coucou! As a longtime lover of source control, I've been known to have a few opinions on how to use it. I've generally taken the approach that the tool I use needs to work for me, not against me. Unfortunately with the flexibility of a distributed version control system, such as Git, the right answer isn't always obvious. Taking the time to impose some arbitrary constraints on your workflow will make your daily tasks more predictable, and therefore easier to complete. One of the biggest wins you can make is using a standardized branching pattern for your work. If your team hasn't already "unvented" its own best practices, this article will help you choose an effective workflow for your team.

The different workflows really break down into two simple categories: the first is best described as a scheduled release pattern; the second as continuous deployment. Of course there are a spectrum of options in between, but let's look at the polar opposites for now.

The first option, the scheduled release, is typically used for products which have launch dates and different versions available at any one point in time. For example, Drupal uses a major.minor syntax for its releases. In some scheduled releases, you will also have a smaller “hotfix” release which adds a third set of numbers to the released version. From a branch perspective, this means you have a number of parallel development branches at work. Each time you begin new work, you need to carefully consider your starting point. This branching pattern was popularized by the 2010 blog post describing what is now referred to as the Gitflow Branching Model.

strategy-branching

The advantage of the scheduled release is that you always have a safe version of the code you can make a few quick changes to and deploy; the disadvantage is that you have more branches to manage and keep up to date as changes are made. The more things fall out of sync, the more likely you are to have merge conflicts when you do try to incorporate new work. For example: you need to make a quick security patch to your site, and then you need to roll this patch back into the main development line. If there's been a lot of development work since the last release, you may have code conflicts to deal with when you try to apply the same patch to the newer code.

That approach to branching is in stark contrast to the second style of branching commonly used for continuous deployment. As the name suggests, this style is typically used for systems which are already deployed, as opposed to products with a strict release date. In this style the master branch is always kept in a deployment-ready state. Nothing is considered a hotfix, because all changes are urgent and ready for deployment. Typically, this style of development will have permissions (sometimes referred to as “flippers” or “flags”) which turn off all new functionality exposed by the branch except to privileged users. Then, as the code is tested, the flag is reset to expose the functionality to increasingly more people until it is made public. Etsy, Facebook, and Flickr are all rumored to use this deployment pattern. The exact branching pattern varies a little, but you can get the gist of the pattern from The Dymitruk Model.

strategy-branching-gitflow

If you hate dealing with merge conflicts, the continuous deployment strategy can look pretty appealing. But this strategy has its own drawbacks as well. When you are using a continuous deployment strategy, it is assumed that the tip of your master branch is always safe to deploy into production. By design, there isn't a space to include a brief pause (of a day or two) for a quality assurance check of the code, and if there was a problem with the deployed code, you would be relying on tags to know when the last safe deployment of the code was. You'd be stuttering your way back through time to try and find a commit which was solid and deployable, with the time pressure of knowing you had broken code on your production server.

The concept of recovery is an important one in source control. Yes, you need to optimize your workflow so that it is easy to move forward, but you must also consider how quickly you can unravel the past and uncover the source of a regression. The two graphs shown were both relatively tidy; in reality, the graphs for your repository may not be as easy to interpret. The tools you use to untangle the past will also dictate how you commit today. (Do you love bisect? You'll want your commits stored in a specific way to take advantage of it.) I wrote about this in more detail at “The Evolution of Social Coding.” The scheduled release model provides more “life lines” to the past, whereas the continuous deployment model is moving constantly forward with smaller, more granular changes over time.

The correct solution for your team probably lies somewhere on the spectrum between the two strategies. To get a sense of how one Drupal team used variations on these two workflows, take a look at the pre-launch and post-launch workflows the Drupalize.Me team used during its upgrade process from Drupal 6 to Drupal 7.

For more information:

Image: "Coucou !" by gadl is licensed under CC BY-SA 2.0

Other articles from this issue:

Articles

Scott Hooker

Drupal 8 may not be released until... well, you know. Meanwhile, there are ways to make e-commerce usable on portable devices.

Coming Soon

Kelly O'Brien

You built an awesomely gorgeous website. All that remains is to write the (ugh!) user manual. No, you cannot first watch all 800 episodes of Dr. Who again.

Coming Soon

Features

Larry Garfield

Drupal 8 will have built-in RESTful web services. Sit tight. Or follow Palantir’s steps in setting up a major media client’s smo?rga?sbord of movies, TV shows, and other video as an API for a web app, iPhone or Android app, or even a set-top box.

Coming Soon

May 26 2015
May 26

Ben Jeavons, coltrane on Drupal.org, member of the Drupal security team, joins Ted Bowman, Ryan Price, and Mike Anello on the first post-DrupalCon Los Angeles podcast. Ben gets us up-to-speed on two-factor authentication and the modules he helped write as well as their implementation on Drupal.org. We also wrap up our coverage of DrupalCon Los Angeles, practice using Ted's new nickname, and assign homework to listeners.

Interview

DrupalEasy News

  • WE Drupal - is your organization looking to build its talent pipeline? Then consider hiring one of our upcoming graduates as an intern and/or junior developer.
  • Podcasts each day from DrupalCon Los Angeles.
  • Build your organization's Drupal talent pipeline with DrupalEasy's Drupal Career Online program. Join agencies like Acquia and Amazee Labs who are instituting internal developer training programs.

Seven Stories

Sponsors

Picks of the Week

Upcoming Events

Follow us on Twitter

Five Questions (answers only)

  1. Cornell Gamelan Ensemble.
  2. Feedly app.
  3. Getting taxes done by end of January.
  4. Checkers-playing pigeon.
  5. My first Florida DrupalCamp.

Intro Music

Simpletest - from the DruaplCon Los Angeles pre-note performed by Jeremy "TestBot" Thorsen.

Subscribe

Subscribe to our podcast on iTunes or Miro. Listen to our podcast on Stitcher.

If you'd like to leave us a voicemail, call 321-396-2340. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or corrections. If you'd rather just send us an email, please use our contact page.

yan
May 26 2015
May 26

28 pages of unmarred perfection. This book is pure unadulterated genius

- Chris Arlidge

Never Be Shocked Again! - Budgeting your Web Project

Are you having trouble figuring out an appropriate budget for your next web project? Our whitepaper can help!

Download your FREE COPY, to learn the different types of website projects, understand the factors that play a role in the budgeting process, and determine where your web plans will fit when it comes to costs!

Don’t ever be shocked by web costs again! A clear guide to help you plan the budget for your next web project.

Do you know drupal can be config to send out html mails, which you can add images, colours to email in order to enhance your users experience.

We are going to use mail system and mime mail in this tutorial. I will try to keep things simple.

Step 1: Install required modules and update configuration

  1. https://www.drupal.org/project/mailsystem
  2. https://www.drupal.org/project/mimemail

Here is a tutorial of how to install modules for drupal 7

Go to admin/modules and verify the following modules are enabled.

  • Mail System
  • Mime Mail
  • Mime Mail CSS Compressor

Go to admin/config/system/mimemail and make sure the E-mail format is set to Full HTML. You can leave rest settings to default.

Step 2: Add custom css to your theme directory

Create a new file named mail.css under your custom theme directory, so it looks like this:

site/all/theme/YOUR_CUSTOM_THEME/css/mail.css

The Mime Mail CSS Compressor module will scan this css file and convert them to inline styles for your html email.

Step 3: Add a HTML email template to your theme directory

Create a mail directory under your custom sub theme templates directory.

copy mimemail-message.tpl.php from sites/all/modules/contrib/mimemail/theme directory and put it here.

The final result should look like this:

site/all/theme/YOUR_CUSTOM_THEME/template/mail/mimemail-message.tpl.php

If you want to have a config html template per module, read the mimemail README.txt file. Their documentation is pretty good.

Note: depends on your site setup, you might not have contrib directory in your file path.

Step 4: Update your default mail template and Test it.

You have to update your drupal default mail templates, otherwise all content will be displayed in a single paragraph.

Go to admin/config/people/accounts, at the bottom of this page and you will find all the default drupal mails body, use the html tags to format them.

If you have drupal commerce installed, you might want to update all the rules that are sending out emails.

That’s it.

Optional Steps: Use table in your template

Using Tables is still the best way to create an html email layout. You can get a table template from mailchimp. Insert the table structure to mimemail-message.tpl.php form Step 3.

Other Tips:

  • Try to keep html email as simple as possible.
  • Your email should still be readable even if images arent loaded.
  • It will be a good idea to include other style sheets in your mail.css, so you don’t have to style things twice.
  • If you want to add your email template to third party service, it will be a good idea to copy html source from web mail service such as like google, since all css already been converted to in inline style for you. You can do that with firebug or devel tools.
May 26 2015
May 26

DrupalCon is always an exciting time of year for all of us in the Drupal community. This year was even more exciting as Drupal 8 is right on the horizon. Our developers flew out to Los Angles for this year's event, giving us an opportunity to share ideas with our peers (RJ coordinated a great discussion on headless Drupal), attend different sessions, and continue to stay-up-to-date on the latest trends.

Throughout all this activity, I pulled three strategic themes for folks to follow for the second half of 2015. These themes are key for your users, and you, as we navigate some huge changes in digital.

Content is King

The most popular question we get now "I want to make my site responsive."  Where do we even start with the dizzying array of devices and screen sizes? We start always by asking YOU about your content.

One of the trends we continue to see (and needs constant education) is the antitode to dealing with all this confusion and complexity is having content strategy in place. Are you viewing your content in chunks? How can we move from viewing your site as a series of pages, but rather a set of reusable components? We, at Isovera, have been at the front of this educating our clients, as it's not getting easier.

At DrupalCon this year, I can safely confirm this is no longer a fresh concept restricted to just thought leaders in the know. This now has practical ramifications, and we are seeing a clearer and clearer line with between your content and the bottom line. I'm seeing this now being discussed at the sales, corporate, and C-level -- when this has happened, you know it's time to act.

Content Administrators Are (Still) the Key to Your Long-Term Enterprise Site Success

Successful platform implementations provide easy-to-use tools to the most important users of your site. Who are these users? I will take a stand and say these users (no surprise) are your content administrators. Successfully empowering these users provide great content to your site (and good return on your investment).

Firms like ourselves are aligning to make sure once your initial engagement is complete your content editors can actually use your new platform. While Drupal 8 is making in-roads, you still need to put in the budget, time for discovery, planing and implementation so your front-line team is getting their job done. This is NOT an unnecessary cost, but an investment with overall implementation team that will ensure a greater lifespan to your site, better total-cost-of-ownership, and happier users.

Training and Education

Last but not least is the need to continue to educate users on the Drupal platform. As an open-source technology, we say time and time again, there is no product manual. You spent all this time customizing your site to meet your business needs, but did you plan to train your staff to enter that content?

We love Drupal, but regardless of your platform, it is key to be constantly choosing the right partners to support and educate your staff. For us in this field, we are seeing historic changes, and it's hard to keep up. As a non-technical user, it is key to quickly find a quality partner who help guide you on what's coming up. Websites are no longer just quick things you put together on Dreamweaver -- you are now building applications that integrate across your stack. Invest in training, as it will help you get your job quicker, and allow you to make better technology decisions.

I would love to hear some of your stories -- feel free to contact me at dsisko@isovera or just leave a comment!

May 26 2015
May 26

Last week, Nathan Vexler of the University of Waterloo, and Khalid Baheyeldin of 2bits.com presented at the Waterloo Region Drupal Users Group on Backdrop.

Backdrop is a fork of Drupal, based mostly on Drupal 7.x, and mostly compatible with its API. It also has some features from Drupal 8.x. It aims to provide an alternative that reduces the cost of ownership by minimizing the learning curve for developers.

The slides are attached below.

Attachment Size backdrop-cms-a-drupal-fork.pptx 82.98 KB
May 26 2015
May 26

You know the way you design a beautiful website, but the back end edit page is long, and ugly, and hard to follow, and ... well, let's fix that mess so website end users and content editors both have a great user experience.

This blog post is based on a talk I gave recently at Drupal Open Days Ireland 2015 held in the Guinness Enterprise Centre in Dublin last week. The genesis of the talk came from my observation that web developers often presume that the "end user" of their product is the person who visits the website to make a purchase or perform an action. My contention is that the content editor is the end user of the web developers and the site visitor is the end user of the client. It's not that simple of course, but the bluntness will do to allow us to get the conversation started.

If we accept this theory, then surely we should put as much effort into the user experience (UX) of the content editor as we do into the finished front end of the website. I met with a potential client recently who told me their website (not built on Drupal) is not very good "because it's not updated enough; it's not updated enough because it's hard to use". This organisation is losing money, losing site visitors, losing SEO, and ultimately spending more time publishing to other platforms all because the editor experience is not up to standard for them.

When using Drupal, there are a lot of things we can do to make the editor experience more enjoyable - lots of small things that can in aggregate add up to a much more pleasant user experience for the content editor. Here are some of them:

Admin Theme

Drupal 7 ships with the Seven admin theme. We find this very good and enable it for content editors on all of our websites. Ember and Adminimal are two other Drupal admin themes. We gave Ember an extensive test but found it lacking. We are quite impressed with Adminimal (which is like an enhanced version of Seven), but haven't come to a definite conclusion on whether we prefer it over seven. Using Seven versus Adminimal will give you buttons like this:

Drupal's Seven and Adminimal theme's buttons

Create Shortcuts

In general I don't like the Toolbar and Shortcuts menus. Since I usually need quick acess to lots of links I like to use the Admin Menu module. However, as a content editor, the Shortcut menu is a great option. On this website, I've created links for creating content, finding content, checking unapproved comments, and clearing the cache.

Add shortcuts for your editors to easily execute common tasks.

WYSIWYG

Though as developers we might like the wysiwyg to die, the simple fact is that clients want them. I actually think they are right to want them. I see nothing wrong with a client wanting to put some text in bold, or italics, or bullet points. My advice when it comes to wysiwygs is that less is more. In general I aim to give no more than 6 buttons on a wysiwyg - bold, italics, number list, bullet list, link, and unlink. You'll notice headings is not in that list (H1, H2, H3, H4, H5, H6). The reason being, I have found clients sometimes lack a knowledge of semantic data and will use headings for styling - as in, if they want something about 20 pixels high, they might use H3. To counteract this, we use field collections for paragraph types with all the attendant fields they might need, heading, text, media, etc (media sets we call them). We are starting to experiment with the Drupal paragraphs module at the moment.

wysiwyg - bold, italics, number list, bullet list, link, unlink buttons

Big Long Forms = no no

Bryan Braun had a great blog post a while back If Gmail were made by Drupal. In it he showed a GMail screen and then rebuilt that screen in Drupal. Suffice to say, it was a long form. For my presentation I created a content type called "Big Long Form" with text fields, image fields, taxonomy fields, and file fields. It wasn't overly long, but when showing how it worked and trying to remember what was where it became clear very quickly that long (undocumented) forms are not sustainable for the content editor. How to fix this?

Short, tabbed forms = go go

As a matter of course, when building Drupal websites, I install the Field Group module. This allows me to put form fields into groups - all text fields in one group, all taxonomy fields in another, all media fields in a third, or whatever categorisation system I wish. Taking this approach, the content editor is not overwhelmed with options and can simply click on the tab of the category he or she wishes to edit. The field group tab I most commonly use for this is the wonderful Vertical Tabs.

Drupal field group vertical tabs

Now, doesn't that form look much easier to manage? Well yes and no. Yes it's easier to manage, but the content editor might have too many tabs now, perhaps we don't want them being able to edit menu items or change the URL alias. Can't we simplify this?

Simplify things

Using Drupal's Simplify module we can, well, simplify things. In this instance, I am going to remove the admin-related tabs from the editor role, so they will only see content-related tabs.

Using Drupal's Simplify module to remove admin tabs from content editors

Not just random Acts of Kindness

Be nice to your content editors. Provide them with help text. Not just randomly, but on all form elements. For example, on an image field, let them know that the expected dimensions of the image are 450px by 220px and that the image will appear on the news listing page.

Adding help text to image fields in Drupal improves the content editor experience

(Excuse the title on that image field - it was just for demonstration purposes.)

Beautify the help

Once you have all of your help texts in place, the form will become a little longer. This isn't necessarily a good thing. I like to install the Beauty Tips module to insert the help text in popup bubbles, visible only when the user clicks on that field. It also allows me to write slightly longer help texts for my clients.

Place help text in pop up bubbles to save screen space.

Selecting from a large range of options

I once created an Organic Groups-based website with 2,500 groups. Every time a new feature was created for a group, we had to decide which groups were ready for this new feature. We then had to try to select the groups from a tiny input/select box trying to grab, for example, 179 groups of 2500. To say my finger often slipped off the mouse, or missed a group, is an understatement. With Drupal's Multiselect module all of this hassle could have been avoided. Multiselect allows editors to select available list items and then tick an arrow to send them to the selected options list and vice versa.

Add Drupal's Multiselect widget for easier selecting from large lists.

Making the link

The content editor often has trouble with links. Finding pages, linking to them, then editing the linked page (resulting perhaps in a change of URL), but forgetting to edit the page that links to it and then ... (it's all getting complicated). Using LinkIt module, editors are given a much better link interface to find the content they wish to link to, which will also automatically update the links if they change. Add to that the Link Checker module and you've a pretty cool link infrastructure in place.

Using Linkit module to more easily create links in Drupal CMS

Dashboards

Once you have your content editor experience created for editing pages, don't forget to create a dashboard for your content editors to give them an overview of the website. This can be something simple using the Dashboard module or more complex using Workbench and Workbench Moderation modules. It will depend on the workflows in place in your clients organisations. At a minimum - with my content strategist hat on - I create blocks of most recently added/updated content, least recently added/updated content, content due for review, and unapproved comments.

That was as far as my presentation got. I'll follow up this blog post with another one soon detailing some other modules that I mentioned in passing during the presentation, such as admin views, honeypot, webform default fields, conditional fields, paragraph module, field collection, and more.

Any thoughts? Anything left out (I'm sure there's loads more)? Please add them to the comments.

(slides for presentation can be found here.)

May 26 2015
May 26

Our team just came back from DrupalCon Los Angeles, but this does not mean that we are not already working hard on getting parts of DrupalCon Barcelona sorted.

Michael chairs the Site Building track and Dagmar is chairing the Business & Strategy track. Bastian shares his experience from last year and and works as a global DevOps track chair; together with Ricardo Amaro.

Since the submission deadline is coming up soon we  encourage you to submit a session NOW! If you saw someone presenting about a specific topic and you believe this person should speak in either one of the Business, Site Building or DevOps tracks feel free to get back to us. We'll use all our charm to win those people to submit a session too!

The submission deadline is Monday, June 8. If you already have a topic in mind, give yourself a head start and submit today! If you are not sure yet what to speak about, you have enough time to get inspiration from the talks at DrupalCon Los Angeles.

Business and Strategy

This Business and Strategy track is aimed at attendees looking for actionable advice, ideas and challenges from business owners, executives and project managers on how to manage a Drupal business in a successful way. Sessions in this track will be non-technical by nature.?We are in a good market position - the usage of Drupal is expanding and Drupal companies are growing, are founded or merged. Growth and change make Drupal businesses face various challenges. This year we will talk about how we grow, how we make our good culture sustainable and which processes and tools we need.

We are especially seeking topics for the following sessions:

  • Growth and team size
  • Business Diversification
  • Culture
  • KPIs and Processes
  • Resource Planning and Profit Growth

Site Building

Building complex sites without coding is one of the most powerful strengths of Drupal. Learn what can be achieved by using the best tools, practices and strategies; from the wide contrib space of the mature Drupal version 7 to the fascinating new features and possibilities of the upcoming Drupal 8.

We are especially seeking topics for the following sessions:

  • What we can achieve right now using Drupal 8
  • How to build sites with Drupal 7 that will be easy to upgrade to Drupal 8
  • There is a distribution or module for that! Studies and real life examples
  • Layouts and theming through UI
  • Improving UX

DevOps

DevOps continues to bridge the gap between the world of developers and operations. The business value gained with the solutions achieved makes DevOps an important mind switch on systems, end-to-end processes, amplification of feedback loops and the culture to experiment and learn. In this track we want to expand these core concepts of DevOps to the Drupal community and have a broader view on how they are being achieved and used out there.

We are especially seeking topics for the following sessions:

  • Testing Frameworks (Behat, PHPUnit, PhantomJS, etc)
  • Container Virtualisation (w/ docker, lxc, etc.)
  • Search Infrastructure (Apache Solr, Elasticsearch)
  • Infrastructure Management (Chef, Puppet, Ansible, Salt)
  • Logging / Log Data Handling
  • Dashboard Design / Data Visualisation / Monitoring
  • Automated Deployments/ Continuous Integration
  • Performance and Global Performance Strategies
  • Business value of DevOps
  • Establishing DevOps Culture

Doesn't that sound like you could give a fantastic talk about one of those topics? Don’t hesitate - Submit your session now!

We are looking forward to seeing you - On stage in Barcelona!

Dagmar, Michael & Bastian

Chairs of the Business and Strategy, Site Building and DevOps tracks for DrupalCon Barcelona

tao
May 26 2015
May 26

What can you do in 10 minutes? Make yourself some coffee, look into the window, yawn a couple of times and psych yourself up for the long installation of the Drupal base package? Guys, what a waste of time!

Could you believe that 10 minutes are enough to install Drupal base package? Impossible? Well, at first glance, installing Drupal base package really seems to be a challenging task. If you are not IT guru or a very experienced Drupal developer, you probably think that it will last for a couple of hours...or maybe even all day.

Forget the word “impossible” with InternetDevels! We have written a script that enables anyone to install the Drupal base package in just 10 minutes.

Now, you are just 3 simple steps away from having your own basic Drupal website.

Step 1: Download the file install_dbp.sh

You can get the script from the repository on Github. Follow this link to download it https://github.com/id-tao/dbpi. Or you can download the script using GIT (git clone https://github.com/id-tao/dbpi.git). 

Step 2: Run the script install_dbp.sh

First you need to choose the folder where you want to install your future drupal website.

Then run two simple commands:

sudo chmod +x /path/to/script/folder/dbpi/install_dbp.sh

sudo /path/to/script/folder/dbpi/install_dbp.sh

Step 3: Follow the instructions from cmd

During the installation, the script asks to give some parameters for the future site: project name, username and password for the database, etc., as well as to confirm some stages of installation.

For more details, including console commands, you are welcome to view our presentation.

Having completed the installation, you will get a ready basic Drupal site that includes Drupal core and the following modules: Globalredirect, Admin menu, Ctools, Token, Views, Pathauto, Google analytics, Xmlsitemap, Elysia cron, Metatag, Wysiwyg, Imce, Wysiwyg filter, Transliteration, Subpathauto.

After that, you will be able to work with your new Drupal website, add more modules and configure it to your liking. We wish you good luck in this exciting process!

Install Drupal base package in 10 minutes with our new script!

May 26 2015
May 26
Sophie Shanahan-Kluth's picture May 26th 2015Drupal Developer

What we were doing

Recently one of our clients requested an update to the visibility settings in their content and for these access settings to filter through to some views they had set up. Using Organic Groups, we could easily create public and private content, but the client wanted more fine-grained permissions that allowed for content to be restricted by user status as well.

With the help of the OG Extras module, we created the following options:

  • Publicly accessible to all users
  • Restricted to only logged-in users
  • Restricted to only users in one of the content's groups
  • Private to only the user creating the content

That was easy enough: we updated the field base to include the new options, keyed using the constants defined in the OG Access submodule (and adding one of our own in a custom module where all of this work took place). The tricky part was adding filtering to the views, as there was now no easy way of telling views to filter correctly. So, hook_views_query_alter() to the rescue!

Why we were doing it

It's important to point out that this isn't always the solution you should seek. Adding a query alter hook makes it more difficult for a site to be maintained - site builders can't see it in the UI, and if you don't clearly document your work, then you run the risk of having it overridden by an over-zealous administrator who renames the view, or something similar.

In our case, we were unable to use the filtering that Views offers out-of-the-box to get the results we needed. Not only did we need to know what permissions were set on the content, but we also needed to know whether the user was logged in, whether the user looking at it was the user who created it, and whether the user looking at it was in one of the groups that the content appeared in.

Simply put, Views couldn't handle all of those filters at once through the UI, so our only option was to modify the query directly.

Planning

Before diving into the code, it became apparent that we would need to figure out exactly what data needed to be displayed in each use case, and how to set up the code. We began with a list of criteria that would lead to the view being displayed:

  • User is anonymous AND the group content access is set to 'public - all including anon'.
  • User is logged in AND the group content access is set to 'restricted - only auth users' OR content is in one of the user's groups.
  • User is logged in AND the group content access is set to 'private - only users in these groups' AND content is in one of the user's groups.
  • User is logged in AND they created the content.

From there, it was easy to start breaking the checks down and order them in such a way that each new check will override the previous ones.

  • Is the user logged in? If no, then only show public content. If yes, show content for members.
  • Is the content in one of the user's groups? If yes, then show it. If not, don't.
  • Did the user create the content? If yes, show it.

This could all be achieved by adding a db_or() condition to the query in hook_views_query_alter().

Setting up the code - step by step

Bear in mind that hook_views_query_alter() operates on all Views queries, so it's a good idea to make sure you're working with the correct view/query before going ahead. For us, a simple check against the $view->name was sufficient.

In order to retrieve some of this data, we need some extra tables to be added and to cue up some other variables.

$anon = user_is_anonymous();

$query->add_table('field_data_group_content_access');
$query->add_table('og_membership_node');
$query->add_table('users_node');

// Set up our db_or. Either...
$conditions = db_or();

The first check we need to make is whether or not the user viewing the view is anonymous. If they are, we don't need to do too much else - just add the condition and continue.

  if ($anon) {
    // ... user is anonymous and content is public.
    $conditions->condition('field_data_group_content_access.group_content_access_value', array(OG_CONTENT_ACCESS_PUBLIC));
  }

Then comes the trickier bit. The user is obviously not anonymous, so we need to check the status of the content, which groups it belongs to, and whether the author of the content is the one viewing it.

First things first, using the global $user variable, we can check the user's roles. For this client, we were also checking for the 'member' role, but you can just as easily remove this check (assuming all authenticated users can view this content).

  else {
    global $user;

    // ... user is logged in and content is restricted to member users.
    $access_values = array(OG_CONTENT_ACCESS_PUBLIC);

    if (in_array('member', $user->roles)) {
      $access_values[] = OG_CONTENT_ACCESS_RESTRICTED;
    }

    // Add the condition.
    $conditions->condition('field_data_group_content_access.group_content_access_value', $access_values);

The next step is to load the logged in user's groups and filter the view by the group IDs. For this, we'll need to create a db_and() - we want to make sure the content has one of the $access_values we've set up, and also that it is in one of their groups. If the user doesn't have any groups, there's no point in adding this condition.

    // ... user is logged in and content is in their groups.
    $gids = og_get_groups_by_user(NULL, 'node');
    if (!empty($gids)) {
      $access_values[] = OG_CONTENT_ACCESS_PRIVATE;

      $group_and = db_and();
      $group_and->condition('og_membership_node.gid', $gids, 'IN');
      $group_and->condition('field_data_group_content_access.group_content_access_value', $access_values);

      // Add the condition.
      $conditions->condition($group_and);
    }

Finally, add a check to see if the content being viewed is content that the user has created themselves. If they've created it, they should be able to view it, regardless of any other permissions set on it.

    // ... user is logged in and they created the content.
    $conditions->condition('users_node.uid', $user->uid);
  }

And to wrap it all up, we need to add the condition to the query.

  $query->add_where(0, $conditions);

Final structure

Fragmenting the code like this makes it difficult to understand what's going on, and I whizzed quite quickly through it. In the end, though, you should end up with a db_or() statement that looks something like one of these. Remember, there is a different $conditions value depending on whether the user is logged in or not.

For anonymous users:

$conditions = db_or()
  ->condition('field_data_group_content_access.group_content_access_value', array(OG_CONTENT_ACCESS_PUBLIC));

For logged-in users:

$conditions = db_or()
  ->condition('field_data_group_content_access.group_content_access_value', $access_values)
  ->condition(db_and()
    ->condition('og_membership_node.gid', $gids, 'IN')
    ->condition('field_data_group_content_access.group_content_access_value', $access_values)
  )
  ->condition('users_node.uid', $user->uid);

Good luck!

Further reading

May 26 2015
May 26

11 Lorem Ipsum Generators That Make Drupal Site Building Fun

I have been building and maintaining Drupal sites for over 8 years now. As a Drupal site builder it is my job to ensure that all content types, fields, views, panels, and other components of a Drupal site build are working properly before launch. This requires actually entering real content on the site, which can be time consuming. Some of you may be thinking, “What about Devel Generate?”. Devel generate works great for initial testing of content types, as it allows for automatic creation of nodes for testing, but we still need to make sure creation of content goes smoothly for content editors. This means at some point we actually have to test creating content manually. This is where a Lorem Ipsum generator comes in handy.

I have mainly used generic lorem ipsum generators like Lipsum.com over the years, or more recently the Lorem Ipsum Generator (Default Text) Chrome extension. These work great, but after 8 years have become a bit of a bore when creating test content. One of our team members, Nick Lewis, showed me the Corporate BS Generator one day and just last week I thought to myself, “That Corporate BS Generator would be a pretty funny lorem ipsum generator.” That’s when I decided to Google “bs lipsum generator” and came across Corporate Lipsum. What I discovered next was something that I never imagined. There are tons of themed lorem ipsum generators out there. There are many that are comical and some are very innovative in their approach. Let’s take a look at 11 Lorem Ipsum Generators that will be sure to make testing content creation on your next Drupal project fun.

  1. Meet the Ipsums - This lorem ipsum generator is an aggregator of ipsums from many of the other lorem ipsum generators out there. It has one of the nicer looking designs of the lipsum generators I have seen.

  2. Pirate Ipsum - This lorem ipsum generator allows you to create lipsum text in pirate talk. This one is my favorite design so far for all of the lipsum generators I have seen. You can even buy posters of the artwork used on the site at the bottom of the page.

  3. Startupsum - This lorem ipsum generator allows you to create lipsum text with startup related terms and phrases. It has a clean design and has automatic text copy highlighting, which is a nice feature to have for these types of sites.

  4. Sagan Ipsum - This lorem ipsum generator spans the cosmos and generates lipsum text of one of the great literary geniuses of our time, Carl Sagan. Take your next project to a new level of understanding with this lipsum generator. it includes a text selection button to make copying the generated text much easier.

  5. Pick Sum Ipsum - This lorem ipsum generator has several options for generating lipsum text which are fairly unique. It has the most innovative feature out of the sites I have seen that allows you to have 2 actors “brawl” to combine their generated lipsum text together for even more fun. This generator includes a button to select the text to copy, however it takes more time to actually generate the text due to it’s multiple options.

  6. Savage Ipsum - This lorem ipsum generator is one of my favorites for content, as it generates word and phrases that “Macho Man” Randy Savage would say during his wrestling career. Ooooh yeeeah!

  7. DeLorean Ipsum - This lorem ipsum generator is a throwback to one of my favorite movie franchises, Back to the Future. Generate some “heavy” lipsum text for your next site build with this one.

  8. Hodor Ipsum - This lorem ipsum generator is one of the funnier lipsum generators I have found. It generates lipsum text in the language of the Hodor characters from Game of Thrones. Keeping in character, the site is even created by Hodor.

  9. Cheese Ipsum - This lorem ipsum generator has a great design and the delicious subject matter of cheese related words and phrases. You may find yourself looking for lunch earlier using this lipsum generator.

  10. Bacon Ipsum - This lorem ipsum generator falls in the food category again, but this one generates text with a bit more meat to it. There are no fancy features on this lipsum generator, but it had me at bacon. It even has Turducken!

  11. Pig Latin Ipsum - I figured with all these types of lorem ipsum generators, there had to be one for Pig Latin, and there is! This lipsum generator will generate lipsum text that is translated to Pig Latin. The best part is you can translate any text you want, so technically you could turn any of the lipsum text from the previously mentioned lipsum generators into this one and get an even funnier result.

That rounds out my list of favorites that I have found so far, but there are tons of other fun and innovative lorem ipsum text generators out there to check out. Some even fill other needs for Drupal site building, such as allowing you to generate placeholder HTML code and generate placeholder images. Not Lorem Ipsum takes a completely different approach on things by giving you ideas of what to write for your actual content based on your industry. As you may have guessed, there is also a module for that called Drupal Ipsum. Drupal Ipsum allows you to generate Drupal related ipsum text and even integrates with Devel. Let us know what your favorite lipsum generator is in the comments below.

May 26 2015
May 26

Today our Group is launching Amazee Talents, a program to win bright minds like you for a 3 month internship at Amazee Labs or Amazee Metrics.

If you have completed, or are about to complete your apprenticeship, higher education or university degree and happen to live in Switzerland, the European Union, the United States or South Africa, then read on.

We are looking for above-average talents in web development, web analytics or online marketing who love to tackle tech problems and want to join our hard working team.

Depending on the available positions and your domicile you will be assigned to an internship in Zurich (Switzerland) or Austin (Texas, USA). The Amazee Group covers all travel and accommodation cost to and at your place of work. 

So, if you want to learn from the best in the field of Drupal development or web analytics & online marketing and be part of an open and creative corporate culture, visit the Amazee Talent program on our Group website.

We are looking forward to your application (scroll down for the talent program)!

May 25 2015
May 25
This will be the second part of the code examples, and the third in the series about Drupal and the Internet of Things.

If you haven't read the other parts of it, you are going to be all fine. But if you want to, the front page has a complete list

In this part we will look at simplifying the request flow for the client, while still keeping a certain level of security for our endpoint. There are several ways of doing this, but today we will look at a suggestion on how to implement API keys per user.

Let me just start first by saying there are several additional steps you could (and ideally should) implement to get a more secure platform, but I will touch on these towards the end of the article.

First, let's look at a video I posted in the first blog post. It shows an example of posting the temperature to a Drupal site.

[embedded content]

Architecture

Let's look at the scenario we will be implementing

  • A user registers an account on our Drupal 8 site
  • The user is presented with a path where they can POST their temperatures (for example example.com/user/5/user_temp_post)
  • The temperature is saved for that user when that request is made

See any potential problems? I sure hope so. Let's move on.

Registering the temperature in a room and sending to Drupal

As last time, I will not go into details on the implementation of any micro controller or hardware specific details in the blog post. But the code is available on github. I will quickly go through the technical steps and technologies used here:

  • I use a Raspberry pi 2, but the code should work on any model Raspberry pi
  • I use a waterproof dsb18b20 sensor, but any dsb18b20 should work. I have a waterproof one because I use it to monitor my beer brewing :)
  • The sensor checks the temperature at a certain interval (per default, 1 minute)
  • The temperature data is sent to the Drupal site and a node is created for each new registration
  • To authenticate the requests, the requests are sent with a x-user-temp header including the API key

This scenario is a bit different from the very real time example in the video above, but it is both more flexible (in terms of having a history of temperatures) and real-life (since temperatures seldom have such real-time changes as the one above).

Receiving temperatures in Drupal

The obvious problem with the situation described above, is the authentication and security of the transferred data. Not only do we not want people to be able to just POST data to our site with no authentication, we are also dealing with temperatures per user. So what is to stop a person to just POST a temperature on behalf of another user? Last post dealt with using the same user session as your web browser, but today we are going to look at using API keys.

If you have ever integrated a third party service to Drupal (or used a module that integrates a third party service) you are probably familiar with the concept of API keys. API keys are used to specify that even though a "regular" request is made, a secret token is used to prove that the request originates from a certain user. This makes it easy to use together with internet connected devices, as you would not need to obtain (and possibly maintain) a session cookie to authenticate as your user.

Implementation details

So for this example, I went ahead and implemented a "lo-fi" version of this as a module for Drupal 8. You can check out the code at github if you are eager to get all the details. Also, I deployed the code on Pantheon so you can actually go there and register an account and POST temperatures if you want!

The first step is to actually generate API keys to users that wants one. My implementation just generates one for users when they visit their "user temperatures" tab for the first time.

Side note: The API key in the picture is not the real one for my user.

Next step is to make sure that we use a custom access callback for the path we have defined as the endpoint for temperatures. In my case, I went with making the endpoint per user, so the path is /user/{uid}/user_temp_post. In Drupal 7 you would accomplish this custom access check by simply specifying something like this in your hook_menu:

'access callback' => 'my_module_access_callback',

In Drupal 8, however, we are using a my_module.routing.yml file for routes we are defining. So we also need to specify in this file what the criteria for allowing access should be. For a very good example of this, I found the user.module to be very helpful. My route for the temperature POST ended up like this:

user_temp.post_temperatures:
  path: '/user/{user}/user_temp_post'
  defaults:
    _controller: '\Drupal\user_temp\Controller\UserTempController::post'
    _title: 'Post user temperatures'
  requirements:
    _access_user_temp_post: 'TRUE'

In this case '_access_user_temp_post' is what will be the criteria of allowing access. You can see this in the user_temp.services.yml file of the module. From there you can also see that Drupal\user_temp\Access\PostTempAccessCheck is the class responsible for checking access to the route. In this class we must make sure to return a Drupal\Core\Access\AccessResult to indicate if the user is allowed access or not.

Some potential questions about the approach

From there on in, the code for the POST controller should provide you with the answers you need. And if the code is not enough, you can try to read the tests of the client part or the Drupal part. I will proceed with making assumptions about theoretical questions to the implementation:

How is this different from using the session cookie?

It is different in 2 aspects. The API key will not expire for reasons beyond your control. Or more precisely, the device's control. You can also reset the API key manually if you would want it to expire. The other big difference is that if your API key should be compromised, your account is not compromised in any way (as would be the case if a valid session cookie were to be compromised). Beyond that, please observe that in one area this is not different from using a session cookie: The requests should be made over https, especially if you are using a wifi connection.

How can I further strengthen the security of this model?

One "easy" way to do this is to not expose the API key as part of the request. I was originally planning to implement this, but realised this might make my original point a little less clear. What I would do as a another "lo-fi" hardening would be to make the x-user-temp header just include a hash of the temperature sent and the user API key. This way, if someone were sniffing the requests, they would just see that the x-user-temp header would change all the time, and so it would take a considerable effort to actually forge the requests (compared to just observing the key in the header).

Why are you using nodes? Isn't that very much overhead for this?

This is a fair point. It might be a bit overkill for something so simple. But there are two bonus parts about using nodes:

  • We can use views to display our data.
  • We can ship the views, content types and fields as configuration with our module.
This last part is especially powerful in Drupal 8, and incredibly easy to accomplish. For the files required for this particular implementation, you can reference the config/install directory of the module.

But since you are posting nodes, why aren't you using the REST module?

I admit it, I have no good reason for this beyond that I wanted to make this post be about implementing API keys for authentication. Also, here is a spoiler alert: Code examples part 3 will actually be using the REST module for creating nodes.

What if I want to monitor both my living room and my wine cellar? This is only one endpoint per user!

I am sorry for not implementing that in my proof of concept code, but I am sure you can think of a creative solution to the problem. Also, luckily for you, the code is open source so you are free to make any changes required to monitor your wine cellar. "Pull requests welcome" as they say.

As always, if you have any question or criticism (preferably beyond the points made above) I would love to hear thoughts on this subject in the comments. To finish it all off, I made an effort to find a temperature related gif. Not sure the effort shows in the end result.

May 25 2015
May 25

Drupal 8

Four years ago we made an important decision at Netstudio: We would migrate to Drupal. Drupal 7 had just come out, and despite our having mastered Joomla at online-store level, we simply could not ignore Drupal’s embedded Content Construction Kit, its multi-lingual support, safety, stability, scalability, search engine friendliness, but, most of all, the professionalism of the Drupal community.

Drupal 7 helped us undertake even bigger and more complex projects, and build all of our solutions for ecommerce and presentation websites, including even our ERP, project management tool, quotes generation and hiring systems and our project management tool. It was on Drupal we based our company’s projects, like visibility.gr and servalarm.com, as well as more than 200 websites and online stores for our customers.

Not for a single moment have we regretted our migration to Drupal, despite our having to learn a new ecosystem from scratch.

Just six months after Drupal 7 was launched, the Drupal community set off for Drupal 8. Dries Buytaert set very high standards for the new version of Drupal defining the main pillars to set it on the crest of the wave.

Four and a half years of development later, beta 10 release is here, signalling the approach of the final release in less than 6 months from now!

More than 2800 programmers ? twice as many as for its predecessor ? have contributed for Drupal 8 developing hundreds of new features.

The most significant structural change made was that it was based on Symfony2 framework thus turning it into an object-oriented platform. From now on, large chunks of code, such as Guzzle, Twig (the new theming system), the Composer, etc. come from the Symfony2 community.

Moreover, Drupal 8 brings along enormous changes in the way we develop websites.

Internationalization

Multilingual support is very important for us, since we are based in Greece and our many international clients require the operation of their website in English and the language spoken in their country. Some of our clients run multilingual websites ??(eg ivf-embryo.gr is available in 14 languages). Drupal 7 supports multilingual websites much better than Joomla or WordPress, but requires installing and configuring over 15 additional modules. In some extreme cases full support requires a programmer’s intervention, so it is not fully manageable by the non-technical administrator.

Multilingual support is embedded in the core of Drupal 8 requiring the activation of only 4 modules. Drupal can now be installed and operated in the administrator’s native language from start to finish. Gábor Hojtsy, heading a large team of contributors for this pillar, did an excellent job solving dozens of issues on Drupal 7, and transforming Drupal 8 into the most comprehensive platform available for developing multilingual websites and open-source-code applications!

Views in Core

For many, the views module is the basic reason for choosing Drupal. It allows displaying data to the user, without them having to write SQL queries. In Drupal 8 the Views module is conveniently embedded in Core. You can start building your website without having to install an additional module offering stability, full integration and interoperability. Furthermore, all administration screens are now Views, allowing the administrator to change fields and their appearance with just a few clicks.

WYSIWYG and Inline Edit

Drupal 8 Inline Edit

Content editing in Drupal 7 hasn’t been the best experience for the administrator. WordPress is still the leader in convenience and usability in this area. At Netstudio we have been installing dozens of modules in order to provide our customers with an environment almost as friendly as that of WordPress. Drupal 8 is a huge step in that direction. Its basic installation offers the content manager enhanced usability in a much friendlier environment (in fact, Netstudio has contributed some usability tests via UserFeel.com). The new release features a configured built-in WYSIWYG editor, as well as the impressive cutting-edge Inline Edit, making quick content interventions piece-of-cake for the front-end administrator.

Anything left for the next Drupal 8 (maybe 8.1) release? Well, yes. Media administration (photos, videos etc.). Although there have been improvements, additional modules need to be installed for a comprehensive solution, as is the case of the recently released Entity Embed and Entity Browser.

Mobile friendly

Now that the mobile web is a reality, it all seems so matter-of-fact. In 2011 however, at the onset of the Drupal 7 era, all we knew about the mobile web was forecasts. Fortunately, Dries Buytaert took these forecasts seriously, so he set the requirements for Drupal 8 aiming at its full compatibility with mobile devices. And his efforts were not in vain. The environment all around Drupal 8 is not only responsive, but also very easy for mobile and tablet users, even regarding contextual links, the admin menu and inline editing. The bottom line is that any administrator can manage their website comfortably commuting on a bus seat, on their bed or enjoying the sunshine on the beach!

Performance & Scalability

A platform’s performance and its ability to juggle sudden spikes of traffic have been major concerns of ours, partly explaining why we migrated to Drupal 7. Initially, Drupal 8 was much slower than Drupal 7, as shown in a comparative analysis we published two years ago. The obvious reason of course was that it was still under development and lacking the necessary speed optimization. This now has been changed. About a month ago, internal cache was set to on by default. We’re talking about a much smarter cache than that in Drupal 7. Speed racing is in progress, with developer Wim Leers in the lead. Here we expect dramatic improvements and capabilities once "SmartCache" and "PigPipe", Facebook-style page loading have been embedded in the core.

Configuration Management

I have a crush on this one, can’t wait for it, as it solves the issue of maintaining the site configuration under version control. In Drupal 7 website configuration and content were stored in the database, sometimes in the same tables, making their management almost impossible. We have repeatedly tried to resolve this issue using features, strongarm etc, but have given up as these solutions were too time-consuming and costly. We’ve been going out of our way creating scripts to control functionality, and checking over 300 points regarding security, performance, SEO etc. before delivering a website to our client. Still, this may not be considered a comprehensive solution. In Drupal 8 configuration is stored in YML files. That makes version control management, and data transfer from website to website or from environment to environment (e.g. development > staging > testing > live) a breeze.

Next Releases

Another important change in Drupal 8 is the rate of publication of new releases. In Drupal 7 subsequent releases (7.01, 7.02, and the most recent one, 7.37) focused exclusively on fixing bugs and security issues During these last four and a half years only few features have been added, in accordance to the backward compatibility policy. This is changed in Drupal 8. Versions 8.1, 8.2, etc. will not comprise of "minor updates", but will add new functionality. What it boils down to is that from now on, Drupal will be integrating technology innovation much faster.

More Novelties

Over and above the most important new features mentioned above, Drupal 8 comes with many more innovations like fieldable blocks, a greater range of integrated field types (date, entity reference, phone, email, link), the tour module, embedded schema.org output, enhanced accessibility, content publishing preview, friendlier front-end development, and more. What’s your main reason you can’t wait for Drupal 8?
Leave your comment below.

When will it be ready?

DrupalCon Los Angeles, with dozens of developers racing in Coding Sprints for the completion of Drupal 8, is now over. Only 20 critical issues (tasks and bugs) were left unsolved!

Teh RC (Release Candidate) version will be released once the last of these issues will have been resolved. The final version of Drupal 8 will be released 15 days after critical tasks and critical bugs have been brought down to zero. This is likely to take less than six months, but we’ll need to wait for another few months before we see the top contributed modules upgraded to Drupal 8. Knowing us, however, I’m sure we’ll start developing some simple presentation websites on the release of the almost final version. However, we’ll have to wait for 3-6 extra months before we can use Drupal 8 in more demanding installations. Meanwhile, we can all keep an eye on the top 100 contributed modules and their Drupal 8 updating status at: http://www.bluespark.com/status-top-100-contributed-modules-drupal-8

We can’t wait for Drupal 8. Can you?

Now you know our reasons of impatience to start working on Drupal 8. What about your reasons? Do you plan on using Drupal 8? Have you used it already? What do you like most about it? Write your comment here.

May 25 2015
May 25

I was working on a big website with many contrib and custom modules. And I had to debug a very annoying redirect that started happening sometime in the recent past, not sure when. Some pages simply just redirected to other URLs.

I figured out that the problem was one of a 301 redirect. My browser told me that at least. But good luck figuring out where in the code I can find the culprit. Xdebug breakpoints everywhere but to no avail. A search for drupal_goto in the custom modules directory didn't help either, and God be with anyone trying to search through a contrib folder of that size.

Then it hit me. Isn't there a hook invoked inside drupal_goto? At this point I was assuming (and hoping really) that the redirect was happening somehow with a drupal_goto. And it turns out there is one: hook_drupal_goto_alter.

Armed with a new dose of hope, I implemented the hook and cleared the cache. Inside, I added the obligatory $test = ''; statement and put a breakpoint on it. Let's see what happens. After loading one of the offending pages, the breakpoint halted the execution and the Xdebug call stack in my PHPStorm immediately pointed out the problem: Global Redirect. There was some URL rewriting happening on the site so GR got a bit confused and was redirecting back to the original path. The details of the issue are however not important.

My point is that using this hook, I could see exactly who and why was calling drupal_goto. I didn't use it for anything else, apart from learning why the redirect is happening which in turn allowed me to write some code that prevented that.

Awesome. I learned about a new hook. And maybe now you as well.

May 24 2015
May 24

When preparing an email newsletter, one part of it that is time consuming is gathering together all the content that is needed. In my experience, virtually all the content already exists elsewhere, such as in the local CMS, in CiviCRM, or on a blog, or some other online source.    So I was thinking how can I make this process easier.  What I did: I created mail merge tokens for CiviCRM that autofill a list of recent blog posts, stories, or any other type of CMS content.  So the end-user sees a list of tokens, one for each content type, each term/category, each aggregator feed,  and for each date range. Such as "Content of type 'blog' created in the last 7 days" .  What is particulary powerful about this approach, is that if you are also using a CMS aggregator (such as the aggregator module in Drupal core) then virually any external RSS feed is turned into CMS content, which is now available as a CiviCRM token. (The original blog post about this extension is at: https://civicrm.org/blogs/pogstonesarahgladstone/easier-creation-email-newsletters-content-tokens )

Thanks to community involvement (specifically thanks to https://github.com/jorich-2000), there is a new version of the Content Token extension.  This version now supports Joomla, in addition to Drupal7, Drupal6, and WordPress.

The lastest version is 2.9 and can be downloaded from: https://civicrm.org/extensions/content-tokens

If you like this extension, you will also likely enjoy my other extension: the "Fancy Token" extension which provides tokens for upcoming events, contribution pages, profiles, and WebForms. 

I am looking forward to getting feedback on this.

May 23 2015
May 23

I plan on doing a more in depth article on how I've been using Panels instead of templates or contexts for laying out this Drupal 7 site, but I feel like I still have more to learn.  Until then, I wanted to share what I found to be a missing piece of the puzzle, Page Manager Existing Pages.

PMEP allows you to override any page that is in the admin menu for use in Page Manager.  That way, you can create variants, and add whatever layout, content, selection rules, that you want.  Without this plugin, you get an error message in Page Manager when trying to overwrite an existing URL.

So, where would I use this?  Page Manager comes with defaults for Node, Taxonomy, and some User pages, most of what you need to present your site to the world.  But there are certain administration pages, when viewed in a front end theme that slipped through the cracks.  For example, node/add, which lists all the content types you can add, or the Style Guide Module generated /admin/appearance/styleguide

Install and configure Page Manager Existing Pages

May 22 2015
May 22

In this guest post, Luke Herrington shares his experience with integrating an existing Drupal backend with a Backbone.Marionette Todo app.

If you're reading this, you probably already know about all of the great work that Gizra has done in the Drupal/REST space. If you haven't, I highly recommend you check out their github repo. Also see the RESTful module.

One of the projects that Amitai has contributed is Todo Restful. It shows an Angular implementation of the canonical TodoMVC Javascript app connecting to a headless Drupal backend. It's a great demonstration of how easy exposing Drupal content with the RESTful module is. It also shows that when a RESTful API adheres to best practices, connecting it with clients that follow the same best practices is like a nice handshake.

I saw the Todo Restful project and it got me thinking, "If Amitai did this right (hint: he did), then I should be able to get this working with Backbone pretty easily". I was pleasantly surprised!

View demo Get the source code

Todo app with a Drupal backend

Here's a simplified list of everything I had to do to get it working:

  1. Fork the repo
  2. Delete everything in the client/app directory. (the Angular TodoMVC stuff)
  3. Put Backbone.Marionette implementation of TodoMVC into client/app directory.
  4. Change the API endpoint in the Backbone code Override parse functions on Todo model/collection to dig into the data portion of the response from Drupal. This was necessary because Backbone expects the response for a collection to be an array of models. The RESTful module sends back other data so it places the models inside an array named data. All I had to do is tell Backbone where to look.
  5. Edit Grunt file to work with the new app code. This was the hardest part because it was specific to the Angular app.
  6. Test, Commit, Deploy. Amitai setup a Grunt task to deploy the client side code to a github project page

Note: There are detailed instructions on how to get the app running locally on in the repo readme.

Notice I didn't have to touch any code on the Drupal side. Amitai's amazing installation script spun up the Drupal site for me with todo content type created and exposed with RESTful. It just worked. In fact the Backbone.Marionette demo app points to the same backend as the Angular app!

Also notice, except for steps 4 and 5 I didn't have to touch the Backbone code!

Now imagine applying this to your project... If your requirements demand a lot of interactivity and slick UI elements, go for it! You don't even have to go fully headless if you don't want to! See the RESTful module documentation on how to expose your content and start innovating. The possibilities are endless!

Conclusion

Amitai and Josh Koenig (Pantheon), in their talk at DrupalCon LA, spoke about Headless Drupal and showed how Drupal can still be relevant in an age where client side frameworks (Angular, Ember, React, Backbone…) rule. It made me excited about Drupal again and showed a whole new way that Drupal can further "Get off the island" and start to play nicely with other technologies.

In the end, that's why I went through this exercise: To show that Drupal is a viable CMS backend for not just Angular, but also Backbone.Marionette or any other front end framework for that matter! There's a ton of front-end developers out there that don't know what Drupal is capable of. I hope that by showing how easy this was, front-end devs can see that Drupal is more relevant than ever and that it makes their life really easy. I also did this to show current Drupal devs that with Headless Drupal we can imagine displaying and interacting with our content in ways we never have before.

So who's next? React? Ember?

May 22 2015
May 22

If you are sub-theming Drupal Bootstrap, you are probably spoiled by all of the awesome functionality that comes with the Bootstrap framework and the Drupal Bootstrap theme. One place where you can’t easily throw a row and col class around your divs through the admin UI is if you are creating a Webform.

I came up with a quick solution to this that, with a little setup, allows the user to leverage Bootstrap through the Webform UI.

What we’re going to accomplish:

Let’s say we’ve built a webform like this:

default webform

However, we want the First name, Last name, Email, and Company to be in a two column layout, and Fields 1-3 to be in a three column layout below the body. Using the webform-form.tpl.php file, we will make the form look like this:

desired webform

How we’re going to do it:

If you check out the webform directory, you’ll see the default webform-form.tpl.php in the templates directory (at something like sites/all/modules/contrib/webform/templates/webform-form.tpl.php). Copy and paste this file into your theme’s directory at [my-subtheme]/templates/webform-form.tpl.php. As the tpl.php says:

<?php
  // Print out the main part of the form.
  // Feel free to break this up and move the pieces within the array.
  print drupal_render($form['submitted']);

What we’ll do is decide upon some Field Keys that will serve as the columns that will contain the fields. Then if we place fields within fieldsets given those Field Keys, they will be displayed within the column. This may not be clear until you look at the code and how it will be used with Webform. In our webform-form.tpl.php, if we use the following code:

<div class="row">
  <div class="col-md-6">
    <?php print drupal_render($form['submitted']['field_top_left']);?>
  </div>

  <div class="col-md-6">
    <?php print drupal_render($form['submitted']['field_top_right']); ?>
  </div>
</div>

And then in the webform, create two new fieldsets, Field Top Left and Field Top Right. Make sure to set the Field Key to the field name you used in the webform-form.tpl.php

field top left webform

field top left webform field key

Nest the First name and Last name fields in Field Top Left fieldset and the Email and Company fields in the Field Top Right fieldset.

nest fields webform

I’ve left the fieldset names to display so it’s more clear what’s going on here. Save and view your webform and bam your fields are now in 2 columns.

Display fields webform bootstrap

So the webform-form.tpl.php is picking up the form's Field Keys from the Webform UI that match what is in the template file, and then wrapping them with the necessary Bootstrap markup. We can follow this same pattern for the three column layout. For example in our webform-form.tpl.php, we can use this code:

<div class="row">
  <div class="col-md-4">
    <?php print drupal_render($form['submitted']['field_lower_third_1']);?>
  </div>
  <div class="col-md-4">
    <?php print drupal_render($form['submitted']['field_lower_third_2']); ?>
  </div>
  <div class="col-md-4">
    <?php print drupal_render($form['submitted']['field_lower_third_3']); ?>
  </div>
</div>

Following the pattern above, we can create 3 fieldsets with Field Keys of field_lower_third_1, field_lower_third_2, and field_lower_third_3, and then nest Fields 1-3 in these fieldsets. Alternatively, if you aren't going to add more fields to these fieldsets, you can just give the fields 1-3 the field keys field_lower_third_1 through field_lower_third_3.

three column webform bootstrap

If you’re following along, you may notice that any fields you haven’t placed in these fieldsets or given these pre-defined Field Keys are getting pushed to the bottom of the webform, regardless of how they are arranged in the Webform UI.

webform fields at bottom bootstrap

This is because anything not explicitly declared in the tpl.php is being printed at the bottom in the section that reads:

<?php

// Always print out the entire $form. This renders the remaining pieces of the
// form that haven't yet been rendered above.
print drupal_render_children($form);

?>

Right now this webform-form.tpl.php will also be applied to ALL webforms on the site. There are two ways you can go with this - if you just want to use it for just one webform, rename it webform-form-[nid].tpl.php. However, I think it’s nice for it to be available for all webforms since it’s a handy way to build forms using the Bootstrap layout through the Webform UI.

If you’re going to use it for all forms, you will probably want to wrap your columns in some logic so that the markup is only printed out if these Field Keys are being used. Otherwise you’ll get a lot of empty divs. So we’ll do that for the 2 column:

<?php if((array_key_exists('field_top_left', $form['submitted'])) ||
  (array_key_exists('field_top_right', $form['submitted']))): ?>
  <div class="row">
    <div class="col-md-6">
      <?php print drupal_render($form['submitted']['field_top_left']);?>
    </div>

    <div class="col-md-6">
      <?php print drupal_render($form['submitted']['field_top_right']); ?>
    </div>
  </div>
<?php endif; ?>

and you can see how then you would do the same for the 3 column layout. 

Now we just want to add the Field Key that will contain our Text field at the top of the page

<?php if(array_key_exists('field_top', $form['submitted'])): ?>
  <div class="row fullwidth">
    <div class="col-xs-12">
      <?php print drupal_render($form['submitted']['field_top']);?>
    </div>
  </div>
<?php endif; ?>

webform top

and the Field Key that will contain lower body field

<?php if(array_key_exists('field_middle', $form['submitted'])): ?>
  <div class="row fullwidth">
    <div class="col-xs-12">
      <?php print drupal_render($form['submitted']['field_middle']);?>
    </div>
  </div>
<?php endif; ?>

webform body

Since we only have 1 field (Body or Texfield) in our full width Field Key elements, we don’t need to use Fieldsets, but can instead just give the Body and Textfields the Field Keys that match with our webform-form.tpl.php. 

Check out the webform now, and you’ll see it’s all pretty and Bootstrap-y. Nice.

final form

Have any questions or a different solution? Leave all comments below!

May 22 2015
May 22

Last week, many of us were in sunny Los Angeles for DrupalCon 2015. Though many were seasoned veterans, it was my first time at a Con. It was a whirlwind of team building, a magical Prenote, great one-on-one coversations and plenty of Drupal talk. Needless to say, I'm still recovering! But one thing is certain, our team had a wonderful time. Here are some of their takeaways:

Mario Hernandez

Mario Hernandez - Front-end DeveloperHaving DrupalCon in my hometown of Los Angeles was great because I could enjoy the conference, meet with my friends and go home every night to my wife and kids.

I attended several sessions mostly front-end related but the biggest event for me was being able to speak at DrupalCon for the first time.  The topic was Advanced Layouts with Flexbox.

I have to admit I was concerned because my talk was scheduled as one of the last sessions of the conference right along with my colleagues Matt Davis and Jason Smith who would be talking about the front-end framework they put together for The Weather Channel.  Not to mention it was also at the same time as Dries’ Q&A session.  I was certain there will be no audience in my session.  
The time came for me to speak and I was shocked when I realized the room was almost full.  I estimated a minimum of 150 attendants in my session which completely surprised me.  I thought the presentation went well and the feedback I received was positive.  I walked out the room singing in the back of my mind the words of Ice Cube “Today was a good day!”.

Mark Casias

I had a great time in LA with all my favorite, and newly favorite Drupalists. I decided to take the twelve hour drive from Albuquerque to LA (and back) and that wasn’t as horrible an idea as I thought it would be. This was also my first ‘con with an actual supporting company, so it was fun to see the other side. Talking to people at the booth, and playing corn hole at the Mediacurrent booth was a blast. Additionally it was a lot of fun hosting the karaoke machine at the Mediacurrent after party. I would be a jerk if I didn’t thank the fine Canadians at Digital Echinda, where I won the nifty Drupal Hockey Jersey, and at Opin who is also from Canada, and gave me a TV! Of course the reason that we go there is the learning. My most memorable session was given by David Diers at Four Kitchens. His session was API Design: The Musical, which was a great primer on how to create a good program API along with his guitar and some pretty catchy, original songs. I truly hope he gets that album to drop

Bob Kepford

This is the second DrupalCon I've attended in my home state. As usually my favorite part of DrupalCon was meeting and reconnecting with people. My favorite session this year was 
Decoupled Drupal: When, Why, And How with Amitai Burstein and Josh Koenig. These two teamed up to talk about Decoupled Drupal. They offered reasons why a decoupled approach is a good idea but also why it is not a panacea. When you take Drupal's head off you lose a lot that Drupal does well. Josh mentioned several times that the Drupal has the opportunity to become one of the best backends for the hot frontend frameworks like Angular and Ember. They raised a rallying cry to Drupal developers to solve the problems that decoupled Drupal creates. Mark, Jason, Mario, and I also recorded a live episode of our podcast which was a lot of fun.

 

Damien McKenna

Having missed the past two Drupalcons, it was great to be back. My week focused around all things Panels, with a dash of Metatag and drupal.org usability for good measure. On Tuesday I lead a panel session providing a State Of The Union update for all things Panels-related. My fellow Panels-ists and I demonstrated the latest 'n greatest in the Panels world, concluding with a brief preview of things to come in Drupal 8. Later that day we had a BOF where we had a round-table discussion of how to use Panels modules and some of the pain-points ("pane-points"?) site builders experienced. On Wednesday there was a BOF on Panopoly, a customized distribution based upon many Panels modules. We rounded off the week with a code sprint focusing on stability improvements. The best part of this was getting so many maintainers and active users together to discuss our goals, pain points and how to collaborate further. It was also great to catch up with friends I'd not seen in several years and finally meeting many others I'd gotten to know via drupal.org and Twitter.

Nathan James

I have heard that it almost never rains in LA. Well, during my first DrupalCon, it absolutely rained!  Besides the water falling from the sky, it rained t-shirts, nerf guns, inspiring and informative sessions, great interactions with coworkers and the Drupal community, musical numbers, after parties, and valuable knowledge and ideas.  Being newer than most to the community, I found it empowering in the Driesnote to get a history of Drupal and a better vision of the impact this technology currently has and where it is going.  Seeing Mediacurrent give some sessions made me proud to be a part of this company.  I also appreciated the honest evaluation of Decoupled Drupal.  Going in expecting more hype talk, it was good to see Josh koenig and Amitai Burstein give a reality check, highlighting that there are many things in Drupal that we take for granted and would need to be rebuilt when using the Drupal backend with a different frontend.  Lastly, it would be simply wrong not to mention how Mediacurrent gave the most amazing after party.  Standing room only, in the loud roar of conversation and fun, you could just feel community growing and memories being made as good beer flowed and karaoke … happened.

Conclusion

Plugging into the Drupal community is a wonderful thing. Though we've wrapped up in Los Angeles, we're already gearing up for DrupalCon New Orleans! Will you be there? Laissez le bon temps rouler!

May 22 2015
May 22

Commercial Progression presents Hooked on Drupal, “Episode 9: DrupalCon LA 2015 Highlights with Steve Burge from OSTraining".  In this special DrupalCon edition of Hooked on Drupal we conferenced in Steve Burge of OSTraining for an on the ground report from Los Angeles.  Held on May 11-15, 2015 DrupalCon LA was the premiere event for the Drupal community.  Steve brings us the inside scoop of highlights and takeaways as the conference wraps up.  Additionally, Alex Fisher (also a DrupalCon veteran) shares his memories and insights from past DrupalCons.  Commercial Progression has recently sponsored OSTraining with a $5000 kickstarter backing to bring Drupal 8 upgrade training to the masses.  This new collection of video resources will be released in September 2015.  With Dries call to support Drupal as public utility from DrupalCon, this announcement seems especially timely.

Hooked on Drupal is available for RSS syndication here at the Commercial Progression site. Additionally, each episode is available to watch online via our YouTube channel, within the iTunes store, on SoundCloud, and now via Stitcher.

If you would like to participate as a guest or contributor, please email us at

[email protected]

 

Content Links and Related Information

OSTraining logo

 

Hooked on Drupal Content Team

ALEX FISHER - Founder of Commercial Progression

STEVE BURGE - Founder of OSTraining

Alex Fisher Steve

Left, Alex Fisher, founder and owner of Commercial Progression in Northville, Mich.
Right, Steve Burge of Sarasota, Fla., founder and CEO of OSTraining

Podcast Subscription

Hooked on Drupal Episode 9 - DrupalCon 2015 Review with Steve Burge of OSTraining Podcast

May 22 2015
May 22
/**
 * Implements hook_action_info().
 */

function mymodule_action_info() {
  return array(
    'mymodule_update_products' => array(
      'type' => 'entity',
      'label' => t('Update products by 2%'),
      'configurable' => FALSE, 
      'triggers' => array('any'),
      'pass rows' => TRUE,
    ),
  );
} 
 
function mymodule_update_products(&$entity, $context) { 
  $product_id = $entity->product_id; 
  //dsm($product_id);   
  $price = $entity->commerce_price[LANGUAGE_NONE][0]['amount'];
  //dsm($price);
        
  $updated_price = 1.02 * $price;
        
  $affected_rows = db_update('field_data_commerce_price')
    ->fields(array('commerce_price_amount' => $updated_price))
    ->condition('entity_id', $product_id)
    ->execute();
          
  //dsm($affected_rows);    
   
}
  
function mymodule_round_up_line_item_price($line_item_id) {
  $line_item = commerce_line_item_load($line_item_id);
  return round($line_item->commerce_unit_price[LANGUAGE_NONE][0]['amount'],-2);
}
May 22 2015
May 22

The Drupal 8 multilingual team is really great in spreading know-how on the new things in the upcoming version, so we had our session (1h) and workshop (2h) recordings published and widely available. While we of course love our baby and can talk all day about it, who has hours when they just want to explore what is coming up? We just addressed that this week with the following.

1. New 2m22s introduction video with the key benefits

[embedded content]

2. A quick summary of key benefits and an easy to skim features list

http://www.drupal8multilingual.org/#topbenefits lists the top 12 benefits and http://www.drupal8multilingual.org/features provides the more detailed information in an easy to skim text form. And yeah, that 1h session video if you have the time.

3. Easy to launch demo to try features out

Thanks to our work on the multilingual workshops for DrupalCons, BADCamp and DrupalCamps, we have a demo with sample content in 4 languages that you can try out in your browser for 30 minutes without any registration or local software install required thanks to simplytest.me.

4. Check out who voted with their feet already

Drupal 8 is not yet released, yet there are numerous live multilingual Drupal 8 sites helping with nature preservation, finding health professionals or concert tickets among other good uses. Now there is a handy list to review at http://www.drupal8multilingual.org/showcase.

If you like what you see, we still have guided workshops (those that last 2h). The next one is coming up right this Sunday at DrupalCamp Spain. We also believe that the multilingual team is one of the best to get involved with if you want to know Drupal 8 better and give back some to improve the new version as well. We have weekly meetings and a huge sprint coming up at DrupalCon Barcelona. Maybe we'll have some opportunity to celebrate as well. See you there!

May 22 2015
May 22

Years ago now, the Drupal community adopted Git as a version control system to replace CVS. That move has helped development since the distributed nature of Git allows better tracking of work privately before uploading a patch to drupal.org.

Sandbox repositories allow contributors to clone an existing project to work on independently (therefore not needing permissions for the canonical repository), but there is currently no way that I know of to request that those changes are pulled back, facilitate a review of changes and then merge the changes in (a pull request).

Hopefully that functionality is on the way!

But as a community the challenge is not just the development on drupal.org, collaboration with GitHub, or whatever form the technical change takes. Alongside those changes, we need the workflows that will help us better manage multiple versions, allow fast bug fixes whilst features are being tested, and provide for reviews without alienating developers. And the technical element goes hand in hand with the workflow.

As an example, for the Drupal PM module, we recently debated how to set up Git branches to allow more flexibility than the traditional "single line of code" inheritted from CVS.

There were a few criteria that the new solution had to have:

  • Flexibility that allowed bug fixes to be more quickly applied to a release: Under the "single line of code" approach, Releasing bug fixes only would require adhoc branches and tags.
  • Fit with drupal.org infrasturcture: In particular, we'd like users to be able to test a development version without cloning from Git. So the development release on drupal.org needed to correspond to an appropriate codeset for people to test.
  • Alignment to industry standard approaches where possible: Looking into what is used elsewhere in the software world, the Gitflow model has been received well.

Putting all of this together and discussing on Skype and a drupal.org issue, we came up with a branching model that seems to fit these criteria.

For each major version of the module (i.e., 7.x-1.x, 7.x-2.x, 8.x-1.x), we will have the following branches:

  • Release branches: There will be one release branch for each major version, named after the version (for example: "7.x-1.x"). The codebase in here will always be the release candidate for the next point release, and those point releases will always be tagged from this release branch.
  • Development branches: There will be one development branch for each major version, named "develop-[version]" (for example: "7.x-1.x"). This will effectively be a staging branch for the next release but one. Features will be merged into here, and then this development branch will be merged into the release branch when the next release candidate is required.
  • Feature branches: There will be one feature branch for each feature (drupal.org issue), named "feature-[issue]-[title]" (for example, "feature-12345-add-feature"). These will be worked on until the given feature is finished. Once completed, the feature branch is merged into the development branch.
  • Hotfix branches: There will be one hotfix branch for each bug fix (drupal.org issue), named "hotfix-[issue]-[title]" (for example, "hotfix-12345-fix-bug"). These will be worked on until the bug is confirmed fixed. Once completed, the hotfix branch is merged into both the development and release branches.

We're just beginning to use this system in entirety, and I hope that it works out.

One caveat is that the system only works for developers with permissions on the project repository. I would love for any contributor to be able to fit into this model and to have the pull request system available for the final merge... perhaps soon...

May 22 2015
May 22

Last week most of Lullabot was at DrupalCon Los Angeles. In this episode Addison Berry, Greg Dunlap, Matthew Tift, Chris Albrecht, Helena Zubkow, and Will Hetherington share their thoughts and experiences from the whirlwind of awesome that is DrupalCon. We chat about the keynotes, and the contrast between them, session picks, the coffeepocalypse, the real value of DrupalCon, and let Greg rant a bit, which is always a fun romp.

May 22 2015
May 22

If you're building a Drupal website with a lot of content for a community of users, chances are you'll need to set up some editorial controls. Starting with the Workbench and Workbench Moderation modules, you can create editorial workflows for content types. Nodes pass through different 'States', like Draft, Needs Review, and Published. Different User Roles control the flow of nodes through these different states. For example, you could create a Contributor role, who has permission to create new nodes and promote them to the Needs Review state. Content in the Needs Review state isn't published, so you could also create an Editor role, who can then promote nodes in the Needs Review state to Published, or reject nodes in the Needs Review state by setting them back to Draft. Drupal has fairly extensive documentation on working with Workbench and how to set up Moderation. 

Workbench Moderation works very well for high-level editorial controls, but if you need more granular control of your content, you should check out the Workbench Access module. For this example, we are going to enforce content moderation where only certain users can edit or moderate changes to Membership pages while other users can edit or moderate changes to Career pages. I like working with examples and screenshots (videos and screenshares make my eyes glaze over) so here is the basic setup.

We have three Content Types that we want to moderate with Workbench:

  1. Webinars: custom content type with date, time, and location.
  2. Internships: custom content type with dates, location, and description.
  3. Pages: Drupal's page content type out-of-the-box. This website has hundreds of pages, divided into many sections. For simplicity's sake, we'll just sat there are three sections: Membership, Careers, and Professional Interests.

We have three levels of access on this site:

  1. Administrators: can pretty much do anything and everything, and can publish any new content or edits to existing content without asking anyone’s permission.
  2. Content Editors: are in charge of moderating content. They are the ones who have the final say in terms of approving new content for publication, as well as approving new edits to existing content for publication. In Workbench-ese, editors can promote nodes in the 'Needs Review' state to 'Published' or reject nodes in the 'Needs Review' state by setting them back to 'Draft'.
  3. Content Contributors: can edit content, but need their edits to be approved by editors before they are published. In Workbench-ese, contributors can only create new 'Drafts' and then submit them for review by editors by promoting nodes to the 'Needs Review' state. 

These three levels of access work well for specialized content types (for example, Webinars and Internships) where we can set permissions and editorial controls globally on a content-type basis. All contributors can create new Webinars and edit all Webinars, and all editors can approve Webinars for publication. This system breaks down for the page nodes. We need a way to differentiate the editorial controls of the pages in the Membership section from the pages in the Careers section and the Professional Interests section. This isn’t something Workbench Moderation does out of the box, so we will need to add Workbench Access for this granular control of the different sections.

I'm going to skip the Workbench Moderation setup, as this was pretty straightforward and is covered already pretty well in the Drupal documentation. 

The setup assumes the following:

  • You have downloaded and enabled Workbench, Workbench Moderation, and Workbench Access.
  • You have already configured workbench (admin/config/workbench/moderation) in terms of the states (draft, needs review, published) you need.
  • You have set up permissions correctly for Workbench Moderation so the correct roles can edit and approve different content types for publication.
  • You have made sure that any content type you want to moderate with Workbench has been set up correctly (admin/structure/types/manage/[content-type). Make sure to select the Enforce Workbench Access control option.

workbench access

OK, now on to getting Workbench Access configured. 

Set permissions

Contributors need to be able to be assigned to sections and view access information. Editors need to be able to administer all settings for Workbench Access while Contributors need to be able to access Workbench Access sections. 

workbench access permissions

Also, confirm contributors and editors have necessary page node permissions - we want Editors and Contributors to be able to edit any page node. Workbench Access will then add the most granular control of which pages (Membership vs Careers) they can edit. 

workbench access node permissions

Editorial Section Taxonomy

Set up the Taxonomy you will be using for enforcing editorial controls. Workbench Access can use either Menus or Taxonomies for editorial sections, but to me a taxonomy seems more straightforward. This taxonomy isn’t used for tagging content, so doesn’t need to be assigned to any content type. You will be associating the taxonomy with the desired content types in Workbench Access. For this example, I have created an 'Editorial Sections' taxonomy with 2 terms, Membership and Careers.

Configure Workbench Access settings.

This is the first thing we'll do at  admin/config/workbench/access/settings. In this case, we’ll be using our newly created Editorial Sections Taxonomy on Page nodes.

workbench access settings

Add roles and users to the Editorial Sections

When adding roles or users to different Editorial sections, it’s important to realize that we are just assigning users to these sections - what the users can do in these sections (edit, approve edits for publication etc) is still controlled by Workbench Moderation and permissions. We’re adding a layer on top of the content moderation provided by Workbench Moderation. Add the administrator roles to all sections at /admin/config/workbench/access/roles - adding it to the whole taxonomy will then add it to all terms within this taxonomy. Click on the '0 roles' and then add all administrators and save. Back on the Roles tab you can now see one role has been assigned to all Editorial Sections.

Now we want to individually assign users to be able to edit or moderate pages in different editorial sections of the website. For demonstration purposes, I’ve created 4 users - Member Editor, Member Contributor, Career Editor, and Career Contributor. Here is how we're going to use Workbench Access:

  • Member Editor and Career Editors are both Content Editors, so can promote nodes in 'Needs Review' to 'Published.  
  • Member Contributor and Career Contributor are both Content Contributors, so can create new nodes and submit the for review. 
  • Member Editor and Member Contributor will only have rights to edit/moderate pages in the Members section
  • Career Editor and Career Contributor will only have rights to edit/moderate pages in the Careers section.

Click on the Editors tab, and then the 0 roles link next to the Membership section. Add the users in the auto-complete field and then hit save. Don't get confused by Workbench Access' terminology - when it says 'Editors' that is just the individual users who will be able to edit or moderate a section. It has no relationship with the Editors and role we have set up previously. 

workbench access add editors

Do the same for Editors of the Careers section, and you'll see now that 2 editors are assigned to each of these sections. 

workbench access editors

Add pages to sections

Now that we’ve got our Editorial sections set up and users and roles assigned to these sections, we need to add pages to these sections. Remember, we only set up the Taxonomy that will be used to divide the pages into different Editorial sections. We haven’t assigned pages to these sections yet. We can see this if we go to any of the pages on the site - they still say Editorial Section: Unassigned

There are two ways to assign pages to Editorial sections. You can edit the individual node, and select your Editorial Section in the new field that Workbench Access has added, or you can do a batch update through the Content Overview page at admin/content. After you've done that, now if you view one of the node you have updated, it should have the Workbench Access section assigned:

Confirm it's working

To make sure the controls are working the way you want, try logging in as the different editor and contributor users. You will see that the Career Editor/Contributors can only edit and moderate any nodes you have assigned to the Career section, and only the Membership Editor/Contributor users can only edit and moderate node assigned to the Membership section. 

Important note: until pages have been assigned to an Editorial Section, Workbench Access isn’t being enforced. So, if we view a page node as the Member Contributor and it says ‘Editorial Section: Unassigned’ we will be able to edit that page

Another important note: If you want to take this another step and integrate Workbench Access with rules, you will need to apply this patch (see issue https://www.drupal.org/node/1285110). This patch will then give you the ability to set conditions using Workbench Access. 

May 22 2015
May 22

Earlier this week Matt Mullenweg, founder and CEO of Automattic, parent company of WordPress.com, announced the acquisition of WooCommerce. This is a very interesting move that I think cements the SMB/enterprise positioning between WordPress and Drupal.

As Matt points out a huge percentage of the digital experiences on the web are now powered by open source solutions: WordPress, Joomla and Drupal. Yet one question the acquisition may evoke is: "How will open source platforms drive ecommerce innovation in the future?".

Larger retailers with complex requirements usually rely on bespoke commerce engines or built their online stores on solutions such as Demandware, Hybris and Magento. Small businesses access essential functions such as secure transaction processing, product information management, shipping and tax calculations, and PCI compliance from third-party solutions such as Shopify, Amazon's merchant services and increasingly, solutions from Squarespace and Wix.

I believe the WooCommerce acquisition by Automattic puts WordPress in a better position to compete against the slickly marketed offerings from Squarespace and Wix, and defend WordPress's popular position among small businesses. WooCommerce brings to WordPress a commerce toolkit with essential functions such as payments processing, inventory management, cart checkout and tax calculations.

Drupal has a rich library of commerce solutions ranging from Drupal Commerce -- a library of modules offered by Commerce Guys -- to connectors offered by Acquia for Demandware and other ecommerce engines. Brands such as LUSH Cosmetics handle all of their ecommerce operations with Drupal, others, such as Puma, use a Drupal-Demandware integration to combine the best elements of content and commerce to deliver stunning shopping experiences that break down the old division between brand marketing experiences and the shopping process. Companies such as Tesla Motors have created their own custom commerce engine and rely on Drupal to deliver the front-end customer experience across multiple digital channels from traditional websites to mobile devices, in-store kiosks and more.

To me, this further accentuates the division of the CMS market with WordPress dominating the small business segment and Drupal further solidifying its position with larger organizations with more complex requirements. I'm looking forward to seeing what the next few years will bring for the open source commerce world, and I'd love to hear your opinion in the comments.

May 22 2015
May 22

If you’re anything like me, right now you’re thinking: Finally! It’s a very exciting moment for those in our field who have craved ways to collaborate, learn from experiences and refine our craft. The Drupalcon team has heard our request loud and clear, and we can now enjoy the very first Project Management Track!

What makes this awesome news

We can finally dedicate these sessions to Project Management in its own right, instead of treating it like it’s some sort of sales or business solution that needs to be sold. Those of us in the field know this universal truth: it’s about delivery, not just sales!

Who should submit and who should attend

We want seasoned professionals to submit sessions, but anyone is welcome to attend. Sessions will assume some PM knowledge is already acquired by the audience. We only get 7 sessions, so we want to make them count!

Timeline reminder

- Submit by 8 June midnight CEST

- Selection from 8-20 June

- Sessions announced 28 June 

Do this to get your session picked

Don’t submit general project management sessions. Let’s get into the nitty-gritty. Keep the emphasis off business (eg: how to sell your estimate), and more on practice (eg: how to make your estimate). Workshops would be great for this kind of content! Do propose sessions that solve real PM problems, explore new concepts, and challenge our preconceived notions. We want the good stuff; the advice and tips that come from years of experience, and many projects under the belt. Propose a variety of content formats into the selected sessions, from workshops that focus on teaching, to case studies to panels and your more “classic” presentations.

Let’s make it happen people

Share this post! We need to get the word out!
Submit a session! You have until Midnight CEST (that’s 6pm Eastern) on 8 June 
Share your ideas! What do you want to learn from sessions? Tell us in comments
RALLY! Let’s get so much great content we will have a dickens of a time choosing!

 

Bonus: Content Ideas for you!

Back in the day, I proposed a lot of session ideas and it helped generate content, so I’m repeating the experiment! I highly encourage you to steal them, tweak them, and reinvent them -  whatever you want! I hope to inspire you to share your hard-earned wisdom, check out the list at the end of this post.

Here are a few of my session ideas up for grabs:

  • Project estimation techniques
  • Project planning tips
  • Scope and Change management and handling tough conversations
  • Risk management tools, techniques and handling frequent project risks
  • Your experiences with different PM methodologies: what worked or didn’t?
  • Fixed bids pros, cons, good, bad, ugly, how to avoid them, how to use them to your advantage
  • Managing Portfolios: how to keep track and report on what matters
  • Leadership and coordination approaches
  • Pre-sales estimation: Benefits/Risks, Tips & techniques
  • PM Tools comparison: what’s the best one? why?
  • The shift: changing methodologies, issues and advice on implementing new processes
  • Handling difficult and demanding customers who don’t know the meaning of “out of scope”.
  • Priority management and backlog grooming tips/advice/tactics
  • Defining Done: techniques to make things clear
  • Lessons Learned, Post-Mortems and Retrospectives: learning from past mistakes & successes
  • Team cohesion: staying united & motivated during tough projects
  • Authority: how to wield it without being a jerk
  • The long project: how to manage big, long, projects and how they differ
  • The big nasty: worst project you ever had, and what you learned from it
  • Difficult team members: bringing up the quality of work on projects, and dealing with
  • Drupal Risk Management: Common Drupal project risks and how to mitigate them
  • Watergile for Drupal: Hybrid PM Tips and Techniques for Agile + Waterfall Projects
  • Drupal Resources: How to PM Volunteer Projects
  • Drupal Iterations: An agile process case study
  • Drupal Estimation Panel: Tips and Techniques for Estimating S/M/L projects
  • Drupal Estimation: Did you forget something? (things we should estimate, but often don't)
  • Before You Win: Project Estimation and Assessment
  • Drupal Assumptions: Common Assumptions that Kill Projects (and how to educate your clients)
  • Drupal Project Reporting: The Good and Bad News about Reporting Progress
  • When you’re wrong: handling project estimations & assumptions that went south bigtime.
  • Turning it around: bringing projects back on track when they are off the rails
  • Drupal Projects: Good, Bad & Ugly -- what do we love and hate about Drupal projects
  • Testing: assumptions, estimations and pitfalls of drupal testing
  • Managing different kinds of projects, do some techniques work better than others?
  • How to make estimators out of developers
  • OTOBOS: umm, does it really exist across an entire project? Has anyone ever delivered every single iteration on time on budget on scope?? If not, why is that?
  • Chaos report: top contributing factors to project failure and techniques to mitigate those risks on your drupal projects
  • Do you hate agile or some other methodology? Why? What would make it “better”?
  • Best project you ever ran case study: why was it good, what worked, what did you learn?
  • Bad PM: worst mistakes you can make.

So, let’s get cracking! Submit your sessions, spread the word and come join us in Barcelona!

---------------------

Shannon Vettes
Project Management Track Chair
DrupalCon Barcelona

May 22 2015
May 22

DrupalCon LA

So I did not make it along to DrupalCon Los Angeles, but I did spend some time reading twitter, and watching the sessions online. Here are some of the sessions I found entertaining and insightful and would recommend to others.

Driesnote Keynote

Dries, as always, sets the lay of the land with Drupal. He also goes into the early days of Drupal, and how some key people he was involved with and have now gone on to form organisations that centre around Drupal.

Best quote:

Obstacles don’t block the path, they are the path

[embedded content]

No

Larry Garfield gives an interesting talk on why sometimes it is best to say NO in order to give focus to the things that actually matter.

Best quote:

Case and point, the new Macbook Airs, they say NO TO EVERYTHING.

[embedded content]

PHP Containers at Scale: 5K Containers per Server

David Strauss explains the history of web hosting, and how this is now far more complex. David is CTO of Pantheon, and they now run 100,000+ websites, all with dev + test + production environments. Pantheon run 150+ containers on a 30GB box (205MB each on average). Really interesting talk on how to run large amounts of sites efficiently.

[embedded content]

Decoupled Drupal: When, Why, and How

Amitai Burstein and Josh Koenig give a really entertaining presentation on monolithical architectures and some developer frustrations. And then introduce REST web services in Drupal 8, and how this can be used to provide better consumer interfaces for other frameworks.

[embedded content]

Features for Drupal 8

Mike Potter goes through what role features played in Drupal 7, and how features will adapt in Drupal 8 now that CMI is in. Features in Drupal 8 will be going back to it’s roots and provide ‘bundles’ of configuration for re-use.

[embedded content]

Meet Commerce 2.x

Ryan and Bojan go through 1.x on Drupal 7, and how they have chosen to develop Commerce 2.x on Drupal 8. This is a complete rewrite. The hierarchical product model is really exciting.

[embedded content]

How, When and Why to Patch a Module

Joshua Turton goes over what a patch is, when you should patch contributed modules, and how to keep track of these with Drush make.

[embedded content]

My colleague Josh also wrote a blog post on how to use Drush make.

CI for CSS: Creating a Visual Regression Testing Workflow

I topic that I am passionate about is visual regressions, here Kate Kligman goes through some tools that can help you test your site for visual changes. Tools covered include PhantomJS, SlimerJS, Selenium, Wraith.

[embedded content]

Speeding up Drupal 8 development using Drupal Console

Eduardo and Jesus give us an introduction to your new best friend in Drupal 8. Drupal console is a Symfony CLI application to help you write boilerplate code, e.g. to create a new module. Personally, I am excited for the form API generator, and the ability to create a new entity with a single command.

[embedded content]

For more information see drupalconsole.com.

Q&A with Dries

As Drupal heads down from 130 critical issues down to 22 currently, what are some key concerns by people. The questions are answered by dries, xjm, webchick and alexpott.

[embedded content]

Where can I find more videos

Don’t worry there are plenty more videos on the Drupal Association Youtube page.

If you have any awesome sessions that I have missed let me know in the comments.

May 21 2015
May 21

There’s many dirty little secrets in Drupal 7 core’s API when it comes to inconsistencies and oversights. It’s a big part of why so much care is being placed in D8 and its taking so long, because people realize this is a platform that’s used for the long haul and core decisions today will have lasting impacts a decade from now.

That said, I discovered one a year or so ago and kept putting it off, hoping it would go away on its own. Well, it hasn’t and here comes a potential scenario that I detail in an ELMSLN issue queue thread I like to call Role-mageddon. While this doesn’t just affect distributions and install profiles and features, it is a lot more likely you could run into a problem there with them; and so here we go.

Example Scenario

Site 1 (Profile A)

  • Developer Adds a Feature X that adds 2 roles
  • Then creates Views, Rules, and blocks and associates roles to access / visibility
  • Then they create Feature Y with 1 role and do the same as before

Site 2 (Profile A + the additions above)

  • Developer Enables Feature Y
  • Developer Enables Feature X
  • All access / visibility criteria of Roles / functionality supplied in Y is flipped with X
  • Oh Sh….

So What happened?

Roles in drupal are stored as id, name, weight. id is generated based on the database being incremented, so anonymous is always user rid 1 and authenticated rid is always 2. After that, it’s the wild west of whoever comes first gets the next id.

Well, if Roles 1 and 2 are created then Role 3, they’ll get ids of 3,4,5.

If Role 3 is created then Roles 1 and 2, they’ll get ids of 3,4,5 but all views, rules, blocks, anything associated to the rid identifier is now associated with the wrong role!

Without this knowledge you could have oh, i don’t know, made all your admin blocks visible the ‘bosswhopays’ role on production and not understood why ). This would also happen if your in dev and have a role that doesn’t move up to production that was created prior to the others that are about to. You move the features up, and none of the settings are kept.

So how do we avoid Role-mageddon?

Role Export adds a column called machine_name to the role table, and then uses the machine_name value to generate a md5 hash value which is used to create the rid. Then, so long as machine_names are unique, it effectively gaurentees that rid’s are unique and won’t collide with other roles that you import / migrate.

The import / export order no longer matters because they’ll always map to

Great for the future, but what about my existing site?

Role Export had support for automatically remapping the updated rid so your users roles don’t get lost, as well as the admin role variable and the permissions associated to the role. That’s great, without those this would have been basically worthless for existing sites.

What my patch of infinite lack of sleep provides, is the same exact thing but for Views, Rules, Blocks, Masquerade settings (since that has security implications and is popular) as well as a hook that can be invoked to fix your other variables like IMCE, Piwik, and LTI.

May 21 2015
May 21

Mediacurrent Dropcast: Episode 5

Our first foray into public during Drupalcon Los Angeles. Bob, Jason and Mark are live interviewing anyone who showed up to our BOF (Birds of a Feather) and gave away fancy Weekly Drop T-shirts. We also talked about our favorite sessions in this years North American ‘Con. Special thanks to Benztown Radio for the use of their equipment.

Episode 3 Audio Download Link

Participants

Bob, Jason, Mario, Mark

Show Updates:

Show Links:

May 21 2015
May 21

Javascript code

Business is keenly aware of the importance of page-load time, and its impact on conversion and search engine optimization. It’s now a priority at companies like Wal-Mart, Amazon, and Mozilla.

At Acquia, we hear about it from virtually every customer. They all want to know how our platform and services can improve the performance of their websites. How much can we speed up the responsiveness of the digital experience they are offering their users and customers.

Performance is often considered to be primarily a back-end problem, but frankly what we find after we dig through back-end code: often poor front-end optimization is the culprit and not Drupal itself.

While internet users don't have a page-load value in mind — they’re not counting seconds — they do want their content now. A content owner’s fear is that with a finger hovering over the back button, a user's brain is doing an automatic cost-benefit analysis on whether the loading content is worth the wait. If the site is too slow, they are impatiently wondering if they can get what they’re looking for somewhere else, somewhere quicker.

Its important for business to understand the impact of design and feature-level decisions on performance, and the importance of balancing a sophisticated and elegant user experience with nimble performance. As Engagement Managers, Architects, and Developers, it’s up to us to inform stakeholders of the impacts of their choices, offer compromises where we can, and to implement in smart and responsible ways. Regardless of the heroic efforts we are asked to make at the code level, we should all be able to agree on this:

Faster Page Loads = Happier Users

This article kicks off a series about optimizing the requests made by a Drupal site after the DOM loads. The goal of the series is to give site and product owners a new set of tools to evaluate their internal performance and to provide architects and developers specific recommendations. Today we’ll tackle image handling. Subsequent posts will cover JavaScript and CSS optimization, Content Delivery Networks (CDN), semantic HTML and better content selection. We’ll start with image handling because it’s low-hanging fruit and a front end swing-and-miss we often see.

Our first post is divided in two: Theme Images, the images comprised in your design, and Content Images, the images chosen and uploaded by authors, editors, and producers.

In Theme Images we cover sprites: why you should use them, how we employ them at Acquia, and some resources to get you going. In Content Images we explore how to deliver high quality images, optimized using compression and size adjustments, and how we accomplish this at Acquia. Finally, we’ll link to some additional resources.

IMAGE HANDLING

Your images need to be optimized. Full stop. Apply some lossy compression to that 50 image gallery. Dump all your theme images into one sprite file. Don’t serve a retina-quality image to an outdated smartphone. All of these impact page-load times, and we’ll touch on each one here.

Theme Images

We have the most control over theme images because the end users who create content on a site rarely need to manipulate them. Theme images don’t change much after the designer has created them. That makes them ideal for combining into CSS sprite files. A sprite works by combining all theme images into one file and using the x and y positioning values of the “background” CSS property to control which portion of the image is visible.

Sprites hold the advantage of existing in a singular file that is almost always smaller than the sum of its would-be piecemeal parts, plus it can be downloaded with a single HTTP request and cached for reuse. While nothing new, if you’re unfamiliar or need a refresher on sprites, CSS Tricks has a great introduction.

There are a lot of ways to create sprites, including manually in Photoshop. Various Ruby gems and Grunt/Gulp plugins make the process easier. Here at Acquia, we tend to rely on Compass to do the heavy lifting for our Professional Services builds. When creating sprites with Compass, you can use directories to group images that will form separate sprites. So, instead of creating one enormous sprite for all of my styles, I'll break them up into logically grouped images based on their use. These almost always end up being PNGs. When employing icons, I try to use a font-icon or an SVG icon if possible. And if you’re considering SVGs because they look great at different resolutions and screen sizes, you can sprite those too.

Content Images

Content images differ from theme images in that we as designers don’t have full control. We’re shackled to the whims of a writer or a content producer with a burning desire for that full-window 50-image slideshow. Nevertheless, we need to make sure those 50 images hit a sweet spot for size and compression. That means we’re applying an acceptable amount of lossy compression on our JPGs and sizing them to correspond with viewport size and device resolution.

We see a lot of designers and developers getting around responsive challenges by simply loading a larger image then necessary, not declaring dimensions on the image, and scaling the image using styles.

Instead, we should use our current best option, Drupal’s Picture Module. The picture module uses the (soon to be accepted) HTML5 picture element and is a backport of Drupal 8's Responsive Image module which is a part of core Drupal 8. For many, the current preferred solution is to use an image tag with “srcset” and, yes, I am aware of the ongoing conversation around Drupal 8 image handling. Presently, however, the picture element and a polyfill is Acquia’s go-to solution for responsive images. It uses the Breakpoints Module to load the correct image according to viewport size and pixel density, and adopts our defined image styles to create derivatives for different viewports.

This solution takes care of both image size and compression, doing the math to find that optimized sweet spot so you don’t have to.

CONCLUSION

Drupal can be a speedy back-end workhorse, but sloppy front-end implementations can quickly undo all your hard work. Employing the strategies I’ve outlined here can decrease your page-load times by a significant amount. Using sprites for theme images reduces the number of HTTP requests, and enables caching for future use. Drupal’s Picture Module takes the guesswork out of image delivery, optimizing with appropriate compression and size manipulation.

And this is just a start towards your faster Drupal website. In the next post in this series, I’ll show you how to optimize your javascript and cascading style sheets -- two more ways you can improve your site’s front end to create faster page loads, and happier customers.

May 21 2015
May 21

Drupal is an awesome tool for building sites! You imagine, you create and finally you publish your work online.

But, if you are asking yourself “What now? Is all the work finished?” , then this track is exactly what you were looking for.

Every site needs to be deployed, hosted, monitored, upgraded, scaled, security patched and maintained. DrupalCon Barcelona DevOps track can help you to achieve those goals and ensure the success of your site.

DevOps bridges the gap between the world of developers and operations.

Drupal development is well understood by the community - it is all about code. Writing code, implementing code, testing code, re-writing code… relax, have a drink, and do some more code.

Operations is all about looking after the systems that runs that code. Figuring out how much CPU, RAM and disk you will need to run your Drupal site, ensuring patch security, automated testing, scalability, etc - basically how to keep the site running and growing flawlessly.

In this track we want to expand these core concepts of DevOps for the Drupal community, and help both developers and operations achieve the long-lasting success of Drupal sites. If you want to share your experience submit your now.

Submit a Session

----------------------

Ricardo Amaro
DevOps Track Chair
DrupalCon Barcelona

May 21 2015
May 21

In this article, we will create a basic view to display a Drupal calendar with events.

By the end of this article, you will be able to configure a basic Drupal event calendar for your website that looks like this:

Drupal Event Calendar

In order to get started, I want you to download and unzip the following modules to your Modules folder:

1.Drupal Calendar Module (drupal.org/project/calendar)

Drupal Calendar Module

2. Drupal Date Module (drupal.org/project/date)

Drupal Date Module

Enable the modules after you are done with the downloads.

Click “Modules” on the top-level menu:

Search and enable the following modules:

  • Calendar
  • Date
  • Date API
  • Date Popup
  • Date View

We assume you already have Views module downloaded and enabled.

Let’s now create a new content type to feature the events. I will be creating two events for June – World Environment Day and Father’s Day.

Click “Structure”:

Click “Content types”:

Click “Add content type”:

I am adding the new content type as “Events”. I have given “Title of Event” as the label. Click “Save and add fields”. View the screenshot below for more info:

Under Add new field, I have provided the value “Date of Event”. Under FIELD TYPE, I chose "Date" from the dropdrown. The WIDGET field gets automatically updated with the value “Pop-up calendar”. Click “Save”:

The next screen that comes up is the FIELD SETTINGS screen. Here are the important fields you will come across:

  • Date attributes to collect: It lets you choose the attributes you want highlighted in the Date field. I have kept the values as default.
  • Collect an end date: It allows you to provide an end date for an event. I ticked the box.
  • Time zone handling: Provide your time zone. I have gone with the default “Site’s time zone”.

Click “Save field settings”:

You won’t have to do anything in the new screen. Enter content for Help text if you wish to:

Scroll further below and click “Save settings”:

Notice the newly created “Title of Event” and “Date of Event”. Click “Save”:

Let’s now create the Events! Click "Content" on the top-level menu:

Click “Add content”:

Click “Events”:

In the new page, provide the title and details about your event. I have pasted from Wikipedia for this page:

Scroll below and you will be asked to fill in the timings for the event by using a pop-up calendar:

This is how the timings for the event looks like after details have been filled:

Click “Save” at the bottom of the page:

Your event for World Environment Day has been created:

Let’s create one more event:

Click “Save” and the page for Father’s Day shows up:

Let’s now configure the calendar to show these events. We can do this by creating a View that highlights the calendar.

Click “Structure”:

Click “Views”:

Click “Add view from template” to completely personalize your view:

You will be allowed to select a template based on a pre-configured value. In this case, Date.

In the new screen search for the newly created field created above – Date of event. Click “Add on the extreme right. Refer the screenshot below:

Click “Continue” to go to the next screen:

You will be taken to the following screen. It features basic configuration for your calendar. On the top-left, you will find several buttons – Month (default), Week, Day, Year, Block and Upcoming. Clicking them will take you to similar screens. I want you to click “Save” on the top-right:

Click “View Month” as shown below:

You will now be able to see the calendar with the events featured. Clicking on any event will take you to its respective page:

We have now completed the basic configuration to enable a Calendar view with events.

May 21 2015
May 21

The Drupalcon song - with actions!

I am never missing the #DrupalCon #prenote again. So brilliant.

— Kelley Curry (@BrightBold) May 12, 2015


DrupalCon always leaves me full of energy, and Amsterdam 2014 was no exception. The three of us – Adam Juran, me, and my wife Bryn – sat together on the short train ride back home to Cologne. Some chit chat and reminiscing quickly led to anticipation of the next DrupalCon, in LA. We were excited about the possibilities of this world-class host city. The home of Hollywood, Venice Beach, and Disneyland sounded like a great destination, but after three years of co-writing the DrupalCon “opening ceremony” with Jam and Robert, we were more excited about the possibilities for the Prenote. We knew we had to up the ante, make something new and different from previous years, and LA seemed like a gold mine of possibilities.

Every DrupalCon, before the keynote from Dries, this small group has staged a “pre-note.” The goal of the prenote is to break the ice, to remind everyone present that Drupal is a friendly, fun, and above all, inclusive community. It’s often themed after the host city: in Munich, Jam and Robert taught everyone how to pour a good Bavarian beer, and brought in a yodeling instructor for a singalong (yodel-along?) at the end. In Portland we held a “weirdest talent” competition, featuring prominent community members juggling and beat boxing. Every year it gets more fun, more engaging, and more entertaining for the audience.

Learning how to pour beer at the Drupalcon Munich prenote, 2012

Learning how to pour beer at the Drupalcon Munich prenote, 2012

On that train ride home, we threw around a lot of possibilities. Maybe the prenote could be set on a muscle beach, with Dries as the aspiring “98 pound weakling.” Or the whole thing could be a joke on a hollywood party. We briefly considered a reality-TV style “Real coders of Drupalcon” theme, but nobody wanted to sink that low. That’s when the idea struck: we could do it as a Disney musical!

Part of Your World

The Prenote was Jam and Robert’s baby, though. We knew that we would have to have some absolutely knock-down material to convince them of our concept. With beer in hand, the three of us started work on Part of your world from the Little Mermaid, as the client who is excited for the worst website idea ever.

“I’ve got sliders and icons a-plenty,
I’ve got OG with breadcrumbs galore.
You want five-level dropdowns?
I’ve got twenty!
But who cares? No big deal.
I want more!”

We quickly moved on to the song for the coder who would save the day, You ain’t never had a friend like me from Aladdin. We got halfway through this fun number before we realized that the song titles alone could do a lot of the convincing. Another beer, and we had a list of potential songs. There was so much material just in the song titles, we knew that the music would take center stage.

Some of our favorite titles from this first list were ultimately cut. Maybe someday we’ll flesh them into full songs for a Drupal party, but in the meantime you can let your imagination run wild. Hakuna Matata from The Lion King was to become We’ll Build it in Drupal! The Frozen parody, Do You Wanna Build a Website was a big hit, and so was Aladdin’s A Whole New Theme.

We showed our idea to Jam and Robert the first chance we got. They took one look at our list of songs and said the three words we wanted to hear: “run with it.”

You Ain’t Never had a Friend Like Me

Forum One's Adam Juran and Campbell Vertesi as

Forum One’s Adam Juran and Campbell Vertesi as “Themer” and “Coder” at the Drupalcon Austin prenote, 2014

We divided up responsibility for  the remainder of the songs and started to experiment with the script. What kind of story could we wrap around these crazy songs? How much time did we really have, and could we do all this music? We were all absorbed in our normal work, but every chance we got, the group of us would get together to throw ideas around. I don’t think I’ve ever laughed as much as while we wrote some of these songs.

Writing parody lyrics is entertaining on your own, but as a duo it’s a laugh riot.  More than once we checked the Drupal song lyrics project for inspiration. We riffed on ideas and tried different rhyme schemes until things seemed to just “fit.”

Heigh Ho, Heigh Ho

In the last few weeks leading up to DrupalCon, Adam and I met two and three times a week for long sessions, brainstorming new lyrics. We powered through writing the script around the whole thing, and started to address the logistical problems of backtracks, props, and costumes as well.

via Mendel at Drupalcon LA. Ronai Brumett as the perfect hipster Ariel

via Mendel at Drupalcon LA. Ronai Brumett as the perfect hipster Ariel

Finally we set about casting the different songs. Adam and I had always wanted to sing the Agony duet from Into the Woods, so that one was easy. We had a tentative list of who we wanted in the other songs, but we had no idea who would be willing. All of a sudden the whole endeavor looked tenuous again. Why did we think Dries would be OK to make a joke about Drupal 8 crashing all the time? Would Jeremy Thorson (maintainer of the test infrastructure on Drupal.org) even be interested to get up on stage and sing about testing? We realized that we’d never heard these people sing karaoke, much less in front of thousands of people!

One by one we reached out to the performers and got their approval. Some of them were more enthusiastic than others. Dries replied with “OK, I trust you guys,” while Larry Garfield and Jeremy Thorson insisted on rewriting some of their lyrics and even adding verses! The day before the show, Larry was disappointed that we couldn’t find giant foam lobster claws for his version of Under the Sea from the Little Mermaid. Aaron Porter bought a genie costume and offered to douse himself in blue facepaint for his role, and Ronai Brumett spent a weekend building the perfect “hipster Ariel” costume.

When You Wish Upon a Star

On DrupalCon – Monday the day before the show – the cast assembled for the first time for their only rehearsal together. I arrived a few minutes late, direct from a costume shop on Hollywood Boulevard. Jam had built karaoke tracks on his laptop, and Robert had put together a prompter for the script, so the group huddled around the two laptops and tried to work through the whole show.

Via <a href=

Via Mendel at Drupalcon LA. The prenote cast rehearses. From left to right, Larry Garfield, Aaron Porter, Adam Juran, Jeffrey McGuire, Campbell Vertesi.

The rehearsal showed us what a hit we had created. The performers had embraced the motto: “if you can’t sing it, perform it” and they started to feed off each other’s energy. We all laughed at Ronai’s dramatic rendition of Part of My Site, and the Agony Duet raised the energy even further. It turned out that Dries had never heard When You Wish Upon a Star from Pinocchio before, but he was willing to learn as long as he could have someone to sing along with him!

via Mendel at Drupalcon LA. Aaron Porter codes with his butt - on Dries Buytaert's laptop!

via Mendel at Drupalcon LA. Aaron Porter codes with his butt – on Dries Buytaert’s laptop!

The rehearsal really started to hit it’s stride when Aaron delivered You Ain’t Never had a Dev Like Me. Aaron had never sung in public before, and we could tell he was nervous. Then the backtrack started playing with its blaring horns, and he came alive. It’s a difficult piece, with lots of fast moving text and a rhythm that can be hard to catch. Aaron launched into it with gusto. He had us in stitches when he shouted “can your friends do this!” and grabbed Dries’ laptop to start typing with his butt. When he nailed the high note at the end with a huge grin on his face, it was a deciding moment for the group.

From that moment on we were on a ride, and we knew it. Simpletest (to the tune of Be Our Guest from Beauty and the Beast) turned out to be a laugh riot, and Jeremy led us naturally into a kick line for the grand finale. We cheered Larry’s choreography skills during the dance break of RTBC, and Ben Finklea was a natural (as ever) at leading us all in Commit, to the tune of Heigh Ho from Snow White.

Forum One UX lead Kristina Bjoran, had protested the most of everyone about having to sing, but the moment she started with our version of Let it Go from Frozen, we were caught up in the feeling of it. I don’t think anyone expected the goosebumps that happened when we sang that chorus together, but we all appreciated what it meant.

Let it Go

The morning of the show saw the whole cast up bright and early. Though we joked about doing a round of shots before going on stage, no one seemed nervous. In fact we spent most of the setup time laughing at one another. Larry discovered that he has great legs for red tights. Aaron got blue face paint everywhere. We cheered at Jam and Robert’s Mickey and Minnie costumes, and laughed at Ronai’s perfect Hipster Ariel.

Some of us had last minute changes to make: Jeremy spent his time crafting oversized cuffs for his costume. I had forgotten the belt to my ninja outfit, so we made one out of duct tape. Kristina discovered that her Elsa costume limited her movement too much for the choreography she had planned. Dries was the only one who seemed nervous to me – this guy who has spoken in public countless times was afraid of a little Disney! We sang through the song together one last time, and it was time to go on.

via Mendel at Drupalcon LA. Jeremy Thorson leads the

via Mendel at Drupalcon LA. Jeremy Thorson leads the “Simpletest” song. Behind him, from left: Campbell Vertesi, Ronai Brumett, Adam Juran, Aaron Porter, Dries Buytaert

Everyone knows the rest – or at least, you can see it on youtube. What you probably don’t know is how hard we all laughed as we watched the show backstage. Even knowing every word, the energy from the audience was infectious. In the end, there’s nothing quite like standing in front of three thousand people and shouting together: “we come for code, but we stay for community!”

Previous Post

Evolving the Nation’s Report Card – A Study of Designing New Reports

May 21 2015
May 21

Broken links suck. It's incredibly frustrating to read a great article that links to an external resource that covers a subtopic in detail only to find the link is broken. In that moment I curse whatever developer or webmaster of the external site didn't think that creating a 301 redirect was worth the effort. I end up going to the root domain to hunt for the article by topic, hopefully the link text or URL slug gives enough topic or keyword clues to find it. Sometimes the external resource is gone completely and then I'm off to Archive.org to try to find a cached copy.

You know what's worse than a broken external link for your Drupal site? A broken internal link.

A broken internal link is a slap in the face for user experience. You didn't create a 301 redirect from the old URL to a relevant new URL. You didn't update the link you have control over. Do you care about your reader's experience at all? I want to help you prevent broken internal links in your Drupal sites and show you a process to automate link updates. Don't slap your users, follow this process!

What are internal links

Internal links are simply links which are to URLs on the same domain or website. For example, this is an internal link to our Drupal CMS guides. The link is to a page on the Daymuse.com domain from a page on the Daymuse.com domain. We have full control over both the link href (an anchor attribute which creates a hyperlink, the link destination URL) and linking page. The opposite, external links, are simply links to a different domain. You don't have any control over the link destination.

Why internal links are important in Drupal

Inbound links (external links on other sites to your site) are important to build domain authority for SEO, improving search rankings. Similarly, internal links help create content relationships within your site and give context to content through their link text.

Sidenote: Search engines account for internal link anchor text. Ideally, you don't want anchor text to simply say "click here", "more", or some other non-contextual, non-descriptive anchor text.

How to create internal links in Drupal body text

The primary way you'll create Drupal internal links is through body text on pages. More than likely, your WYSIWYG offers a link button that'll pop-up a dialog to input a link URL. This gives you a few methods to create internal links.

Absolute internal links

If you create a link with a fully qualified URL (the complete http(s)://subdomain.domain.extension/page-name), that's an absolute link. No part of the link is "variable", its destination will forever be the exact URL you've input. If any part of the destination URL were to change in the future, your absolute links will become broken. You'll need to manually update them.

Relative internal links

You can create links that are relative to the linking page. There's a few methods of creating these relative internal links.

If you were to simply add the href of "page-name-2" to a link from a page at this URL:

http(s)://subdomain.domain.extension/topic/page-name

The href would be relative to the current location and so the link will actually go to:

http(s)://subdomain.domain.extension/topic/page-name?-2 

The link destination will retain the depth, and target a sibling page ("page-name-2" within /topic/).

You could also link to a page on the current domain from the top level by using a leading forward slash. If your link href was set to "/page-name-2" in the above example, with a leading forward slash, your destination would become: 

http(s)://subdomain.domain.extension/page-name?-2

The forward slash causes the hierarchy to collapse, leading from the top level domain: "/topic" is dropped.

There's some additional advanced methods of creating internal links in HTML documents, but this should give you an idea of how they work. In essence, they create variables so that your links will work when certain conditions change. If your domain name were to change but your content hierarchy remained the same, your relative links would still have destinations that match your hierarchy and become relative to the new domain name. This gives you more flexibility than absolute internal links, but it's still not the best method.

Canonical internal links

Drupal's internal URL scheme creates canonical locations for content. These are the "non-pretty" URLs. Drupal's node system is reflected in these internal URLs:

http://www.domain.com/node/<nid>

In this scheme, the <nid> represents the internal node ID (a unique identifying integer) for a particular piece of content. This works similarly for Drupal's taxonomy and term system:

http://www.domain.com/taxonomy/term/<tid>

The <tid> is the term ID, identifying a taxonomy term. Using our example above, this is the canonical URL to our Drupal CMS guides:

http://www.daymuse.com/taxonomy/term/23

The "Drupal CMS guides" term ID is 23. If you inspect or hover the actual link above, you'll see that the URL is pretty, human readable:

http://www.daymuse.com/guide/drupal

We've setup Drupal to have an alias for "/guide/drupal" to display our "Drupal CMS guides" term. Drupal creates these pretty aliases by default ("clean URLs"). 

However, this is the literal HTML code that Drupal stores for that body text internal link:

<a href="http://www.daymuse.com/guide/drupal">Drupal CMS guides</a>

This is a relative internal link to a canonical URL. Our WYSIWYG is configured to translate these internal canonical URLs to their pretty aliases on the fly. This takes care of multiple issues:

  1. If we were to decide to change our domain or store this blog post on a subdomain, the relative link would automatically reflect the domain change
  2. If we were to alter the alias from "/guide/drupal" for this particular term to "/guides/cms/drupal", the canonical URL would point to the appropriate pretty URL

This works the same way for nodes: if we link to their canonical URL and their alias is updated, Drupal will automatically translate the canonical URL to the new pretty URL on the fly. Tracking down the canonical URL manually for each internal link can be a pain, though. We're getting to automating the internal link creation process, but first let's make sure we understand why it's important.

Why creating Drupal canonical internal links is important

As your Drupal website develops, you'll undoubtedly create more content: more nodes, more terms. You'll also come up with new URL strategies and ways to classify your content through the pieces of your URLs. Perhaps you'll decide to add a portion of the date within the URL, maybe a category the content resides in, or you just want to manually alter a piece of content's URL to make it shorter or better reflect the contents. This will happen over time. When it does, you don't want to either have to go back and update all your internal links to reflect the change, or even worse, cause broken links and leave them broken. Broken internal links will degrade your search engine performance two ways:

  1. You'll lose the internal link anchor text context and relationship between pages
  2. Search engines will devalue your content due to having broken links

Don't cause broken internal links. You have full control over fixing them and implementing a strategy to avoid them in Drupal. Let's automate the process.

Drupal Internal Link modules

What we want to do to automate internal link updates is simply make sure that all of our internal link destinations (hrefs) are to canonical URLs wherever possible. You can do this by tracking down the internal path and ID of every term or node you want to link to. That requires a lot of extra effort. There's a better way. Thankfully, Drupal's community of contributed modules comes to the rescue.

Drupal WYSIWYG Module and editor plugin (TinyMCE, etc)

If you're using the WYSIWYG module plus one of the editor plugins it supports, your best bet is the LinkIt module. LinkIt provides a button in the WYSIWYG and a dialog to search for content on your site to link to. Once you click the LinkIt button in your WYSIWYG, it's just a matter of following the prompts to create internal links:

Creating Internal Links in Drupal with LinkIt

LinkIt will automatically create your link with the relative canonical URL. You don't have to hunt down the content ID or fuss with the HTML of the anchor.

Drupal CKEditor Module and CKEditor Link Module

All of our Drupal projects now utilize the CKEditor module for a WYSIWYG. This is the direction Drupal 8 has gone and so we try to make sure the eventual progression will be seamless for our Drupal services clients.

The CKEditor module has an extension or submodule that performs similar work to LinkIt, the CKEditor Link module. This allows you to use the lovely CKEditor WYSIWYG to create internal paths quickly. We love it.

After following the module instructions to setup and configure CKEditor Link to work with CKEditor, you'll have a simple process to creating internal, canonical links. This is our internal link workflow using CKEditor and CKEditor Link modules:

CKEditor Link Workflow Internal Path Process How To

  1. Select the anchor text you wish to use in the WYSIWYG
  2. Click the CKEditor Link button
  3. Make sure the "Link type" in the dialog is "Internal path"
  4. Start typing the title of our content in the autocomplete text input, select the right suggestion

This process creates a link to the internal canonical Drupal path to the content.

CKEditor Link creates internal Drupal paths

If you ever change your domain or alter the destination page's alias pattern, this internal link will still work. Combining CKEditor and CKEditor Link modules is our favorite way to handle internal path and link creation within Drupal.

Checking for broken internal links

Now that you have a process to create proper internal links (if you haven't, make changes now), you may need to check for any broken internal links. Drupal offers an excellent module for broken link checking, but first let's look at Google's Webmaster Tools. The free tool offers excellent insight for broken links.

Using Google Webmaster Tools to check for broken internal links

You do have a Google Webmaster Tools account, right? If you don't, sign-up. If you're a manager or webmaster, ask your developer to follow these steps to check for broken links. It's quick, easy, and free. This is a great way to fix search issues, raise your ranking, and properly distribute your internal traffic. Don't slap your users with broken internal links.

After logging into the Google Webmaster Tools (GWT) and selecting your domain, find your broken internal links this way:

Use Google Webmaster Tools to find broken links

  1. Expand the "Crawl" menu
  2. Select "Crawl Errors"
  3. Select the "Not found" tab

This will provide you with a list of URLs with problems. You're interested in those that aren't found (404 errors). The URLs listed tell you which URLs Google has stumbled across and received a 404 error. These are great candidates for creating 301 redirects to the right, or at least relevant, content on your site. What you really want to check for though is where these broken URLs are linked from. Are they your own internal pages? GWT to the rescue again! Click any of the URLs listed:

Find the source of broken internal links with Google Webmaster Tools

The pop-up dialog will indicate the broken URL and where it is linked from. Go to those pages and fix your broken internal links.

Automate broken link checking in Drupal with Link Checker module

If you've got a large Drupal site, manually checking GWT for broken links may not be the most effective way to find them. Drupal's Link Checker module will automate this process for you. Setup the module and it will scan your new and existing content for links, follow them, and identify any problems with them through their HTTP status code. Fix any 403s or 404s! The Drupal Link Checker module works with both internal and external links.

Why are internal broken links bad for your Drupal site?

Search engine spiders or crawlers are very busy workers. There's an entire web worth of pages to crawl and re-crawl. When they run into a broken link, they may stop where they are and move onto the next page. Broken links are a negative signal to search crawlers. Don't give them a reason to devalue your page.

I'm sure you've run into a broken link or two in your life while reading a page on some website. I bet it may have tempted you to stop where you are on the page and try to find a more authoritative, updated page about what you were reading. If the page owner hasn't checked their content over time to verify the links work, what's to say the content is still accurate? Not only do broken links discourage search engines, but they discourage users. It's especially embarrassing where the links are internal because the webmaster has control over both the destination page and the linking page.

Broken internal links can easily be avoided. Create a workflow to utilize canonical, relative internal links. Automate your internal linking process as much as possible by following the steps above. Identify any existing broken links with GWT or Drupal's Link Checker module and setup a process to routinely check for broken internal links. Make sure to create 301 redirects if you update existing content paths to prevent external sites from linking to now nonexistent paths. Don't slap your users with broken links, they're quick to fix!

This post was inspired by reading Mike Gifford's spring cleaning tips for Drupal sites, be sure to show your Drupal site some love with routine maintenance! Did you like this article or know someone that needs some link workflow help? Share it! If you're still having trouble getting your links in order, you can hire our Drupal team!

Pages