Once you have discovered the physical facts of a situation, all that remains - no matter how improbable - is more interesting.
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
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.
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.
— 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.
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
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.
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.
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!
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.
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!”Photos via Mendel at Drupalcon LA, and from the Drupal Association Flickr page.
Internal link tutorial to use modules to automate your Drupal internal paths in WYSIWYG or CKEditor. Find existing broken links with Link Checker module.
This module allow you to translate commerce products.
You need it if you have multilingual site with e-commerce via commerce module.
For using it you should already have installed the following modules:
Drush Download File is a drush plugin that allows you to download files and place them in locations. This is behavior similar to what a make file can provide except you won't need to write a make file in order to get a file and put it in the right place.
Drupal Association News: Sponsored Post: Reclaim Control of Your Server, Running Drupal on a Freedom Host
This article was submitted by our Premium Hosting Supporter Linode.
We’ve all experienced these before: slooow server hardware; unlimited disk space that is capped once you begin to actually fill it; local directory software installs because you’re not allowed to alter the root system. Managed hosting emerged to help solve these problems. And it did - but sacrificed the true power of a host’s infrastructure. Fortunately, an alternative exists that overcomes the deficiencies of both shared and managed hosting. I call it a “Freedom Host.”What is a Freedom Host?
A Freedom Host respects your needs and creativity. It gives you full root access to the server leaving you with the most powerful processors and lightning-fast, solid-state storage.
Why choose a Freedom Host?
“Getting off the Island.”
This counters a long-standing community practice of exclusively using Drupal. We now see large opportunities in combining Drupal with other powerful auxiliary software. Managed providers have long offered users click-to-deploy for Drupal; but where’s the Node.js button? HA Proxy button? Split-DNS? Magento? These options don’t exist on a managed host.A Freedom Host allows you to run what you want when you want.
Security is a priority when running your Drupal website, right? You verify file permissions, sanitize all site forms and enforce strict password rules to protect against risky Internet traffic. But what about protection from other websites on the same server? What about local containers running on the same private subnet as your own? A Freedom Host, whether dedicated or VPS, offers you greater security than what’s provided through today’s shared-hosting or containers.How do I get Managed comfort with Freedom’s power?
Drush – You can install Drush in seconds with full functionality on any Freedom Host.
Control Panels - While many Freedom Hosts provide you with a remote terminal to get started, you can install and run the GUI you want, not just what you’re limited to.
Backups & Monitoring - Any reputable Freedom Host provides a backup solution but additional options are limitless. Save your Drupal site as a tarball, dump your MariaDB/MySQL database or mirror to an external slave server. You can even image the entire server to backup or test locally in VirtualBox. System metric software, including Longview, New Relic or Piwik, measure, graph and store server traffic.So, what can I do with all this Freedom?
While impossible to compile a full list, some interesting Drupal projects I’ve seen include:
- swapping out “Zen” PHP for Facebook’s HHVM for speed improvements in Drupal 8
- testing Drupal 8 using PHP7
- compiling Nginx to include custom features for Drupal
- custom compiling a kernel for improved performance.
A Freedom Host provides options when choosing what and how you run your Drupal website. Options aside, a Freedom Host is more powerful and less expensive than most managed providers. You can’t lose with Freedom.
This article was written by Ricardo N Feliciano. He is currently a Developer Evangelist for Linode, and is an Information Systems Technician in the U.S. Navy.
DrupalCamp St. Louis is scheduled for June 20-21, 2015, and will be held at SLU LAW in downtown St. Louis, MO. Less than a month away, there are a few important bits of news:DrupalCamp STL.15 Keynote Speaker: Alina Mackenzie (alimac)
Alina Mackenzie is a developer and system administrator based in Chicago. In the Drupal community she is a camp organizer, speaker and communications lead for DrupalCon mentored sprints. She is passionate about learning organizations, automation, and making open source friendly for beginners.
Alina's keynote will focus on "Finding the entrance: Why and how to get involved with the Drupal community".
Alina's Drupal.org profile is https://www.drupal.org/u/alimacSession Submission Deadline: May 29
Please submit your session proposals by Friday, May 29—just over a week from today! We'll notify speakers on June 5th whether a session was accepted or not.
We hope to see you at DrupalCamp St. Louis 2015! Registration will open next Monday, and sessions will be announced on June 5th.
It is one thing to be brought into a project as a team player, where the project is managed or you are delivering a predefined piece of it. However, that is typically not the way things happen when doing work for a small business or an initial project which will result in a business launch.
The more challenging and demanding opportunities for a freelancer are those one-man top-to-tail projects: creating the whole megillah. Here is a brief look at the steps that could give the poor shlub a fighting chance.
- Initial Meeting: The client transfers his vision to you. Determine what specifically makes or breaks its success.
Output: Management Summary: Mirror the client’s vision back to him in your own words, for validation.
- Reference site(s): Ask the client to point to sites exemplifying functionality that works and functionality that doesn’t.
Output: Create a spreadsheet that will contain a row for each function, and identify that function as either a launch requirement, nice to have for launch, post-launch, or unneeded.
- Conceptual design: Using the approved spreadsheet, decide what the site will look like.
Output: Some conceptual prototype, such as wireframes, storyboard, etc.
- Functional design: The details behind the elements of the conceptual design; how front-end elements should work, as well as the back-end functionality, business rules, and the seemingly small details (being able to print receipts with a receipt printer, accepting input from card-swipers, syncing with third-party applications, etc).
Output: Functional design document.
In Drupal 7, a hook_node_access implementation could return NODE_ACCESS_IGNORE, NODE_ACCESS_ALLOW and NODE_ACCESS_DENY. If any of them returned NODE_ACCESS_DENY then access was denied. If neither did but one returned NODE_ACCESS_ALLOW then access was allowed. If neither of these values were returned by any implementation then the decision was made based on other rules but at the end of the day some code needed to grant access explicitly or access was denied. Other entities didn’t have access control.
Imagine this scenario. You add three different blocks in your footer region and the mockups call for them to be side by side. Here are 3 ways to accomplish this:Regions
Using regions, we could add and create more footer regions and call them Footer first column, Footer second column, third and forth just like in bartik theme. I personally don’t like this solution because what if we decide in the future to only have 3 columns instead of four? Then we will need to remove regions and change the css, clear the cache etc.. not ideal.CSS
Another way to do this...
Normally, I would do this video style, but I'm a wildcard people and today we write!
At Drupal Camp London 2015, I spoke with Piyush Poddar, Director of Drupal Practice at Axelerant. We talked about Piyush's history in Drupal, Drupal as a business-ready solution, India's coming of age in open source culture, and how that is driving business value.
This module generates breadcrumbs by combining the menu trail of a OG Content node's OG Menu entry with the node's OG Group menu entry.
Basically this module takes a node and cleverly climbs its menu structure, factoring in an Organic Group's menu too.
Did you have a great time at DrupalCon Los Angeles but want something to show for it?
We are happy to issue a certificate of attendance in PDF format for anyone who picked up their conference badge or signed in at a training.
Simply submit your request via our contact page with the subject "Request a Certificate of Attendance", and be sure to include the associated order number.
This module allows a user to switch between Mobile Version & Desktop Version using ThemeKey.Dependencies
How would you like to present at one of the largest PHP conferences in Europe? DrupalCon Barcelona is coming, and we are actively looking for sessions for our new PHP track.
Unlike the Coding and Development track, the PHP track is all about the larger PHP community. We're not looking for Drupal-specific talks but for sessions about PHP itself (PHP 7 anyone?), about related PHP tools like Guzzle, general PHP leading practices, software architecture, and so on.