Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 10 min 56 sec ago

Paul Johnson: Could VR tech make a child's dying wishes come true?

Sun, 17/05/2015 - 17:11

For over a year I have had the honour of being responsible for delivering 2 new web platforms for Great Ormond Street Hospital for Children NHS Foundation Trust (GOSH), the hospital and charity websites. During that time I've witness and learnt so much about the exemplary way they care for children, their families from both a medical and pastoral perspective. The good news is that now, using open source content management system called Drupal, they are now in a position to have a web presence which adequatley supports and reflects their internationally celebrated work.

One of the inevitable aspects of treating children with the most severe illnesses is sadly not every child can be made better. It is a reality which has hit me hard the whole time I've worked for GOSH.

Whilst I was at DrupalCon Los Angeles I met Joe Caccavano, CMO at Phase2, who was showing me an curious device having 6 GoPro array of cameras strapped together into a single head. With it something remarkable is possible. Watching footage taken during the conference with the GoPros using a VR headset (just an android phone) allowed me to immerse myself into a virtual world - try it for yourself. For those of you who have tried this, perhaps you shared my pulse raising hair on the back of your neck standing up reaction. It literally felt like I was there, on the drone from which the footage had been shot.

That moment I had an epiphany. I thought about sick children, how film and TV personalities generously visit them or send video messages with well wishes. What if the GoPro camera array captured a child's idol speaking to the camera as if it were the child? Using the child's name, speaking to them (well the camera). Imagine how lifting that would be to a kid, who perhaps couldn't leave bed or due to infection risk couldn't have visitors. They could repeat the experience too. How amazing would that be? Not only this, busy stars could do shoots from anywhere in the world.

The great news is that thanks to Google the technology to watch these films is now so cheap anyone can afford it - £4.99! All that remains is for someone to try my idea out. I will certainly be letting GOSH know of the concept, perhaps you know of a children's hospital or hospice who could do the same.

If this idea has inspired you please share it on social media, with your help maybe the idea will reach someone who could make it happen.

Joe Caccavano, CMO at Phase2, with his 6 camera GoPro Array

VR tech is now in the realms of being affordable to many

Further information: Great Ormond Street Hospital for Children NHS Foundation TrustGreat Ormond Street Hospital CharityGoogle Cardboard's Cheap VR Can Work With iPhones TooAbout the Drupal project
Categories: Elsewhere

DrupalCon News: Thanks for Drupaling!

Sun, 17/05/2015 - 03:29

After a fantastic week, we are exhausted but so pumped about all of the awesome things that happened at DrupalCon Los Angeles.  We hope you had an amazing and enriching time and would love to hear your thoughts so we can make the upcoming Cons even better.  

Check out the DrupalCon Los Angeles Survey and say those words.

Categories: Elsewhere

Drupal Association News: What's new on Drupal.org - April 2015

Sat, 16/05/2015 - 20:45

Look for links to our Strategic Roadmap highlighting how this work falls into our priorities set by the Drupal Association Board and Drupal.org Working Groups.

Better account creation Community User Role Expanded

The community user role which we introduced in March will now be automatically granted to users who reach a certain level of participation on Drupal.org. While the exact activities that can grant this role will not be explicitly published (as we do with other spam prevention measures) the activities are representative of those an engaged community member would take while participating on Drupal.org.

Existing users who have already reached the required level of contribution will receive the role upon their next activity on Drupal.org. As of the end of April the automatic role granting had extended the Community user role to more than 5000 users.

Content Strategy and Visual Design System for Drupal.org

and

Making Drupal.org Search Usable

During April the Association staff focused on communicating the results and recommendations of our Content Strategy work with the Working Groups and the Drupal Association Board of Directors.

A deep investigation of the current organization of content on Drupal.org, the workflow provided by Drupal.org for our User Personas, and the governance of content on Drupal.org has brought us to a comprehensive proposal for the future state of Drupal.org.

These proposals involve creating new sections on Drupal.org that better match to common user activities and better content types to support those activities. As we begin organizing Drupal.org into new and updated content types we’ll also be rolling in our initiative to improve search on Drupal.org. As we work on each content type we’ll be assessing the search facets for each type.

The next step to move this proposal forward has been to create issues for the specific proposals that have evolved from the content strategy project to date and the feedback from the Working Groups.

This issue and child issues that follow are based on the findings of the Content Strategy project performed by the Drupal Association staff in partnership with Forum One Communications during December 2014 - April 2015.

Community Initiatives (D8 Blockers) DrupalCI

Drupal Association staff and community volunteers have continued pushing hard to get DrupalCI production ready and integrated with Drupal.org.

The community helped tremendously by providing some formal guidance into the minimum viable and ideal state of the test environments.
Association staff has the primary environment successfully running all tests, and will be working on the additional environments as well as the Drupal.org integration in the run up to DrupalCon Los Angeles.

Again - tremendous thanks to our community volunteers who sprinted with us in Portland: Jeremy Thorson, Nick Schuch, Bastian Widmer, Ricardo Amaro, Paul Mitchum, Mike Prasuhn, Karoly Negyesi-- and to Shayamala Rajaram, Angie Byron, and Jonathan Hedstrom who helped us from afar!

Localize.Drupal.org

In partnership with the community members who have been working on the port of localize.Drupal.org to Drupal 7, association staff have been working to get this migration across the finish line.

We focused fire on the issues found in click-testing, and hope to deploy localize.Drupal.org on Drupal 7 in May.

Revenue-related projects (funding our work) Try Drupal

We’ve created Try Drupal with our Premium Hosting Supporters to make it easier for CMS evaluators and Drupal.org newcomers to test and work with a Drupal demo site. The Program will showcase a selection of Hosting Companies where a new user can quickly (in less than 20 minutes) sign up and have a Drupal demo site up and running for them to use for free.

DrupalCons

It’s almost time for DrupalCon Los Angeles! In the run up to DrupalCon Los Angeles we’ve been fixing bugs on Events.Drupal.org and preparing for the launch of the DrupalCon Barcelona full site.

We’ve also just started planning out our work for the next Cons to be announced at DrupalCon Los Angeles - more to come there after Los Angeles!

Sustaining Support and Maintenance Pre-Production Infra Rebuild

An issue was reported to the Drupal.org infrastructure team that uncovered an installed rootkit on our pre-production (dev and staging) environment on April 19th. We stopped all services on these servers. The access was gained through an open VNC port on our OpenStack environment that allowed hijacking of an open console session. The attacker was attempting to create a distributed denial of service (DDoS) attack on targeted IPs.

There is no evidence that information was taken from our staging database or that user information was compromised.

To ensure site integrity, we rebuilt our staging and development environments. Our infrastructure team took the opportunity during the rebuild to address some best practices and better security configuration options. The majority of these environments are now on Amazon Web Services. Particularly for our development environments, this gives us options for more easily scaling up and down our development needs, and gives us more separation between production and pre-production servers.

---
As always, we’d like to say thanks to all volunteers who are working with us and to the Drupal Association Supporters, who made it possible for us to work on these projects.

Follow us on Twitter for regular updates: @drupal_org, @drupal_infra.

Categories: Elsewhere

Addison Berry: Getting Started as a Board Director

Sat, 16/05/2015 - 20:06

A few months ago I ran for, and won, a seat on the Drupal Association (DA) Board as an At-Large Director. I'd like to share my journey with everyone, both to provide another look into the work that the board does, and to understand what it's like to be a new board member. I've now attended two board meetings (April and May) and taken part in my first board retreat, the weekend before DrupalCon LA. There's a lot going on, so I'll break this up into several posts.

On-boarding

Once I was elected, and the board confirmed the election results, Holly contacted me to let me know just before announcing it to the entire community. Shortly after that we scheduled a time to get on the phone, and I started getting access to a bunch of documents. I mean a whole bunch!

That first call with Holly was great for getting me oriented. She walked me through logistical things like board meetings, communication, necessary paperwork, and pointing me in the right direction with the documents to look at for various topics and back story. She also asked if I'd ever served on a board before, which I had not, and took time to explain what that means in terms of expectations for board members (things like publicly representing the board and identifying conflicts of interest). She also gave me a summary of the major topics from the last board retreat, which had occurred in January. She continued from there to summarize the big issues that the board was in the middle of discussing and working on, with an idea of what topics we were looking to tackle during the LA retreat in May. This was incredibly useful to prepare me for my first board meeting. I caught up on details by reading the minutes from the January retreat and this year's monthly board meetings. I didn't have many questions after my on-boarding and I felt prepared to dive into the conversations that were already ongoing.

One thing that I did right after that call was to set up times to chat one-on-one with the DA staff leadership team. I wanted to hear from each of them what they were working on, and understand what they needed to get from the board (and therefore me) to do their jobs better. It was a great introduction to the work that the staff takes on every day, and helped me clarify what I need to keep focused on to help them. It was also just awesome to get to know them a little more as people, which can be hard to do in our crazy, busy schedules.

Board Email

In addition to documents and phone calls, I was also added to the board email list. It is a pretty low traffic list, but I got to see a few conversations run through there prior to my first meeting. We had a thread to help clarify what info we needed to have for the meeting, and that board members should read reports ahead of time so we could get straight to things in the meeting itself. In addition to internal process things like that, this is also a place where members can raise issues they think we need to discuss or vote on in a meeting.

First Board Meeting

I was elected just a few weeks before the April board meeting, and I wasn't required to attend that meeting since I was still getting up and running, but I wanted to dive in. Board members are expected to make all monthly board meetings, with at least 10 a year being the minimum to attend. The time is a set time, and so one thing I knew before I even nominated myself was that I would need to make space for this 2-hour call every month on a Wednesday night from 9pm–11pm (since I live in Denmark).

A few days before each board meeting we all receive a meeting packet which has the agenda, phone connection info, links to any presentations or documents we should review, and a list of the DA key performance indicators (KPIs). This board packet is publicly available as well, and you can check them out yourself and even listen in on the board meeting. I spent some time to read everything over and think about what I might want to bring up in the conversation during the meeting.

I didn't have a whole lot to say as I was just trying to absorb as much as I could. We did however discuss releasing the election results, which I obviously had some thoughts about, having just come through the election process. This issue was a good example of how the DA works with community feedback. We have never released election data in the past, and we hadn't made that an expectation for candidates, so when people asked for the data, we couldn't just hand it out with considering a few things. I think we came up with a good solution to be able to release the data for this election, and we now have a plan in place to incorporate this in future elections. You can read more about this decision in Holly's post 2015 At-Large Election Data Released.

The first part of every board meeting is public (as mentioned above). After the public section, we drop off the phone and meet on another phone line with just the board, Holly, and needed staff. This is a place for us to discuss things that are still in progress, or to handle internal board matters. On this particular call we discussed things like reviewing the Q1 financials and and giving updates on board members' efforts to help raise funds for D8 Accelerate.

In my next post I'll give a rundown of the board retreat and my board experience at DrupalCon LA. A lot of people have asked me how I feel about being on the board after the retreat, and I have to say that I'm very happy. I felt the level and direction of conversation was great. I'll talk more about what that was, and why I'm so pleased, especially compared to my previous DA experience from many years ago.

drupal associationdrupal
Categories: Elsewhere

Another Drop in the Drupal Sea: DrupalCon LA Friday Recap

Sat, 16/05/2015 - 19:06

From my vantage point the sprint day was extremely well attended. I spent my day working on a patch I had submitted to the Flag module and working on OG Forum and OG Forum D7.

We had the traditional live commit in the afternoon.

There wasn't any announcement if any more critical bugs were squashed for core.

How many of you participated in the sprints? When did you head home? Are you participating on Saturday?

read more

Categories: Elsewhere

Forum One: DrupalCon LA Round-Up: Wrapping Up and Looking Ahead

Sat, 16/05/2015 - 01:34

A number of us from Forum One are sticking around for Friday’s sprints, but that’s a wrap on the third day of DrupalCon and the conference proper!

Wednesday and Thursday were chock-full of great sessions, BoFs, and all the small spontaneous meetings and conversations that make DrupalCons so fruitful, exhausting and energizing.

Forum One gave three sessions on Wednesday. John Brandenburg presented Maximizing Site Speed with Mercy Corps, a case study of our work on www.mercycorps.org focusing on performance optimization. Kalpana Goel of Forum One and Frédéric G. Marand presented Pain points of learning and contributing in the Drupal community, a session on how to even better facilitate code contributions to Drupal from community members. And finally Forum One’s Andrew Morton presented Content After Launch: Preparing a Monkey for Space, a survey of content considerations for project success before, during, and after the website build process. The other highlight from my perspective on Wednesday was a great talk by Wim Leers and Fabian Franz on improvements to Drupal performance/speed, and how to make your Drupal sites fly.

Then Thursday, Daniel Ferro and Dan Mouyard rounded out the seven Forum One sessions with their excellent presentation, To the Pattern Lab! Collaboration Using Modular Design Principles. The session describes our usage of Pattern Lab at Forum One to improve project workflow and collaboration between visual designers, front- and back-end developers, and clients. This approach has eased a lot of friction on our project teams. I’m particularly excited about how it’s allowed our front-end developers to get hacking much earlier in the project lifecycle. We were glad to see the presentation get a shout out from Brad Frost, one of the Pattern Lab creators. Other highlights for me on Thursday were the beloved Q&A with Dries and friends and sitting down over lunch with other Pacific Northwest Drupalers to make some important decisions about the PNW Drupal Summit coming to Seattle this fall.

In addition to looking ahead to DrupalCon Barcelona, the closing session revealed the exciting news that DrupalCon will be landing in Mumbai next year!

#DrupalCon is coming to Mumbai! Plus other photos from todays closing session https://t.co/Y3vWCQCSTu? pic.twitter.com/zEt4Y6VLxS

— DrupalCon LosAngeles (@DrupalConNA) May 15, 2015

And the always anticipated announcement of the next DrupalCon North America location… New Orleans!

And the next North American #DrupalCon will be…… pic.twitter.com/AXiFxv3gfW

— DrupalCon LosAngeles (@DrupalConNA) May 14, 2015

That news was ushered in soulfully by these gentlemen, Big Easy style, pouring out from the keynote hall into the convention center lobby.

Great way to announce #DrupalCon New Orleans! #DrupalConLA pic.twitter.com/3cRmV8jI1F

— Andy Hieb (@AndyHieb) May 14, 2015

And to finish off the day properly, many of us hooted and hollered at Drupal trivia night, MC’d by none other than Jeff Eaton.

Another fantastic #DrupalCon trivia night in progress… Woo! pic.twitter.com/AzavA2AFXi

— Jeff Eaton (@eaton) May 15, 2015

A great con was had by all of us here at Forum One… On to the sprints!

Categories: Elsewhere

Forum One: Hacking the Feds: Forum One Among the Winners at GSA Hack-a-Thon

Fri, 15/05/2015 - 20:25

Last Friday, we attended the Digital Innovation Hack-a-Thon hosted by the GSA… and we won. The federal tech website FCW even wrote an article about it.

Our team, made up of designers and developers from Forum One, along with Booz Allen Hamilton, Avar Consulting, and IFC International, worked on a solution for IAE’s Vendor Dashboard for Contracting Officers. We were tasked with creating a vendor dashboard for displaying GSA data that would enable procurement officers to quickly and easily search and identify potential vendors that have small-business or minority-owned status, search by other special categories, and view vendors’ history.

How did we tackle the problem?

Our team initially split into smaller working groups. The first group performed a quick discovery session; talking with the primary stakeholder and even reaching out to some of the Contracting Officers we work with regularly. They identified pain points and looked at other systems which we ended up integrating into our solution. As this group defined requirements, the second group created wireframes. We even took some time to perform quick usability testing with our stakeholders, and iterate on our initial concept until it was time to present.

The other group dove into development. We carefully evaluated the data available from the API to understand the overlap and develop a data architecture. Using that data map, we decided to create a listing of contracts and ways to display an individual contract. We then expanded it to include alternative ways of comparing and segmenting contracts using other supporting data. Drupal did very well pulling in the data and allowed us to leverage its data listings and displays tools. Most developers see Drupal as a powerful albeit time intensive building tool, but it worked very well in this time critical environment.

Our two groups rejoined frequently to keep everyone on the same page and make sure our solutions was viable.

How much could we possibly accomplish in 6 hours?

More than you might think. Our solutions presented the content in an organized, digestible way that allowed contracting officers to search and sort through information quickly and easily within one system. We created wireframes to illustrate our solution for the judges and stakeholders. We also stood up a Drupal site to house the data and explained the technical architecture behind our solution. Unfortunately, we didn’t have a front-end developer participating in the hack-a-thon, so we weren’t able to create a user interface, but our wireframes describe what the UI should eventually look like.

Some of us even took a quick break to catch a glimpse the Arsenal of Democracy World War II Victory Capitol Flyover from the roof. It was also broadcasted on the projectors in the conference room.

What did we learn?

It’s interesting to see how others break down complex problems and iterate on solutions especially if that solution includes additional requirements. Our solution was more complex than some of the other more polished data visualizations, but we won the challenge in part because of the strategy behind our solution.

We’re excited to see what GSA develops as a MVP, and we’ll be keeping our ears open for the next opportunity to attend a hack-a-thon with GSA.

Finally, a big shout out to our teammates!
  • Mary C. J. Schwarz, Vice President at ICF International
  • Gita Pabla, Senior Digital Designer at Booz Allen Hamilton
  • Eugene Raether, IT Consultant at Booz Allen Hamilton
  • Robert Barrett, Technical Architect, Avar Consulting
Categories: Elsewhere

SitePoint PHP Drupal: Using Ajax Forms in Drupal 8

Fri, 15/05/2015 - 18:00

In this article, I am going to show you a clean way of using the Drupal 8 Ajax API without writing one line of JavaScript code. To this end, we will go back to the first custom form we built for Drupal 8 in a previous article and Ajaxify some of its behaviour to make it more user friendly.

An updated version of this form can be found in this repository under the name DemoForm (the demo module). The code we write in this article can also be found there but in a separate branch called ajax. I recommend you clone the repo and install the module in your development environment if you want to follow along.

DemoForm

Although poorly named, the DemoForm was very helpful in illustrating the basics of writing a custom form in Drupal 8. It handles validation, configuration and exemplifies the use of the Form API in general. Of course, it focuses on the basics and has nothing spectacular going on.

If you remember, or check the code, you’ll see that the form presents a single textfield responsible for collecting an email address to be saved as configuration. The form validation is in charge of making sure that the submitted email has a .com ending (a poor attempt at that but enough to illustrate the principle of form validation). So when a user submits the form, they are saving a new email address to the configuration and get a confirmation message printed to the screen.

In this article, we will move the email validation logic to an Ajax callback so that after the user has finished typing the email address, the validation gets automagically triggered and a message printed without submitting the form. Again, there is nothing spectacular about this behaviour and you will see it quite often in forms in the wild (typically to validate usernames). But it’s a good exercise for looking at Ajax in Drupal 8.

Continue reading %Using Ajax Forms in Drupal 8%

Categories: Elsewhere

Another Drop in the Drupal Sea: DrupalCon LA Thursday Recap

Fri, 15/05/2015 - 17:38

There was a shortened day of sessions, finishing with the closing ceremony. In the morning I attended a discussion about documentation on D.O. I attended this session because the point of focus the group chose at my BOF was to do something to improve the documentation. The session was quite well attended, which apparently demonstrates that there's a good bit of interest in improving the documentation. So, I guess I'll be putting more of my time, energy and resources to getting involved.

read more

Categories: Elsewhere

S. M. Bjørklund: How to migrate content from drupal 6 to 7 by using Migrate_d2d - Part 1

Fri, 15/05/2015 - 15:59

The normal way of performing a major upgrade in Drupal have traditionally been by running update.php, that fire off a lot of rather complex hook_update_N() tasks. They will try to upgrade configuration and content from one major version to another. Example Drupal 6 to 7. This is all about to change in Drupal 8. Drupal 8 have got the migrate module baked in, and upgrade is no longer a upgrade, but a migration of data and configuration from one system to another.

Categories: Elsewhere

Drupal Easy: DrupalEasy Podcast 154: DrupalCon Los Angeles - Day 3 Recap

Fri, 15/05/2015 - 15:29
DrupalEasy Podcast 154

Ryan managed to catch a few final interviews before leaving town on the last day of DrupalCon. He got in a traditional interview with a Blackmesh employee (who isn't Cathy Theyes), namely Jason Ford. Also is an 15 minute interview with Colleen Carrol of Palantir.net who recaps her session about Sustainable Recruiting Practices.

read more

Categories: Elsewhere

Paul Booker: Collecting total prices on a recipe form using field collections, JQuery / AHAH

Fri, 15/05/2015 - 15:26
(function($) { Drupal.behaviors.recipesForm = { attach: function (context, settings) { $(".field-name-field-recipe-quantity input[type=text]").focus(function() { $ingredient = $(this).parent().parent().parent().prev().find("select"); nid = $ingredient.find('option:selected').val(); //console.log(nid); $.get('/ingredient/price/get/' + nid , null, updateCost); }); $(".field-name-field-recipe-quantity input[type=text]").blur(function() { total_cost = 0; $quantity = $(this); quantity_val = $(this).val(); if (quantity_val && cost_per_kg) { var item = $(".field-name-field-recipe-cost"); $cost = $(this).parent().parent().parent().parent().find(item).find("input[type=text]"); cost_val = quantity_val * cost_per_kg; //console.log($quantity_val); //console.log($cost_per_kg); //console.log($cost_val.toFixed(2)); $cost.val(cost_val.toFixed(2)); } $('.field-name-field-recipe-cost').each(function() { //console.log(this); //console.log($(this).find("input[type=text]")); //console.log($(this).find("input[type=text]").val()); cost = $(this).find("input[type=text]").val(); total_cost = total_cost + parseFloat(cost); }); //console.log(total_cost); $total_cost = $('.field-name-field-total-cost').find("input[type=text]"); $total_cost.val(total_cost.toFixed(2)); }); $(".field-name-field-recipe-ingredient select").change(function() { nid = $(this).find('option:selected').val(); $.get('/ingredient/price/get/' + nid , null, updateCost); var item = $(".field-name-field-recipe-quantity"); $quantity = $(this).parent().parent().parent().find(item).find("input[type=text]"); //console.log($quantity); $quantity.val(0); var item = $(".field-name-field-recipe-cost"); $cost = $(this).parent().parent().parent().find(item).find("input[type=text]"); $cost.val(0); }); } }; var updateCost = function(response) { cost_per_kg = response['data']; //console.log(cost_per_kg); } })(jQuery); /** * Implements hook_menu(). */ function mymodule_menu() { $items['ingredient/price/get'] = array( 'page callback' => 'mymodule_get_ingredient_price_ajax', 'type' => MENU_CALLBACK, 'access arguments' => array('access content'), ); return $items; } /** * Callback to return JSON encoded ingredient price for given nid. */ function mymodule_get_ingredient_price_ajax($nid) { $node = node_load($nid); //print_r($node->field_cost_per_kg['und'][0]['value']); $cost_per_kg = $node->field_cost_per_kg['und'][0]['value']; drupal_json_output(array('status' => 0, 'data' => $cost_per_kg)); drupal_exit(); } function mymodule_form_recipe_sheet_node_form_alter(&$form, &$form_state, $form_id) { //dsm($form_id); //dsm($form['field_total_cost']); foreach ($form['field_collection_ingredients']['und'] as $key => &$value) { if (is_numeric($key)) { //dsm($key); //dsm($value); $value['field_recipe_cost']["#disabled"] = TRUE; } } $form['field_total_cost']["#disabled"] = TRUE; drupal_add_js(drupal_get_path('module', 'mymodule') .'/scripts/mymodule.js'); } Tags:
Categories: Elsewhere

Drupal Easy: DrupalEasy Podcast 153: DrupalCon Los Angeles - Day 2 Recap

Fri, 15/05/2015 - 14:45
Download Podcast 153

Ryan Mike and Ted are joined by Dave Hall, Amitai Burstein, Damien McKenna, Tess Flynn, Kelley Curry, Brian Lewis in this musical and magical Day 2 of DrupalCon in Los Angeles.

read more

Categories: Elsewhere

InternetDevels: Tips for Design when using Drupal

Fri, 15/05/2015 - 11:33

Meet the new blog post with tips about Drupal web design from our guest blogger Lalit Sharma, SEO consultant who runs a SEO agency.

Drupal is a popular open-source platform loved by many designers. However, there are a few golden rules to follow when designing anything for Drupal sites in order to ensure developers have an easier time coding, maintain production speeds and the client’s pocket remains relatively bulky. A few are as provided below:

Read more
Categories: Elsewhere

Metal Toad: Amazon CloudFront with Drupal 8

Fri, 15/05/2015 - 02:04
Amazon CloudFront with Drupal 8 May 14th, 2015 Dylan Tack

Since I wrote my first review of CloudFront in 2012, Amazon has added support for three essential features:

What this means is that CloudFront is no longer just for static content; it's fully capable of delivering content from a dynamic CMS like Drupal. Here are the configs, step-by-step:

Configure your distribution and origin

This is fairly straightforward. I reccomend using a CNAME for your origin (which could be a single instance, or an elastic load balancer). Ideally, your origin URL should not be accessible from the open internet for serveral reasons:

  • Prevent the origin URL from getting crawled by search engines
  • Pevent DDoS attacks from being able to bypass the CDN
  • Prevent spoofing of the X-Forwarded-For header

Configure a default behavior

Noteworthy settings are:

  • "use origin cache headers" - This means CloudFront will honor the page lifetime set on /admin/config/development/performance within Drupal.
  • Whitelist "Host" and "CloudFront-Forwarded-Proto". This allows virtual hosts, and any SSL redirect logic on the origin to function correctly.
  • Whitelist your site's session cookie.

Drupal 8 workarounds

One of the remaining Drupal 8 critical issues interferes with CloudFront:
[meta] External caches mix up response formats on URLs where content negotiation is in use
As a result, some additional behaviors are needed to work around this. These settings instruct CloudFront to forward all client headers for specific paths:

Domain-sharding

If you plan to use a single domain for your entire site, you're done! On this site, we decided to keep the domain-sharding approach described in my previous post, so we need a little D8 code.

mt_custom.info.yml name: Metal Toad Custom description: Stuff that doesn't fit anywhere else. package: Custom type: module core: 8.x dependencies: mt_custom.services.yml services: mt_custom_event_subscriber: class: Drupal\mt_custom\EventSubscriber\MTCustomSubscriber arguments: ['@current_user'] tags: - {name: event_subscriber} mt_custom.module use Drupal\Component\Utility\UrlHelper;   /** * Implements hook_file_url_alter(). */ function mt_custom_file_url_alter(&$uri) {   // Route static files to Amazon CloudFront, for anonymous users only. if (\Drupal::request()->server->get('HTTP_HOST') == 'www.metaltoad.com' && \Drupal::currentUser()->isAnonymous() && !\Drupal::request()->isSecure()) {   // Multiple hostnames to parallelize downloads. $shard = crc32($uri) % 4 + 1; $cdn = "http://static$shard.metaltoad.com";   $scheme = file_uri_scheme($uri); if ($scheme == 'public') { $wrapper = file_stream_wrapper_get_instance_by_scheme('public'); $path = $wrapper->getDirectoryPath() . '/' . file_uri_target($uri); $uri = "$cdn/" . UrlHelper::encodePath($path); } else if (!$scheme && strpos($uri, '//') !== 0) { $uri = "$cdn/" . UrlHelper::encodePath($uri); } } }   /** * Implements hook_css_alter(). */ function mt_custom_css_alter(&$css) { // Mangle the paths slightly so that Drupal\Core\Asset\AssetDumper will generate // different keys on HTTPS. Necessary because CDN URL varies by protocol. if (\Drupal::request()->isSecure()) { foreach ($css as $key => $file) { if ($file['type'] === 'file') { $css[$key]['data'] = './' . $css[$key]['data']; } } } } src/EventSubscriber/MTCustomSubscriber.php namespace Drupal\mt_custom\EventSubscriber;   use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Drupal\Core\Session\AccountInterface;   class MTCustomSubscriber implements EventSubscriberInterface {   protected $account;   public function checkForCloudFront(GetResponseEvent $event) { $req = $event->getRequest();   /* * Make sure Amazon CloudFront doesn't serve dynamic content * from static*.metaltoad.com */ if (strstr($req->server->get('HTTP_HOST'), 'static')) { if (!strstr($req->getPathInfo(), 'files/styles')) { header("HTTP/1.0 404 Not Found"); print '404 Not Found'; exit(); } } }   /** * {@inheritdoc} */ static function getSubscribedEvents() { $events[KernelEvents::REQUEST][] = array('checkForCloudFront'); return $events; }   public function __construct(AccountInterface $account) { $this->account = $account; }   }
Categories: Elsewhere

Capgemini Engineering: Drupal integration patterns

Fri, 15/05/2015 - 01:00

As Drupal has evolved, it has become more than just a CMS. It is now a fully fledged Web Development Platform, enabling not just sophisticated content management and digital marketing capabilities but also any number of use cases involving data modelling and integration with an endless variety of applications and services. In fact, if you need to build something which responds to an HTTP request, then you can pretty much find a way to do it in Drupal.

“Just because you can, doesn’t mean you should.”

However, the old adage is true. Just because you can use use a sledgehammer to crack a nut, that doesn’t mean you’re going to get the optimal nut-consumption-experience at the end of it.

Drupal’s flexibility can lead to a number of different integration approaches, all of which will “work”, but some will give better experiences than others.

On the well trodden development path of Drupal 8, giant steps have been taken in making the best of what is outside of the Drupal community and “getting off the island”, and exciting things are happening in making Drupal less of a sledgehammer, and more of a finely tuned nutcracker capable of cracking a variety of different nuts with ease.

In this post, I want to explore ways in which Drupal can create complex systems, and some general patterns for doing so. You’ll see a general progression in line with that of the Drupal community in general. We’ll go from doing everything in Drupal, to making the most of external services. No option is more “right” than others, but considering all the options can help make sure you pick the approach that is right for you and your use case.

Build it in Drupal

One option, and probably the first that occurs to many developers, is to implement business logic, data structures and administration of a new applications or services using Drupal and its APIs. After all, Entity API and the schema system give us the ability to model custom objects and store them in the Drupal database; Views gives us the means to retrieve that data and display it in a myriad of ways. Modules like Rules; Features and CTools provide extensive options for implementing specific business rules to model your domain specific data and application needs.

This is all well and good, and uses the strengths of Drupal core and the wide range of community contributed modules to enable the construction of complex sites with limited amounts of coding required, and little need to look outside Drupal. The downside can come when you need to scale the solution. Depending on how the functionality has been implemented you could run into performance problems caused by large numbers of modules, sub-optimal queries, or simply the amount of traffic heading to your database - which despite caching strategies, tuning and clustering is always likely to end up being the performance bottleneck of your Drupal site.

It also means your implementation is tightly coupled to Drupal - and worse, most probably the specific version of Drupal you’ve implemented. With Drupal 8 imminent this means you’re most likely increasing the amount of re-work required when you come to upgrade or migrate between versions.

It’s all PHP

Drupal sites can benefit hugely from being part of the larger PHP ecosystem. With Drush make, the Libraries API, Composer Manager, and others providing the means of pulling external, non-Drupal PHP libraries into a Drupal site, there are huge opportunities for building complexity in your Drupal solution without tying yourself to specific Drupal versions, or even to Drupal at all. This could become particularly valuable as we enter the transition period between Drupal 7 and 8.

In this scenario, custom business logic can be provided in a framework agnostic PHP library and a Naked Module approach can be used to provide the glue between that library and Drupal - utilising Composer to download and install dependencies.

This approach is becoming more and more widespread in the Drupal community with Commerce Guys (among others) taking a libraries first approach to many components of Commerce 2.x which will have generic application outside of Drupal Commerce.

The major advantage of building framework agnostic libraries is that if you ever come to re-implement something in another framework, or a new version of Drupal, the effort of migrating should be much lower.

Integrate

Building on the previous two patterns, one of Drupal’s great strengths is how easy it is to integrate with other platforms and technologies. This gives us great opportunity to implement functionality in the most appropriate technology and then simply connect to it via web services or other means.

This can be particularly useful when integrating with “internal” services - services that you don’t intend to expose to the general public (but may still be external in the sense of being SaaS platforms or other partners in a multi-supplier ecosystem). It is also a useful way to start using Drupal as a new part of your ecosystem, consuming existing services and presenting them through Drupal to minimise the amount of architectural change taking place at one time.

Building a solution in this componentised and integrated manner gives several advantages:

  • Separation of concerns - the development, deployment and management of the service can be run by a completely separate team working in a different bounded context. It also ensures logic is nicely encapsulated and can be changed without requiring multiple front-end changes.
  • Horizontal scalability - implementing services in alternate technologies lets us pick the most appropriate for scalability and resilience.
  • Reduce complex computation taking place in the web tier and let Drupal focus on delivering top quality web experience to users. For example, rather than having Drupal publish and transform data to an external platform, push the raw data into a queue which can be consumed by “non-Drupal” processes to do the transform and send.
  • Enable re-use of business logic outside of the web tier, on other platforms or with alternative front ends.
Nearly-Headless Drupal

Headless Drupal is a phrase that has gained a lot of momentum in the Drupal community - the basic concept being that Drupal purely responds with RESTful endpoints, and completely independant front-end code using frameworks such as Angular.js is used to render the data and completely separate content from presentation.

Personally, I prefer to think of a “nearly headless” approach - where Drupal is still responsible for the initial instantiation of the page, and a framework like Angular is used to control the dynamic portion of the page. This lets Drupal manage the things it’s good at, like menus, page layout and content management, whilst the “app” part is dropped into the page as another re-usable component and only takes over a part of the page.

For an example use case, you may have business requirements to provide data from a service which is also provided as an API for consumption by external parties or mobile apps. Rather than building this service in Drupal, which while possible may not provide optimal performance and management opportunities, this could be implemented as a standalone service which is called by Drupal as just another consumer of the API.

From an Angular.js (or insert frontend framework of choice) app, you would then talk directly to the API, rendering the responses dynamically on the front end, but still use Drupal to build everything and render the remaining elements of the page.

Summing up

As we’ve seen, Drupal is an incredibly powerful solution, providing the capability for highly-consolidated architectures encapsulated in a single tool, a perfect enabler for projects with low resources and rapid development timescales. It’s also able to take its place as a mature part of an enterprise architecture, with integration capabilities and rich programming APIs able to make it the hub of a Microservices or Service Oriented Architecture.

Each pattern has pros and cons, and what is “right” will vary from project to project. What is certain though, is that Drupal’s true strength is in its ability to play well with others and do so to deliver first class digital experiences.

New features in Drupal 8 will only continue to make this the case, with more tools in core to provide the ability to build rich applications, RESTful APIs for entities out of the box allowing consumption of that data on other platforms (or in a headless front-end), improved HTTP request handling with Guzzle improving options for consuming services outside of Drupal, and much more.

Drupal integration patterns was originally published by Capgemini at Capgemini on May 15, 2015.

Categories: Elsewhere

X-Team: DrupalCon Latin America through the eyes of an X-Teamer (Part 2)

Thu, 14/05/2015 - 23:25

Drupal left the island. Larry Garfield brought us an awesome speech about Drupal 8, which you can see here. Dries explained to us why Drupal 8 had to change. Larry showed us those changes, and everybody loved his demo, but the important thing came after that. The inline editor, content management improvements, rendering HTML5 are...

The post DrupalCon Latin America through the eyes of an X-Teamer (Part 2) appeared first on X-Team.

Categories: Elsewhere

Acquia: Web Accessibility for Developers -- Part 2

Thu, 14/05/2015 - 22:15

We’re at the halfway point of what hopefully has been a helpful guide for developers to make a website accessible for all visitors. (If you missed the first part of this two-part series, please click here.)

In this blog, we’ll review how instructional text, navigation, and other parts of development can allow those with blindness and low vision, deafness, and other disabilities to make full use of a website.

There’s a Proper Place for Instructional Text

When providing an example that will help the user fill out a field, place it after the label of the field and before the field itself. This will let the screen reader pinpoint the instructional text and leave no doubt to the user that they’re hearing an example of what’s required. For instance, an example of how to enter the country code and remaining digits of a telephone number should come just before the field.

A Search that Searches When Instructed

Many people love filters that are dynamic — offering results after each selection is made — but it’s not the best thing for a text reader. Dynamic searches cause the page to constantly refresh, leaving a visitor who’s using a text reader to wonder what’s going on. A page shouldn’t reload until the user hits a button. That means all filters and search functionality should have “submit,” “go,” and “apply” buttons.

Jump Directly to Main Content

Readers without disabilities probably take it for granted that they can jump directly to the main content on a webpage. But for those using a screen reader, they first have to listen to a long list of navigation links, icons and other elements before reaching the main content. That’s where a “skip to main content” link comes in handy. It allows a user to skip everything at the top of the page.

The good news for developers using Drupal is that the “skip to main content” link is beginning to come right out of the box and is already included in some themes. If it’s not included, don’t worry. The code in your template should look similar to:

<a id="skip-link" href="#main-content" class="element-invisible element-focusable">Skip to main content</a>.

The CSS code should make the link invisible to a sighted user but will allow a screen reader to focus on the link.

An Easier Way to Zoom and Shrink

Visually impaired people who don’t need a screen reader still may need to manipulate the size of text. They don’t always know how to use keyboard shortcuts and need a user-friendly aid. In a matter of minutes, a site administrator can plop a text-resizing module onto a Drupal webpage. Here’s a handy helper on how to do it. Just keep in mind that it doesn’t always work for menu items, but it usually does resize static text.

Know What to Show; What to Hide

CSS allows developers to change the style of a webpage and make content sparkle. But some text-based screen readers or older screen readers need to read the page with all of the styles disabled. It’s important to make sure that if the stylesheets are turned off, the screen reader will still be able to read the order of the content correctly and be able to access all functionality.

Most of the responsive Drupal themes are already providing this functionality out of the box, but this standard is important to think about, and test when choosing how you will lay out your pages.

In order to test, disable your stylesheets — as seen in this screenshot of a White House page, for instance — and scroll down the page to ensure that the content order is the same as you originally intended.

These are only a few steps that can help developers make a website accessible to all visitors. If you’d like to see more ideas — or perhaps even gain a greater understanding of Web accessibility itself — here are two resources worth checking out:

The first is a checklist of standards from Section 508 of the federal Rehabilitation Act that government agencies must follow to provide full and fair Internet access to people with disabilities. Even though only federal agencies are required to follow them, the standards serve as a thorough and detailed source of steps for businesses and organizations to use.

Another useful resource are the Web Content Accessibility Guidelines offered by the World Wide Web Consortium (WC3). The guidelines are comprehensive and should also help you on the way to creating an accessible website.

Thanks for reading. Please leave a comment below if you have other suggestions you’d like to share.

Down the road, we’ll post a companion, two-part series on accessibility for clients – stay tuned.

Tags:  acquia drupal planet
Categories: Elsewhere

Dave Hall Consulting: Leaking Information in Drupal URLs

Thu, 14/05/2015 - 21:26

When a user doesn't have access to content in Drupal a 403 forbidden response is returned. This is the case out of the box for unpublished content. The problem with this is that sensitive information may be contained in the URL. A great example of this the DrupalCon site.

The way to avoid this is to use the m4032404 module which changes a 403 response to a 404. This simple module prevents your site leaking information via URLs.

AttachmentSize DrupalCon-Philadephia.png139.21 KB
Categories: Elsewhere

Chapter Three: Drupal 8 Automated Testing with Travis CI

Thu, 14/05/2015 - 19:05

Travis CI burst onto the hosted continous integration scene by offering free testing for public projects. If your code is on Github and available to the public then Travis will run your tests for you.



I will show you how to get Drupal 8 running all of it's PHPunit tests in Travis. If you want to use Travis for your own private repo, you will have to pay a little bit. In my opinion that is a small price to pay for never setting up Jenkins again.



First we specify our programming language and the version.




language: php

php:
- 5.4


Next up we specify our database information. Note that we do not have to specify install steps for either PHP or MySQL.

Categories: Elsewhere

Pages