This past weekend (April 13th & 14th) was the 2nd-annual Frontend United Conference. Last year it was held in Amsterdam — this year in London (at a hip, laid-back venue called Cargo). And as the Brits would say: It was brilliant!

Frontend United is geared towards frontend devs looking to sharpen their theming skills and learn new technologies in the frontend world of Drupal.
The conference has a different feel than a typical DrupalCon, despite a similar scheduling format. Because the event is smaller and narrowly focused, attendees share many interests and questions pertaining to their jobs. The talks are extra-relevant and timely. And because the conference is tailored to a very specific type of "Drupalista," the sessions are more conceptual, innovative, and advanced.
The following images are a few nice visuals taken from the conference:

Above, Lewis Nyman begins his presentation on Responsive Web Design, during which he suggests, "Split individual page design into manageable areas: layout, content, and aesthetics."

This dark and moody shot is from @MortenDK's "Angry Themer" session, although Morten admits he has become less "angry" with the introduction of Twig in Drupal 8. Yeah, it is going to be THAT awesome. :)

Here, Leisa Reichelt shares the workflow changes she's instated during her career working alongside organizations to help improve their online customer experiences. This session was especially inspiring as she made some excellent, real-world cases for re-evaulating your company's current project processes. She concludes a frontend developer can be a real asset to an information architect during the wire-framing and design phase.
And just for fun, here are a few more photographic take-aways:

Rosemary Lane, a fantastic dining experience and Saturday evening full of wonderful company and new friends.

Graffiti outside Cargo — the full text reads "SCARY." :)
For more pictures of the weekend make sure to check out the Flickr-set, while other media of the event can be found here. And for any news related to next year's conference... I suggest you keep an eye on the Frontend United website.
We're happy to announce the launch of a new client project: Switzerland Global Enterprise.
Despite the successful partnership we have barely shed any light into the work we have done for this great organization. Formerly known as OSEC, the organization represents the interests of Switzerland's export industry, import program and in a third function manages the country's location promotion efforts. In order to streamline the public appearance of these units, the organization opted to rebrand.
From a technical point of view the trusted foundation of Drupal 6 only underwent minor changes, since the focus of this release lays on the necessary adjustments to meet the organization's new corporate design.
Since the page's initial release, a blog with enhanced community features, it has grown to handle 35,000 nodes in four different languages. In the meantime it has incorporated the organization's old web site in order to become their main presence on the world wide web. This makes Switzerland Global Enterprise the perfect show case to illustrate the versatility which Drupal possesses.

(Screenshot: The Jungle Book, 1967. [Film] Directed by Wolfgang Reitherman. USA: Disney)
A while ago we wrote about the Drupal 6 modules you really need. Since that post a few things have changed, on one hand Drupal 7 has moved a bunch of those modules to its core, while on the other hand some were replaced by better alternatives.
Of course every Drupal site we build has different requirements, which makes our choice of contributed modules unique for every project. Nevertheless here is our current selection of trusted Drupal modules we don't want to miss. The bare necessities, if you will.
Internationalization & Entity translation
Working in a country, that has four officially recognized languages and English being the Internet's lingua franca, we install these modules without thinking anymore. Multilingual solutions have come on leaps and bounds since previous Drupal releases and despite not being perfect yet they make our lives much easier.
Pathauto
Regardless of how much attention you want to give to search engine optimization in a project - getting the basics right is essential. Pathauto enables you to create URL patterns for all entity types. The Pareto principle will thank you.
Views
This is by far the most powerful module in the Drupal ecosystem. Built on the Chaos tool suite (ctools), it gives the full control to display any kind of entity in the manner you want it. No wonder it will be part Drupal 8's core.
Devel
If you are a developer this one can help you out of the odd pickle. It allows you to gather information on what is happening in Drupal's background. Just remember to disable it on productive environments.
Wysiwyg & CKEditor
Until the day arrives where everybody is a HTML wizard, WYSIWYG editors will remain a feature, which just belong to every Drupal installation.
Google Analytics
The quickest and easiest way to make your websites visits quantifiable. You can only manage what you can measure.
Panels
Need a complex layout on the quick? Panels will be your trusted friend. You can define layout templates and define in which contexts they should appear.
Display Suite / Panelizer
Depending on the level of complexity of our brief we will opt for one of these two masters of data display control. Although both have their pros and cons we tend to use Panelizer more often, since it's benefits can be leveraged on large and complex websites.
Rules
An amazing module, built upon the Entity API, which allows you to define workflows and actions while you barely have to write any code. It integrates into many modules witch makes it a powerful and useful resource.
Webforms
You can argue that allowing visitors to create nodes with appropriate field permissions can act a contact forms - we have seen this approach in the wild... In our opinion using the Webforms module is the better option for the majority of use cases where a form is needed. You don't want your content overview screen cluttered with spam that got through Mollom's net, right?
What do you think? What are your bare necessities?
If you’re adding JavaScript to your custom module it is very easy and tempting to simply add it like this:
jQuery(document).ready(function($){
alert(‘hot dog flavored water’);
});
Now this code works perfectly fine but what if your JavaScript needs to be executed on page load and after an AJAX request? Imagine you have a view that uses “Views Infinite Scroll” and you want add a CSS class to every result like this:
jQuery(document).ready(function($){
$('.view-display-id-page .views-row').addClass('fancy-pants');
});
This will work for the results that are displayed initially but for all the results that are loaded by Infinite Scroll's AJAX call the class is not added. That’s where Drupal behaviors come in handy. The behaviors will be executed on every request including AJAX requests, so let's do the equivalent of the code above but this time using this method:
Drupal.behaviors.infiniteScrollAddClass = {
attach: function (context, settings) {
$('.view-display-id-page .views-row').addClass('fancy-pants');
}
};
I admit that was quick - so here are some explanations:
- infiniteScrollAddClass: This is your namespace and should be unique. For example, this is typically the name of your module, but it isn't mandatory.
- context: This is actually really really cool, on page load the context will contain the entire document and after an AJAX request will have all the newly loaded elements. This way you can treat content that is loaded in via AJAX differently than others.
- settings: This contains information passed on to JavaScript via PHP, it is similar to accessing it via Drupal.settings. For further comprehension I recommend this source.
There obviously are cases where some functionality should not be executed on every request. In such a case its great to use jQuery's .once() method. So let's say we want to give all the initially loaded results in our view an additional class, for something like this we would proceed like so:
Drupal.behaviors.infiniteScrollAddClass = {
attach: function (context, settings) {
// these are the elements loaded in first
$('.view-display-id-page').once(function(){
$(this).find('.views-row').addClass('i-was-here-first');
});
// everybody
$('.view-display-id-page .views-row').addClass('fancy-pants');
}
};
This will add the class “i-was-here-first” to all the view results present on page load, everybody else joining in via AJAX will just get the “fancy-pants” class.
So that’s a quick look at Drupal behaviors, if you haven’t used it do use it!
If you are looking for additional theoretical insight into this topic I can recommend these two sources for further reading:
- The Drupal JavaScript API (for Drupal 6 but explains it very well and mostly also applies to Drupal 7)
- Managing JavaScript in Drupal 7
Alpine Select, one of our latest releases, was built for the eponymous and publicly listed investment company in co-operation with Christoph "Laser" Jaggi. He chose Amazee Labs as development partner and signed himself responsible for the requirement engineering and project management.

The Drupal 7 combo might look "modest / conservative / business / discreet" at first but do not make the mistake to judge the book by its cover. The system is fully stock exchange compliant and takes the reporting duties to the edge with Twitter as an integral reporting channel. Read more about IT and SIX Swiss Exchange compliance in today's article on Inside IT. The new web presence consists of the following major requirements:
- Display of the company profile
- Automatic provision of the reporting infos, required by law, to the Swiss Stock Exchange Authorities. (e.g. Ad hoc release in compliance with SIX)
- Generation of printable Monthly- and Quarterly Reports.
- Provision of financial data to current and potential professional investors. (e.g. Performance charts)

While working on LikeMag, one of our most recent releases, we were confronted with a challenge: loading ads during a Drupal AJAX (Asynchronous JavaScript and XML) call. This is how we solved it.
The issue
By definition synchronously loaded JavaScript can only add objects like files, content or ads to a page's structure until it is entirely rendered. An additional complexity that can occur while working with third-party advertising providers is that you can not control the performance of their infrastructure. Which means either you accept this risk or try finding a way to mitigate it. We went for the latter.
At this point it is important to stress that it is common practice for third party ads to use the document.write method which only works for the synchronous loading approach. To learn more about the synchronous and asynchronous loading of remote tags I suggest you read the article "synchronous vs. asynchronous tags - what’s the big deal?" on the krux blog. In our case however it became apparent that our solution had to include the asynchronous approach.
While researching possible solutions I found the following tools:
The issue with the the majority of them were, that active development or support wasn't visible, except for PostScribe. This solution offers the following features:
"Krux PostScribe enables the type of tag execution required by most ad formats in an easy-to-use-and-deploy format. It leverages innerHTML to ensure reliable, fast ad delivery."
"Unlike other innerHTML-based solutions (e.g., writeCapture, ControlJS, and OpenTag), Krux PostScribe seamlessly enables the “immediate writes” upon which most ad formats depend."
Which in plain English enables the quick rendering of the page to the user and allowing the ads to respond in their own time without reducing the user's experience.
How to use PostScribe
Download PostScribe directly from its github repository.
Include these files in your project:
/htmlParser/htmlParser.js /postscribe.js
Here is a small example:
<div id="myAd"></div>
<script type="text/javascript">
$(function() {
postscribe('#myAd', '<script src="remote.js"><\script>');
});
</script>Our use case
As mentioned in the introduction this solution stems from LikeMag which, besides utilizing PostScribe, is a responsive website and uses the Isotope library to arrange items over the screen automatically depending on the viewport.
Since there are no free lunches on the web, LikeMag has to monetize too and one of their models is built around ads. So in order to deliver the perfect balance between content and ads for every viewport, we had to find a way to render the perfect amount after the identification. And that is moment the where PostScribe comes into play.
Instead of injecting the ads right into the Drupal view and slowing down the loading of the rest of the page, we just print the standard items. In a next step the system iterates over the items and adds the appropriate amount of ad containers to the content with jQuery. (These containers can be addressed with PostScribe, because PostScribe works best when the DOM is ready.)

"But where is the AJAX you mentioned in the title?", I hear you cry. So let's talk about it right now. When we scroll down on LikeMag, which besides being responsive is a smart infinite scroll site too, new items will be loaded through an AJAX call. So here we can use PostScribe as we did before. The only thing that we have to check, is that we do not add ads to already "adified" content. In our case we can check if the view-item was already processed by Isotope.

See the code as an example:
Drupal.behaviors.ViewsLoadMore = { attach: function(context, settings){
if ($(context).hasClass('view')) {
$isotope = $('.view-id-articles .view-content');
$isotope.isotope('insert', $('.view-id-articles .view-content .views-row:not(.isotope-item)'), function(){
isotop_load_more_init(settings);
Drupal.behaviors.advertisment.loadads()
});
} else if ($(context).find("html").length == 1){
// If it contains html, it is the first behavior call.
isotop_load_more_init(settings)
}
}
}
loadads: function(){ $('.view-articles .views-row.views-row-ad').once('postscribe',function(){
if(typeof(cachebuster) == "undefined"){var cachebuster = Math.floor(Math.random()*10000000000)}
if(typeof(dcopt) == "undefined"){var dcopt = "dcopt=ist;"} else {var dcopt = ""}
if(typeof(tile) == "undefined"){var tile = 1} else {tile++}
var string = '<scr'+'ipt src="http://ad-emea.doubleclick.net/adj/likemag.ch/;' + dcopt + ';tile=' + tile + ';sz=300x250;ord=' + cachebuster + '?"></scr'+'ipt>';
postscribe($(this), string);
});
}
As you can see we process only the newly loaded items from the Drupal view and exclude the already processed items.
With this solution we are very flexible to deliver the page content as fast as we can while not depending on the speed of an ad-provider.



LikeMag, our youngest client release, has hit the web and is ready to receive YOUR contribution. It is a platform for sharing the best and funniest social media content that you can find out there. Just post your gems on the LikeMag page and add to the commons of endless amusement, infinite scrolling functionality included.
We've been big cheerleaders for Omega as a responsive base-theme for Drupal for a while now… since around the time of DrupalCon London. And although the community has HUGELY embraced Omega… making it the second-most-installed Drupal theme after Zen, there has always been a bit of controversy surrounding Omega 3 in terms of how it approached responsive web design.
Some of those critiques included:
- Omega 3 was more "adaptive" than truly responsive (due to the definition of set breakpoints based on device widths).
- Configuring Zones and Regions was confusing and laborious.
- Omega 3 did not take a mobile-first approach.
The good news is that Omega 4 has addressed these issues of its predecessor head-on. In fact, Omega 4 looks quite a bit different than Omega 3.
If you're more of a skimmer, here's a quick overview (in list-form) of how Omega 4's changed:
- Zones & regions: GONE
- SASS out of the box
- A new (pluggable!) layout & grid system
- Optional polyfills for CSS3 & HTML5 support in older browsers
Zones & Regions
For starters, zones and regions have been totally abandoned. There have been many folks who have tried to explain how to wrap your head around how to configure these things. Remember this screen?

Well, no more. Omega 4 has gone back to the tried and true page.tpl.php file which is a) standardized for Drupal and b) better for markup control. Themer purists will undoubtedly appreciate this reversion.
Edit: For those that want the old UI we are working on it to make that an option and will allow you the same power that to control things as was in 3.x but now we're not forcing it on everyone. This is largely what's holding back the RC release but we're working quick to fix that! (See excerpt from Cellar Door's comment below.)
SASS
Omega 4 ships with SASS out of the box. This addition will be hugely important for keeping Omega a cutting-edge contender as a popular Drupal base-theme.
And for those looking to improve their SASS skills, the media queries, variables, and mixins that ship with Omega 4 are a great learning tool for novice or intermediate SASS-ers:

Just look at all that SASSY goodness!
Pluggable Layouts
In the Omega 4 theme settings, you can now choose to enable layouts. Layouts are a new feature that provide functionality much like what the Delta and the Context modules achieved together. Essentially, you can have completely unique layouts for different sections or pages of your site.
There is currently only one available layout, Epiqo, to use as a starting point, but it's chock-full of more SASS techniques.
If you'd like to employ this built-in feature in an upcoming Omega 4 project, simply copy the Epiqo layout into your sub-theme, and rename it and its contents much in the same way you would when manually creating a sub-theme. From there, you should add only layout-specific code, and nothing relating to styles (colors, typography, etc...).
Polyfills
For anyone responsible for browser testing or device testing, polyfills are becoming essential scripts to include on your site. Polyfills provide themers the ability to quickly enable CSS3 and HTML5 technologies in legacy browsers, saving hours of testing and work-arounds.
In Omega 4, there are already 5 optional scripts available to enable across your site:

While this certainly doesn't mark every improvement, these are the changes we felt most during the development of our first and second Omega 4 projects.



How Drupal "Views Auto-Refresh" really works
7Views is a great module and as you'll probably know it is the most downloaded module in Drupal's history. The possibilities which Views provides you with are almost endless but there is one limitation. The generated output of a view is by default static. What if you want to have a dynamic activity stream as you know it from Twitter or Facebook?
Allow Drupal's unofficial slogan to answer that question: There is a module for that! The module in question is "Views Hacks" and contains another module called "Views Auto-Refresh". There is a blog post about how to implement this module in order to get it to work as you want to, but it seems like this post doesn't cover all of the aspects that are implemented in the "dev"-version. A follow up blog post offers a little more insight, but still not everything I needed.
On a side note: In this tutorial we will use the "dev"-version of "Views Hacks", because the alpha was buggy at the time, and the implementation of the JavaScript part is not in the Drupal way anymore.
Preparation
Let's get started with the implementation. I assume that you have downloaded, installed and activated Views, Views UI, Views Hacks and Views Auto-Refresh. Further I assume that you have created a view for which you want to use the auto-refresh feature.
I will demonstrate the implementation of Views Auto-Refresh by showing screenshots of the actual project.
Implementation
Make the following configurations:
Now head over to your view and add a "Global: Text area" with the text format "PHP Code" and add following code:
<?php print theme('views_autorefresh', array('interval' => '30000', 'incremental'=> array( 'view_base_path' => 'frontpage/autorefresh', 'view_display_id' => 'autorefresh', 'view_name' => 'articles', 'sourceSelector' => '.view-content', 'targetSelector' => '.view-content', 'firstClass' => 'views-row-first', 'lastClass' => 'views-row-last', 'oddClass' => 'views-row-odd', 'evenClass' => 'views-row-even', ))); ?>The base path equals your defined page path, and the display ID equals the Machine name of the auto-refresh View.
The additional settings are the selectors and classes which will be addressed by the JavaScript of Views Auto-Refresh. I don't want to dig too deep since they should be self describing.
Now you might think that everything is done. But no, wait, we have to add the same code to the header of your original view. So do the same thing there as I have described it above. Please make sure that this view also uses AJAX, else it wouldn't work.
Further possibilities
In our project we use the jQuery library Isotope which sorts all the posts dynamically on loading or resizing. But you have to trigger the re-layout of the page if the Views Auto-Refresh has delivered some new posts. This is really simple and straight forward. You just have to add a Drupal behavior in your JavaScript like this:
/** * Add functionality to trigger reloadItems after an autorefresh */ Drupal.behaviors.triggerIsotopeAfterAutorefresh = { attach: function(context, settings){ $('.view-id-articles').bind('autorefresh.incremental', function() { //getting the content/context $isotope = $('.view-id-articles .view-content'); //reload all items by original order $isotope.isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' }); }); } }As you can see, you can just bind the event 'autorefresh.incremental' to execute your own code. 'autorefresh.incremental' is fired every time the Views Auto-Refresh module loads the designated view.
Conclusion
After a few trial and error attempts, I finally figured out how Views Auto-Refresh really worked. There is a lot more to this module that isn't documented. So it is much more powerful than I can describe in only one blog post. So go on and give it a go.
Update 9.5.2013: As pointed out by Phil Dodd in his comment the Views Auto Refresh module has been moved to its own home at http://drupal.org/project/views_autorefresh.