Skip to Content

Drupal

Code Karate: Git Cheat Sheet

Planet Drupal - 12 November 2014 - 6:23am

There is a saying that "All good things come to those who wait".

Categories: Drupal

InternetDevels: Drupal tourists are Drupal Touring!

Planet Drupal - 12 November 2014 - 5:49am

Ukrainian Drupal community with an active support of InternetDevels team has actually invented completely unique kind of Drupal event, which makes the whole community go wow! So, ladies and gentlemen, we proudly present you Drupal Tour! The main point of the event is in it’s dynamics and velocity — we’re not going to stop just on one location, but would travel all around the country to involve even larger amount of audience, interested in Drupal development.

Read more
Categories: Drupal

jQuery Image Zoomer Formatter

New Drupal Modules - 12 November 2014 - 12:58am

Countdown timer field module provides an image formatter based on based on jQuery Zoomer plugin for smooth image exploration. You can zoom the images in a very smoothly manner. You can also add custom css to customize the zoomer wrapper and other css stuffs.

Categories: Drupal

Modules Unraveled: 126 What Varnish Can and Can't Do for Your Drupal Site with Dan Reif - Modules Unraveled Podcast

Planet Drupal - 11 November 2014 - 10:00pm
Published: Wed, 11/12/14Download this episodePerformance Optimization
  • Before we dive deep into Varnish, I’d like to get a feel for the various performance improvements anyone can make to speed up their Drupal. What’s the process you think through when optimizing a site?
    • DB Tuning
    • Boost
    • Memcache
    • Redis
    • APC
    • Varnish
    • Module Choices!
Varnish
  • What exactly is Varnish?
  • When researching Drupal performance optimization, I came across a lot of references to APC and Varnish. What is the difference?
  • Is this for anonymous or authenticated traffic?
  • Is the Varnish module required to utilize Varnish with Drupal?
  • What are the steps needed to install and utilize Varnish? (Broad terms, not actual terminal commands)
  • Does SSL affect Varnish?
  • What doesn’t Varnish do? (What needs to be done by Drupal, or other software instead?)
  • How does Varnish affect a dev/staging/live workflow? Does Varnish need to be instlaled on the local machine?
Episode Links: Dan on drupal.orgDan on TwitterDan on GitHubDan on ServerFaultVarnish moduleVarnish info on Drupal.orgXHProfXHProf Drupal moduleTags: PerformanceOptimizationplanet-drupal
Categories: Drupal

Secure forms

New Drupal Modules - 11 November 2014 - 4:56pm

Some forms in Drupal core pose security concerns - for example, the password reset form displays an error message when a username/email address does not exist in the system.

Currently, this module secures the password reset form by overriding core's validation handlers and performing the same steps but instead of setting an error, simply redirecting and displaying a message as if the submission was a success.

Further enhancements will be added if similar issues are found with other forms.

Categories: Drupal

Feeds Tamper: Entity Field Query by Field Collection

New Drupal Modules - 11 November 2014 - 3:29pm

Like the "Entity Field Query" plug-in that comes with Feed Tamper, except that it does the look-up by a value in a field collection item in a field collection of the target entity.

For example, assume you had the following structure for a taxonomy term called "product category":

Product category Field Name Field Type My Collection Field Collection

And the field collection is as follows:

Categories: Drupal

Reservations: CiviCRM Membership Check

New Drupal Modules - 11 November 2014 - 1:03pm

This module addresses a limitation in the common configuration that uses the CiviCRM Membership Role Synchronization module to limit which users can create new Reservations. While using CiviCRM Membership Role Synchronization and CiviCRM Group Role Synchronization work well to remove the ability to create Reservations, it does nothing to prevent users from making several reservations in the future after their membership expires.

Categories: Drupal

Ben's SEO Blog: Must-Attend Drupal Events of 2015

Planet Drupal - 11 November 2014 - 11:34am

Earlier this year, I posted a blog about Must-Attend Drupal Events of 2014; it was fairly well received so I figured I'd work on a similar list for the 2015 Drupal events.

It appears that BuildAModule keeps their list updated, as does Drupical's map. Instead of categorizing by Drupal Camps or Drupal Cons, this list will simply be in chronological order. I will be updating this blog over the next couple of months as more details are released. Also, don't forget to post in the comments if I missed one; I won't hesitate to add it.

  • DrupalCamp Brighton - Brighton, UK - Jan. 16-18
  • DrupalCamp NJ - Princeton, NJ - Jan. 31
    • The 4th Annual Gathering of Drupalists in the Garden State!
    • @DrupalcampNJ
  • DrupalCon Latin America - Bogotá, Colombia - Feb. 10-12
    • "DrupalCon Latin America is our first DrupalCon in an emerging Drupal community, and we couldn’t be more excited to be hosted by the wonderful people of Bogota, Colombia."
    • Will be held at the RoyalPark Metrotel Convention Center Hotel
    • DrupalCon Latin America is the third DrupalCon in 2015
    • @DrupalconLatino
  • Drupal Camp Utah - Salt Lake City, UT - Feb. 27
    • 5th Annual Drupal Camp Utah
  • DrupalSouth Melbourne - South Wharf, VIC, Australia - Mar. 5-7
  • MidCamp (Midwest Area) - Chicago, IL - Mar. 19-22
  • NYC Camp - New York, NY - Mar. 23-29
    • other site
    • NYC (Nice) Camp is a free, week-long Drupal conference in New York City. We invite you to come learn from some of the brightest minds in Open Source, and expand your horizons. There will be numerous opportunities to contribute back to the community, so jump in!
    • @NYCCampDrupal
  • DrupalCon LA - Los Angeles, CA - May 11-15
    • Host city of the DrupalCon North America conference in 2015.
    • Some of the world's best and biggest museums, universities and entertainment giants are in Los Angeles and they use Drupal. A Drupal powerhouse, Los Angeles is one of the most active areas for Drupal in the world. The Drupal community in and around Los Angeles organizes hundreds of Drupal events each year, including GLADCamp, Drupal Design Camp LA and DrupalCamp LA.
    • While you're enjoying DrupalCon, your family can enjoy Disneyland, bike rides at the beach, and culture and science at the Getty, Museum of Modern Art and the California Science Center. The Downtown area has a thriving nightlife, walkable streets and contrary to popular belief, is the heart of the LA Metro and can be enjoyed car-free.
    • @DrupalConLA
    • @GLADrupal
    • @DrupalConNA
  • DrupalCamp Spain - Jerez, Spain - May 22-24
  • DrupalCon Barcelona - Barcelona, Spain - Sept. 21-25
    • From the colorful tiles of Park Güell to the sparkling Mediterranean, Barcelona is a vibrant city where modernity joins timeless tradition. Experience the culture, festivals, sunny weather and world-class dining with friendly locals, all while celebrating the world’s best open source project.
    • @DrupalConEUR
  • DrupalCamp Bristol - Bristol, UK - date: TBA
drupal, Planet Drupal
Categories: Drupal

Domain VBO

New Drupal Modules - 11 November 2014 - 9:41am

This module contains 2 configurable VBO operations for Domain Access module and Views Bulk Operations.

Contains

A configurable action set "Domain VBO: modify user domains" that can be used in Views Bulk Operations on all entities of type 'user'.
- choose the action to perform: replace with, add, remove.
- choose the domains to replace/add/remove for the user(s).

Categories: Drupal

Paul Booker: How to give your Drupal site a Canonical URL

Planet Drupal - 11 November 2014 - 1:35am

You will need to modify your .htaccess file located under your web root.

Change ..

# To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example.com/...) # uncomment the following: # RewriteCond %{HTTP_HOST} . # RewriteCond %{HTTP_HOST} !^www\. [NC] # RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

to ..

# To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example.com/...) # uncomment the following: RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Tags:
Categories: Drupal

Cache Debug

New Drupal Modules - 10 November 2014 - 4:52pm

This module is really simple. Its a pseudo cache class in Drupal that wraps around another cache handler simply to extract debugging information around cache items being retrieved or set in cache.

The cache class can be used exclusively without enabling the module or you can enabled the module to get UI options in the Logging and Errors page under Configuration in Drupal's administration.

Categories: Drupal

Promet Source: <a href="/blog/developing-promet-way-part-i">Developing the Promet Way: Part I</a>

Planet Drupal - 10 November 2014 - 2:42pm

How often do pushes turn into nail biting, hair pulling, obscenity screaming, hours-long events? How often does one hear, “It works on my machine!” How fast can you push all the work (bug fixes, new features, etc.)  to production? Theoretically, only in the time necessary to deploy the code.

Categories: Drupal

Creative Juices: Programmatically Creating a Block in Drupal 8

Planet Drupal - 10 November 2014 - 1:21pm
Programmatically Creating a Block in Drupal 8 Mon, 11/10/2014 - 16:21 matt
Categories: Drupal

Stauffer: Measuring Success in Web Projects

Planet Drupal - 10 November 2014 - 11:17am

A Ship Without a Rudder

When I was a younger developer, I struggled often with the idea that I wasn't doing meaningful work. Yes, I was building good websites. Yes, they meant something to somebody (at least to the client). But is that brochureware site really going to make the world a better place? Does this university sub-department really need its own website? (I don't think I looked at a single individual department site when I was in school.) When you work on a project that doesn't have a clear and obvious goal, it's easy to fall into this line of thinking. And that line of thinking is very demotivating to a developer - you start to feel like you're spending your days doing busywork. And that's not even touching the fact that web projects are expensive. That university sub-department is probably spending tens of thousands of dollars to make a site that the students may never visit.

The solution is to figure out and clearly define the goals of a site at the outset of the project. The main purpose of that university department site is to serve information. Potential students can learn about the department, and current staff and students keep up to date on what's going on. There are secondary purposes too, like directing potential students to the main school website, getting them to submit a contact form, or getting people to sign up for a newsletter. Just knowing that much gives you something to work towards. If your work doesn't contribute to one of those goals, then things are getting off track.

Getting on Track

Once the list of goals for a site is known, it should be communicated to the whole team. The client knows why they need a website, but the development team may not. Keeping your developers informed of a project’s goals will keep them motivated and on track.

Some projects have obvious goals. An e-commerce site, whose sole purpose is to to sell products, is probably the easiest example. This type of project is deemed a success when the profit from the store surpasses the cost of development. Sites that market an upcoming product may have obvious goals too, even if their value is more difficult to calculate. In the case of a promo site for an upcoming service, the business may plan to collect as many email addresses as possible,assigning an estimated value to each address collected. Then there are sites like libraries and club forums, which don't make any money, but have value in other ways, i.e. providing information and fostering community interaction. In those cases, the value is in making it as easy as possible for visitors to find what they are looking for. If visitors to the library site are getting lost on the way to finding content, the project is in trouble.

In any case, it's important for a project to define success for when the project goes live.

The next step, after knowing the goals, is to refine them into specific user actions like viewing a specific page or clicking a specific button. These "goalpost" actions are defined as something that users can do so we know when they have reached one of the site's goals. This makes each goal both specific and measurable. If the goal is newsletter signups, the goalpost might be "user submits the newsletter form and reaches the signup thank you page." Now every time a visitor reaches the signup thank you page, we can mark a tally because the goal is specific. Looking at the percentage of visitors reaching each goal gives us what's called a conversion rate. The higher the conversion rates, the better your website is doing what it was made to do.

Learning to Measure Progress

Setting up goalposts is what separates directionless projects from meaningful ones. Whether you, as a developer, fully stand behind the product or not, you're helping someone bring their idea into reality. And more importantly, by measuring the value of your contribution, clients can see the return on their investment.

Websites actually have it relatively easy when it comes to tracking goals like this. The most common bit of tracking info in web is just the path a user is on. If a user ends up on a path ending in /checkout/complete, chances are they just finished placing an e-commerce order. Your analytics package will note that /checkout/complete got a pageview, and now you have a tally that one more visitor completed a purchase. Of course, you can also log in to your commerce site to see how many orders are placed, but analytics dashboards are extra convenient and give you endless options for number crunching and filtering data.

For more complicated goals, any decent analytics package will let you submit custom data and track events manually. For example, if you're only tracking checkouts with /checkout/complete, you don't know how much money each individual order was worth. Using this simple method, someone buying a $10 t-shirt looks exactly the same as a person buying a $20,000 giraffe. (Why you have that in your store is beyond the scope of this article.) Custom analytics events let you pass the real value of the order, which might make a big difference depending on what you're measuring. Maybe people entering your site on the homepage mostly buy t-shirts, and people who click through from your Giraffe for Sale banner ad mostly buy giraffes. These distinctions are important for tracking the success of ad runs.

So you know your goals, you've decided on goalposts, and you’ve configured them in an analytics package. Unfortunately, users still aren't reaching the end point. What do you do now? Goal funnels can help identify pain points for your users. A funnel is a list of steps that a user takes on the way to a goalpost (marked by specific and measurable mini-goalposts, of course). Using commerce as an example, step 1 is viewing a product, step 2 is adding to cart, step 3 is starting checkout, step 4 is billing and shipping info, and step 5 is the goal - a finished checkout. Each step has a page or action associated, so we can track how far into the process users get. By watching the percentage of users hitting each step, you can see what step is scaring users off. A huge dropoff on step X tells you that something about that page is bad, wrong, or just plain broken. Revisit that step, develop a more user-friendly way to do it, and then after you push it live, measure the new conversion rate. Since you already have a funnel in place, you don't have to guess whether new development is actually better or not. You'll have percentages to back it up. (Prettier isn't always better. Sometimes users prefer unexpected things - Craigslist has barely updated its style in the last 20 years, and yet it remains popular.)

Wrapping Up

To recap, by defining and tracking the goals of a website developers stay motivated, clients focus on real sets of goals, and managers can look at the numbers and see real return on investment. So at the outset of any web project, lay out the goals. Once a general list of goals is known, refine them into specific user actions that can be tracked and measured. Analytics software can tell you the value of the completed development. If users just aren't hitting your goals, use funnels to look for pain points to improve on. All of this together will give your projects a more defined purpose with less guessing and more transparency.

Tags: Drupal , Planet Drupal , Success , Goals , Analytics
Categories: Drupal

No Table Drag

New Drupal Modules - 10 November 2014 - 10:02am

This module adds a "#nodrag" option to fields which don't want to use the table drag functionality for multi-value widgets.

You can toggle the table drag on / off through the field UI or programmatically. See the README.md file for details.

Notes

This module replaces the default theme registry callback for the table drag theme function and replaces it with its own. If your theme / site depends on a custom multi-field theme it will conflict with this module.

Categories: Drupal

Chapter Three: Ruby, RVM, Gemsets and Bundler/Gemfiles

Planet Drupal - 10 November 2014 - 9:00am

As a Drupal themer, we're often tasked with building multiple sites concurrently. One site may be a new build from scratch, and another could be a site built two years ago that is getting a new feature. If they utilize Sass in the theme, then they both have one thing in common:



They have Ruby gem dependencies.



What are they chances that both sites use the same versions of the same gems? Slim? None? Ever tried to build a set of Sass files when you don't have the correct gem versions installed? Oh what a pain.



Let's take the pain away with a few simple techniques.



Ruby and RVM

OS X comes with Ruby built-in, but I highly recommend installing Ruby with RVM. With RVM, you can specify the version of Ruby you want installed, plus a whole lot more. Installation instructions are available, but are outside the scope of this blog post.

Categories: Drupal

Phase2: AngularJS Meet Open Atrium

Planet Drupal - 10 November 2014 - 7:52am

The recent 2.23 version of Open Atrium contains a cool new interactive site builder and navigator application (see it in action). This application was written using the AngularJS framework.  The combination of Drupal, jQuery, and AngularJS proved to be powerful, but wasn’t without some pitfalls.

Using AngularJS in Drupal

The basics of using Angular within Drupal is pretty straight-forward.  Simply reference the external AngularJS scripts using the drupal_add_js() function, then add your custom javascript app code, then use a tpl template to generate the markup including the normal Angular tags.  For example, here is the Drupal module code, javascript and template for a simple Angular app:

// Implements hook_menu() function myapp_menu() { $items['myapp'] = array( 'page callback' => 'myapp_menu_callback', 'access callback' => TRUE, ); return $items; } // The menu callback to display the page function myapp_menu_callback() { drupal_add_js('https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.min.js'); $base = drupal_get_path('module', 'myapp'); // data you want to pass to the app drupal_add_js(array( 'myapp' => array( 'title' => t('Hello World'), ), ), 'setting'); drupal_add_js($base . '/myapp.js'); drupal_add_css($base . '/myapp.css'); return theme('myapp', array()); } // Implements hook_theme(). function myapp_theme() { return array( 'myapp' => array( 'template' => 'myapp', ), ); }

(function ($) { var app = angular.module("myApp", []); app.controller("myAppController", function($scope) { $scope.settings = Drupal.settings.myapp; $scope.count = 1; $scope.updateCount = function(value) { $scope.count = $scope.count + value; } $scope.myClass = function() { return "myclass-" + $scope.count; } }) }(jQuery));

<div class="myapp" ng-app="myApp" ng-controller="myAppController"> <h3 ng-class="myClass()">{{settings.title}}</h3> <p> <a class="btn btn-default" ng-click="updateCount(1)">Click</a> to increment {{count}} </p> </div>

Now, obviously we aren’t using the full Angular framework here.  We aren’t using any directives, nor are we really using Angular as a MVC framework.  But it gives you the idea of how easy it is to get started playing with basic Angular functionality.

Angular plus jQuery

Developing javascript applications in Angular requires a different mindset from normal Drupal and jQuery development.  In jQuery you are often manipulating the DOM directly, whereas Angular is a full framework that allows data to be bound and manipulated on page elements.  Trying to combine both is often a source of frustration unless you understand more about how Angular works behind the scenes. Specifically, Angular has it’s own execution loop causing a mix of Angular and jQuery code to not seem to execute in a straightforward order.  For example, in the above code, we set the class of the H3 based on the current “count” variable.  What if we modified the updateCount function to try and set a css property for this class:

$scope.updateCount = function(value) { $scope.count = $scope.count + value; $('.' + $scope.myClass()).css('color', 'red'); }

If you click the button you’ll notice that the css color does NOT change to red! The problem is that Angular is executing the query function call BEFORE it actually updates the page.  You need to delay the jQuery so it executes after the current Angular event loop is finished.  If you change the code to:

$scope.updateCount = function(value) { $scope.count = $scope.count + value; setTimeout( function() { $('.' + $scope.myClass()).css('color', 'red'); }, 1); }

then it will work.  The timeout value can be anything greater than zero.  It just needs to be something to take the jQuery execution outside the Angular loop. Now, that was a horrid example!  You would never actually manipulate the css and class properties like this in a real application.  But it was a simple way to demonstrate some of the possible pitfalls waiting to trap you when mixing jQuery with Angular.

Drupal Behaviors

When doing javascript the “Drupal way”, you typically create a behavior “attach” handler.  Drupal executes all of the behaviors when the page is updated, passing the context of what part of the page has changed.  For example, in an Ajax update, the DOM that was updated by Ajax is passed as the context to all attached behavior functions. Angular doesn’t know anything about these behaviors.  When Angular updates something on the page, the behaviors are never called.  If you need something updated from a Drupal behavior, you need to call Drupal.attachBehaviors() directly.

Angular with CTools modals

In the Open Atrium site map, we have buttons for adding a New Space or New Section.  These are links to the Open Atrium Wizard module which wraps the normal Drupal node/add form into a CTools modal popup and groups the fields into “steps” that can be shown within vertical tabs.  This is used to provide a simpler content creation wizard for new users who don’t need to see the full node/all form, and yet still allows all modules that hook into this form via form_alters to work as expected. The tricky part of this is that as you navigate through the sitemap, Angular is updating the URLs of these “New” links.  But CTools creates a Drupal Ajax object for each link with the “ctools-use-modal” class in it’s Drupal behavior javascript.  This causes the URL of the first link to be cached.  When Angular updates the page and changes the link URLs, this Ajax object cache is not updated. To solve this within the Open Atrium Sitemap app, an event is called when the page is updated, and we update the cached Ajax object directly via the Drupal.ajax array. This was a rather kludgy way to handle it.  Ultimately it would be better to create a true Angular “Directive” that encapsulates the CTools modal requirements in a way that is more reusable.

Summary

Angular can be a very useful framework for building highly interactive front-ends.  Using Drupal as the backend is relatively straight-forward.  Angular allowed us to create a very cool and intuitive interface for navigating and creating content quickly within Open Atrium far easier than it would have been in jQuery alone.  In fact, we began the interactive site map tool in jQuery and the code quickly became unmanageable.  Adding functionality such as drag/drop for rearranging your spaces and sections would have been a mess in jQuery.  In Angular it was very straight-forward. Once you understand how Angular works, you’ll be able to blend the best of Drupal + jQuery + Angular into very rich interfaces.  Programming in Angular is very different.  Learn more about Angular on the Phase2 blog!

Categories: Drupal

Drupal.org Featured Case Studies: Doctors of BC

Planet Drupal - 10 November 2014 - 7:11am
Completed Drupal site or project URL: http://doctorsofbc.ca

Doctors of BC was founded in 1900 as the British Columbia Medical Association, and has a long history of working for members, improving patient care, and influencing health care policy. As part of a rebranding process started in late 2012, Doctors of BC (formerly the British Columbia Medical Association), engaged Fuse to build a new Drupal based website in spring of 2014. The Doctors of BC had been running on Drupal 6 for years and the site served successfully as a key communications and transactional resource for Doctors of BC staff & members. However, with a new brand, a desire to better support mobile users and a need to replace an aging codebase it was time for a rebuild.

This was no ordinary corporate website project. The new Drupal 7 system was replacing not only an aging Drupal 6 site, but a legacy custom eCommerce system with sophisticated business logic, a complex permissions matrix and a host of integration points with internal systems. Oh... and it all needed to be responsive.

We worked alongside Cossette Communications on the project (UX & Design) and were given a tight four month timeframe to build out the project.

Key modules/theme/distribution used: CommercePanelsPanelizerMediaFeaturesFeedsMenu MinipanelsCKEditor - WYSIWYG HTML editorBeanBreakpointsPictureManual CropMenu Node ViewsMigrateDrupal-to-Drupal data migrationFlagFlag PageOmega
Categories: Drupal

Paul Rowell: Drupal images; why they suck and what you can do about it

Planet Drupal - 10 November 2014 - 7:06am

It's a well-known frustration that the core image management within Drupal isn't great (to put it mildly). Compared to CMS' such as wordpress it falls very short, there are however a few modules you can install and configure to help manage images better within your site. 

Categories: Drupal
Syndicate content


Google+
about seo