Author

Sep 29 2016
Sep 29

Drupal 8 represents a major shift away from “Drupalisms” to mainstream object-orientated PHP. Experienced developers who are used to other frameworks like Symfony, should find it much easier to pick up Drupal now than they would have in Drupal 7 and previous versions. But this shift presents challenges for those of who are used to the Drupal 7 way of doing things and aren’t necessarily up to speed with all the new PHP best practices.

Over the next few weeks, I’ll be sharing tutorials on some of the key concepts you need to understand in order to master Drupal 8 module development. This week, we are going to look at namespaces.

The Drupal 7 way

In Drupal 7, all functions in the system had to have a unique name or you would get a fatal error. If the name was not unique, then the system would not know which function code to use when the function is called in another function.

Module developers can’t rely on other functions not having the same name that they use. So to get around this, it is common practice to start each function name in Drupal 7 with the same name as the module. This makes the function name unique when if another module uses the same name.

But having to use these unique names for functions is far from ideal. For starters, it makes function names longer that they would otherwise be.

Drupal 8 and namespaces

With the introduction of Drupal 8, we can now use a different method for making our code unique. Drupal 8 extensively uses PHP classes instead of simple functions. Two classes can have the same name as they have a different namespace.

You can think of it as a way of organising classes into folders and subfolders and the namespace as the path to the file. If you try and create the same file with the same name in the same folder, you will get an error. You could change the name of the file, but if you really want to keep the same file name, you would most likely create a sub folder and put the file in there. This makes the file unique because it has a different path. Namespacing works in the same way.

Let’s have a look at an example. We’ll start off by creating a basic module to illustrate how namespaces work. If you already have a module and just want an explanation of namespaces, jump to the namespace section.

Setup a basic module

You are going to create a module called hello for demonstration purposes. In the /module folder, create a directory called hello.

Create an info .yml file

The info .yml file tells Drupal that your module exists and provides important information. This is similar to creating a .info file in Drupal 7.

The filename should be the machine name of your module with the .info.yml extension. In this case, it will be hello.info.yml.

  • Create hello.info.yml in the root of the hello directory.

  1. name: Hello

  2. description: An experimental module to build our first Drupal 8 module

  3. package: Custom

  4. type: module

  5. version: 1.0

  6. core: 8.x

Create the src directory

In Drupal 8, most modules can have controllers, plugins, forms, templates and/or tests. These are stored in a folder called src, which is short for source.

  • Create a folder inside the hello module folder called src, which is short for source.

Create a basic controller

We need a page controller to output content to the page.

Here are the steps to create the basic controller for the module:

  • Create a folder within src called Controller.
  • Within the Controller folder, create a file called Hello.php.

In Hello.php, we will create a simple “hello world” message so that we know it is working.


  1. /**


  2.  * @file


  3.  * Contains \Drupal\hello\Controller\HelloController.


  4.  */

  5. namespace Drupal\hello\Controller;

  6. use Drupal\Core\Controller\ControllerBase;

  7. class HelloController extends ControllerBase {

  8. public function content() {

  9. '#type' => 'markup',

  10. '#markup' => t('Hello world'),

  11. );

  12. }

  13. }

Let's dive into the namespace line in this code.

Namespaces

You can see from the above code that the namespace has been defined as Drupal\hello\Controller.

You might be thinking that doesn’t exactly match the folder structure because if it did, the namespace would be Drupal\modules\hello\src\Controller.

The reason why modules\src is missing from the namespace is because namespaces for Drupal modules are automatically mapped to the module’s src folder. This is why it is critical that you follow this standard folder structure in modules(fn).

If you were to use this HelloController class in different namespaces, you would include it with the use keyword and its namespace.


  1. use Drupal\hello\Controller\HelloController

You can see this in action with the use statement in the example above. HelloController is extending another class called ControllerBase. In order to get access to that class, it has been added with it’s namespace via the following use statement:


  1. use Drupal\Core\Controller\ControllerBase;

If this use statement was not included, then PHP would be looking for ControllerBase in the current namespace (Drupal\hello\Controller). It wouldn’t find it there, so you would get a fatal error. So the use statement allows you make use of classes from other namespaces.

Add a route file

The controller we created above will not do anything at this stage. Let’s round this off by making it return the string when you hit a URL.

In order for a controller like this to be called and executed, it needs to map a route from the URL to the controller.

  • Create a file called hello.routing.yml
  • Add the following code to hello.routing.yml

  1. hello.content:

  2. path: '/hello'

  3. defaults:

  4. _controller: 'Drupal\hello\Controller\FirstController::content'

  5. _title: 'Hello world'

  6. requirements:

  7. _permission: 'access content'

View the content

If you now go to /hello, you will see the Hello World message that is being returned from the controller.

Namespaces in a nutshell

A namespace is a way of organising your classes into virtual folders and ensures that your class does not conflict with another class with the same name (the class name can be the same but the namespace is unique). The use keyword allows you to use classes from other namespaces when you need them.

Sep 29 2016
Sep 29

Hi Kevin - thanks for letting us get to know a bit more about you! Let's get started:

1. What’s your role at Mediacurrent, both internally and client-related?

I’m one of the Directors of Development here at Mediacurrent. Most of my day to day is ensuring clients have the right teams in place to meet their needs and ensuring the developers have what the support and resources to help our clients be successful.

2. Give us an idea of what professional path brought you here.

I came from the newspaper industry which was adopting Drupal back in the late Drupal 4, early Drupal 5 days. I was on the editorial team at the time and was brought in for the Drupal build to help ensure the CMS met the needs of the editorial team. In the end I ended up helping the dev team build the product and transitioned my career to full time development. Now I love being able to help newsrooms and media organizations use Drupal effectively for their ever-changing needs.

3. How did you first get involved with Drupal?

As rumblings of Drupal were coming at the newspaper I decided to try a personal project in Drupal. I hated it and thought it was way too complex for the simple project I was implementing. I dropped it and used Wordpress instead. Once I started using Drupal in a professional capacity I quickly saw its value and have never looked back.

4. Is there a go-to Drupal module that you like to incorporate whenever possible?

Recently my go-to has been Paragraphs and Field Group as I love the flexibility it gives for content editors and building dynamic content looks while still in the core node system. I also always like to include helper tools such as Admin Toolbar, Environment Indicator and Stage File Proxy.

5. Do you have any recommended reading or books that you would suggest to others?

I’m currently reading a great new book from a former coworker called “Lassoing the Sun” about a year in the National Parks. Single read books are my go-to instead of the long never ending series that have taken over recently and books that movies are based upon to see the contrasts.

6. Any mobile apps that you use regularly?

Besides all the typical social media (In ranked order: Instagram, Snapchat, Swarm, Untappd, Twitter, Facebook, all the others...) the most common apps I use are utility. Slack, Runkepper/Strava and Gmail are my most used. Also enjoy games such as Slither.io, DreamLeague Soccer and of course Solitaire.

7. What do you like to do in your spare time?

Since moving to New York at the beginning of the year I’ve been enjoying running a lot more. I also like exploring the parks, being outside and finding great places to eat out at. I used to do a lot of home renovation, some beer brewing, and volunteering at church in stage production.

8. What do you like about Mediacurrent?

Mediacurrent has a strong passion for helping not only our own team grow but clients as well. The team pushes clients to think of new ways of doing things, thinking of their problems but also internally pushes each other to learn and grow. Before I started a former employee said to me “You’ll learn more in the first six months at MC then in your entire career prior” and was completely right. You are always learning and always pushing yourself with a group of people that love what they do.

Awesome, thanks for being apart of the Employee Spotlight series! 

S'more Spotlights
Meet Matt Davis
Meet Nathan James
Meet Jeff Diecks

Sep 29 2016
Sep 29

29 Sep 2016

As DrupalCon Dublin 2016 approaches the end we thought it would be great to tell you everything about Dries’s keynote in case you could not be present to listen to him speak.

Introduction by Megan Sanicki

The Executive Director at Drupal Association Megan Sanicki began the keynote. She emphasized on Drupal Association’s mission and said that she would further be working to unite the community so that we build and promote Drupal.

Individuals and Businesses together making Drupal great

She told about how individuals and businesses are working together to make Drupal great. There are many instances that support this

  • Hubert Burda Media based out of Germany fell in love with Open Source and Drupal. They came together with competitors and created Thunder, a Drupal 8 distribution for professional publishers and made it available for everyone in the community
  • Appnovation has funded the development of Composer

Top 30 Contribution Sponsors

Megan talked about how in drupal.org now the contributors can attribute their contribution(s) to their employer, agency or client. Ever since this data has been tracked, interesting insights have been revealed. The following is the graph of top 30 contribution sponsors and we are proud to see Faichi’s name at the 9th position there.

Mathhew Tiff from Lullabot and Dries studied the data and found that 69% of contributions are sponsored. Also, 21% of contributions are sponsored by these 30 companies.

Journey to Drupal – Contribution and/or Adoption

Megan highlighted that Contribution or Adoption are the two ways in which one steps into Drupal. She said both the journeys need to be strong. Drupal Association has been helping in both sides of the journey by following methods.

  • Contribution Side
    • DrupalCon – Mentors, Sprints, Core Conversations
    • Drupal.org – Always On, Improved tools
  • Adoption Side
    • Future proof, an entire community is present to back on
    • Users are finding the information they need – testimonials, case studies etc. but could not find that on Drupal.org earlier, changed UI and UX of drupal.org would be helpful
    • DrupalCon is a great way to adopt Drupal via various training sessions targeted to beginners as well as experienced developers

Dries’s Keynote

Dries was welcomed on stage by Drew Gorton, Director of Community and Agency Outreach at Pantheon. As usual Dries taking over the stage was followed by loud applauds. Dries’s keynote was primarily categorized in two areas

  • Drupal 8 and Update
  • The WHY

Drupal 8 and Update

Dries announced that Drupal 8.2 is set to be released on 5th Oct 2016. It would come with a lot of new features.

  • Block Placements – Till Drupal 8.1 one had to identify the region in which the block needs to be placed, then go to the backend, identify the block to be placed and specify the region there and go back to homepage again to see the changes. In Drupal 8.2 no need to go through this entire process, just identify the region on the page itself and place the block right there.
  • Changing a Menu – In Drupal 8.2 we have a settings tray that provides an Outside In experience of editing the menu. Settings Tray appears right on the page and the changes done in the menu can be seen right there. This will be a real game changer in terms of usability.
  • REST API Improvements – Making them more robust and easy to use. 
  • Migration Improvements- Migrate path from D6 to D7 and D7 to D8 has been improved significantly. In an example Dries migrated his own D7 site to D8 in just 10 minutes. Interesting to see that this migration leaves D7 site intact. The UI provided migrates all the configurations and the content to D8. It does not migrate any legacy tables.

Dries talked about certain implementations where Drupal 8 is leveraged to create amazing digital experiences 

  • Drupal 8 is going to power the Digital Kiosks of New York Subway system
  • Vodafone’s in store kiosks would be all centrally managed powered by Drupal. In Europe alone they have thousands of such kiosks
  • Lufthansa’s in-flight entertainment system would be powered by Drupal 8

Strategic Initiatives

Based on the survey data there have been certain areas that have been strategically chosen to work upon

  • Blocks and Layout
  • Migrate
  • API First
  • Workflow
  • Settings Tray

How did we achieve this much progress?

  • Scheduled releases – A new release every 6 months
  • Semantic versioning – New features and easy upgrades
  • Experimental modules – Idea -> Alpha -> Beta -> Stable [Easy upgrade path for new modules]

Some new ideas

  • Default content to be available once Drupal has been installed
  • Settings tray to be used in different parts of Drupal
  • Media initiative – Building prototype to improve assets management in Drupal
  • Field Layout or Content Type Layout for enhanced experience
  • Refreshless – Reduces UI gap between native and web apps.

The WHY

Dries mentioned about his recent holiday to Tuscany. This holiday without internet for a week gave him time to reflect on the journey so far. Code was Dries’s passion and motivation initially to work on Drupal, over the years it has definitely changed, “My passion evolved beyond Code to include People and Impact”.

Dries recollected some of the meaningful moments in his life

  • Knowing that Drupal has changed people’s life, “When people find Drupal it gives them a better career path”
  • Seeing Drupal used for Aid Relief: DrupalCon Portland 2013 - People building Drupal to be used to provide aid for people hit by tornado
  • Keeping the web open – Drupal and the community’s contribution to this
  • Some other meaningful moments
    • Fund raising after the Great Server Meltdown
    • When Dries had to ask individuals to leave the project
    • The development of Drupal 8 – Hard work of many people across 4.5 years

Dries talked about how we find meaning when our work results in life changing outcomes for others. He explained this in context of the Happiness Hypothesis as illustrated below.

How do we scale the impact of the project?

Towards the end Dries also mentioned about some initiatives that are highly appreciable and are working towards scaling the impact of Drupal

  • India’s Drupal Campus Ambassador Program – A program to have one or more Drupal Ambassador in universities to represent and promote Drupal and eventually help the students get a job in Drupal.
  • UK Drupal Apprenticeship Program – A program to provide Drupal boot camps to people who want to learn Drupal and very quickly get into Drupal workforce. They also have an in depth training program to train the disadvantaged but talented young people and place them in Drupal companies.  

Dries highlighted that “Collective purpose is what sets Drupal apart”. As we all say, “Come for the code, stay for the community.”

Sep 29 2016
Sep 29

Third day of DrupalCon and the second day of the sessions was packed with awesome talks and interesting encounters at our Café Amazee booth.

Starting off my day with the first talk by Junaid Masoodi on Design Principles for MVP (minimum viable product). He covered the basic UX principles:

  • Unity / Harmon
  • Balance
  • Hierarchy
  • Scale / Proportion
  • Dominance / Emphasis
  • Similarity / Contrast

Showing examples like Evernote's or Airbnb’s onboarding screens, that users normally skip very quickly but still aim to give enough information on a company’s unique value and leaving a nice first impression.

The second talk I listened to was by Lauri Eskola about Drupal 8 theming in depth. Starting with an introduction to twig, covering basic syntax he dived deeper into some twig magic such as includes, twig blocks, embeds and building reusable component-based approaches. Stating that “Our deliverables should be systems, including components not pages”, meaning elements that are self-contained and nestable. The talk also included a high-level summary of Drupal 8 theming system and how it works in the backend.

audience

Packed with methodologies and hands-on examples on how to get over some everyday struggles as a frontend developer, I went on to listen to another talk on the frontend track. The speakers Nikhil Sukul and Vidit Anjaria talked about how to Animate your site. They began with a short history of animation on the web: from gifs how it first started to Flash in the nineties and to todays CSS3, Web GL and HTML5 animations. Continuing with the 12 animation principles, they spoke about the performance of specific animation options and attributes and ended their speech with straightforward examples.

Meanwhile, the HoloLens was a big success on our booth, a lot of people came by to search and destroy robots. Never done that? Then come by our booth and give it a try, it’s great fun!

hololenshololens

My third day at DrupalCon ended indulging in a very delicious dinner with the whole Amazee DrupalCon crew at Opium. A restaurant in the hub of Wexford Street, serving top-notch Thai and Vietnamese food. Beautiful interior and sparse lighting completed the impression but see for yourself on the picture, or better go check out their fantastic food!

opium-restaurant-bar

Sep 29 2016
Sep 29

My fingers are trembling typing this. I can't believe it. This morning everyone in Annertech land is thinking "did that really just happen?" It appears it did, we are the web agency of the year!

Last night, to top off the other three awards we won - best arts and culture website, most beautiful website in Ireland, and best website - we then went on to win Best Web Agency 2016.

Speaking to accept the award, Alan Burke thanked the great team we have in Annertech and our fantastic clients who trust us with such important work.

Afterwards, Stella Power had the following to say, "it's just amazing. I always knew we had a great team. We work so well together, we get on so well, we're not co-workers or colleagues, we're friends. And when working with your friends it's much easier to do great work. This award vindicates everything we've been doing to make Annertech the agency it is".

Please join me in congratulating Annertech on this fantastic news. Annertech: Web Agency of the Year 2016.

Sep 29 2016
Sep 29

We knew Ireland.ie (built by Annertech on Drupal) was a special website. The design is beautiful thanks to the amazing work of BigO Media, the content, media, and experience is second to none thanks to the the team in the Ireland.ie office at the Department of Arts, Heritage and the Gaeltacht. The implementation is without flaw (if we say so ourselves!).

Last night at the Realex Web Awards 2016 ireland.ie was nominated in two categories: "Best Arts and Culture" website and "Most Beautiful Website in Ireland". It won both. Were we happy? We were ecstatic but that was increased moments later when we won the Grand Prix, the overall winner for "Best Website in Ireland" 2016. Congratulations ireland.ie - winner of three awards!

As well as the above awards we (Annertech) won one more - WEB AGENCY OF THE YEAR 2016. That was just amazing!

Sep 28 2016
Sep 28

Keynote

Yesterday, Emer Colemandiscussed technoethics and what it means for both creators of technology platforms and society as a whole. Technology platforms and leaders (plus the large volumes of personal data) are a potentially dangerous combination for exploitation. 

Emer touched on the importance of democratic activism as a means of keeping these platforms and government policies in check. The takeaway message, for people who develop and work on these platforms, is to keep asking questions. Who does the work affect, what might be the consequences of that work and if, with reasonable explanation, would the average person affected be able to comprehend and accept the results of the new feature or product?

Why JSON API Matters

Mateu Aguiló Bosch delivered a superb overview of why JSON API matters to modern day software development. Not only does it reduce the amount of time consuming discussion around standards and other details (aka ‘bikeshedding’), but it also provides a common manner for other JavaScript based libraries, frameworks or connected applications to exchange data in a more efficient manner. 

Drupal 8 modules permit the ability to expose entities via the JSON API standard, and because configuration is now entity based, it potentially creates the ability to administer Drupal over an API. This could be very useful in decoupled applications, if you want to retain a single point of administration in a related application, but want to avoid giving administrative access to the native Drupal backend. 

Minds were blown at this prospect. Ok, ok… probably just Johan’s! To top it up, libraries such as the JSON schema generation, or schemaform.io allow for self-generated API documentation and useful user interfaces for interacting with the API. We foresee lots of nice projects in this area in the near future.

How to Create Self-organising, Happy, Distributed Teams

Tom and Johan attended a BoF talk on ‘how to create self-organising, happy, distributed teams’. A lively discussion ensued and some common trends indicated that as agencies expand, traditional ways of organising teams (back end/front end development, design, marketing) can lead to inefficiencies and bottlenecks. 

A common thought pattern, is to explore the implications of creating smaller, focused teams within the organisation. The aim being to bring back the flexibility, accountability and client services that smaller agencies traditionally have. It’s not all plain sailing though and some common pitfalls include how to ensure accountability, quality, freedom and efficiency is retained without losing sight of the main organisational goals and objectives. For remote workers and teams, tools such as Screenhero received a nod and old favourites like Google Hangouts and Skype are still popular.

Practical Caching in Drupal 8

I learned lots from the ‘Practical caching in Drupal 8’ session. Much discussion was had relating to Drupal 8’s lazy builder functionality, which allows dynamic page components to be loaded at the latest possible opportunity and cached for as long as is reasonably possible. 

The cache bubbleability (hierarchy and dependencies over multiple levels) and the different variations (such as cache keys) were explained in a simple, yet effective manner. The code examples provided a few a-ha! moments and were well received. Another hat tip was given to the Renderviz module which helps to visualise and debug complex caching issues, as well as the webprofiler module/toolbar that has been inherited from Symfony

Automating Quality Tools into the Development Workflow

Bas van der Heijden from Dutch Drupal agency Immer gave a thorough and comprehensive overview of automating quality tools into the development workflow. 

Tools such as PHP code sniffer, PHP mess detector, SASS linters, JS linters and package managers such as composer, bower and npm are all marshalled by a task runner such as grunt or gulp. Your preference for any of these tools is purely subjective. By enforcing strict standards and performing static analysis of code, the quality of code produced is improved. Bas’ recommended workflow is oriented around merge requests (pull requests for Github fans) - which not only encourages code review but it simultaneously kicks off automated deployments… reducing developer involvement in what can be error prone, manual deployments. 

Interestingly, Bas’ team employ one code repository for development and another, totally separate repository for build artifacts and deployment. Separating concerns reduces complexity and makes it easier to roll back any problematic deployments. Bas also recommend Gitlab for it’s nice UI, features for continuous integration workflows and event issue tracking. 

Questions?

We'll be back again tomorrow, to share highlights from day 3. If you have any questions for our dedicated DrupalCon team, why not message them on Twitter. @joblogs83, @wigglykoala, @rupertjabelman, @zerolab, @tomreadings and @rosenichols are more than happy to answer any questions you have. 

Sep 28 2016
Sep 28

Body: 

Getting off the island

As a back-end developer, one of the surprising and fun things about this Drupalcon is how much I have learned about front-end and theming in Drupal. This has been my way of "getting off the island" and learning about things a little outside my normal comfort-zone.

The kitchen table track at Drupalcon Dublin

There were two things that were the impetus for this. Firstly, I came to Dublin with Pascal https://www.drupal.org/u/hydra who works with us at erdfisch as our front-end development expert. I spent the weekend learning (and documenting) our approach to rendering content in flexible ways to achieve more sophisticated output of content than Drupal usually allows. In a nutshell, this allows us to provide very sophisticated front-end design.

The module driving this is called "seem". We were working on it this morning at the kitchen table.

Exam time

The second thing that happened was that Stefan https://www.drupal.org/u/sanduhrs and I decided to jump in and take the Drupal 8 Acquia Certified Developer Exams. Stefan has passed the two Drupal 8 Exams this week (Acquia Certified Drupal 8 Site Builder and Acquia Certified Developer Drupal 8 Front-end Specialist).

I passed the Acquia Certified Drupal 8 Site Builder and am taking the Front-End Specialist exam tomorrow morning. Wish me luck!

All this has, of course, given me lots of motivation to go to sessions related to front-end and theming this Drupalcon. More to come on that in another blog post.

Sep 28 2016
Sep 28
DrupalCon Dublin Keynote

This week is DrupalCon Dublin. And as always, Dries gave the keynote address on the first morning of the event.

This year's keynote was broken into two sections: "Drupal 8 Update" and "The Why".

In "Drupal 8 Update", Dries talks about the technical side of Drupal. From minute 27 to minute 42, Dries talks about what's new in Drupal 8.2, which arrives on October 5th. We've covered those new features in previous posts. Then, from minute 42 to 48, Dries discusses features may arrive in future Drupal versions. If you're short on time, watch those 6 minutes. Scroll down in this post, and we'll cover those 6 minutes in detail.

In "The Why", starting at minute 40, there's a much broader focus on the larger purpose of Drupal. This section of personal anecdotes and stories of Drupal in action.

Here's the video of the keynote:

[embedded content]

New Drupal 8 Ideas: Sample Content 

Angie Byron from Acquia also talked about this in her excellent Drupal Dublin talk. The sample data in Drupal really is not user-friendly and needs to be improved to welcome new users more effectively.

sample content improvements in Drupal 8

New Drupal 8 Ideas: Page Layout

In short, this looks like it would be a simpler and more elegant version of the Panels module in the Drupal core:

layout improvements in Drupal 8

New Drupal 8 Ideas: Media

I suspect this is the number one most requested feature amongst Drupal users. And there's already a long, detailed discussion on improving Drupal's image handling.

media improvements in Drupal 8

New Drupal 8 Ideas: Field Layouts

We've already seen a Panels-like idea. This sounds more like the Display Suite module.

field improvements in Drupal 8

New Drupal 8 Ideas: Refreshless

This aims to drastically reduce page load time, and is something we've covered on the OSTraining blog before.

refreshless improvements in Drupal 8

As some or all of these feature arrive in the Drupal 8 core, we'll be sure to cover them here at OSTraining.


About the author

Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. He was a teacher for many years before starting OSTraining. Steve wrote the best-selling Drupal and Joomla books.

View the discussion thread.

Sep 28 2016
Sep 28

As a former tech journalist I am well experienced in attending conferences all around the world, so I was very excited to attend DrupalCon Dublin on the behalf of Deeson.

With DrupalCon, it was a great opportunity to learn more about Drupal straight from the mouths of a thriving community. But with the ‘Future of Work’ approach being one of a number of reasons I decided to join the company, it was a great opportunity to share our message and the way people can thrive at Deeson with its openness, autonomy, flexible working, paid sabbaticals and paid time to contribute to the community.

DrupalCon Europe was very different to the conferences that I’ve experienced in the past in that instead of the slickness of a warm-up act with sales patter and a costly presentation, I was presented with fun and games from the Drupal community, including a singalong, viking claps, and some Irish dancing. Already I could tell this would be different experience to the tech events I’ve been used to.

An early morning Irish jig to get us ready for the #DrupalCon Dublin sessions today. #morningexercise pic.twitter.com/r0gQWlCOUQ

— Asavin Wattanajantra (@Asavin) September 27, 2016

This was great preparation for the day, and the first presentation I saw was a powerful keynote by the founder and lead developer of Drupal Dries Buyteart about how wide and far the community stretched, and how it gave opportunities in terms of a career around the world.

Below is a video of the keynote, and is certainly inspiring for anybody thinking of getting into Drupal, whether it’s as a developer or non-technical person like me as a marketer, a project manager, or business developer.

[embedded content]

This is how the rest of the week will shape up.

Sep 28 2016
Sep 28

It is on! DrupalCon Dublin has officially started and it's going to be epic.

The second day at DrupalCon started early with the in-famous prenote. After a long first day setting up our gorgeous booth, exploring the convention center, meeting new and old friends, a lot of hugs and a fabulous finish at the Amazee Storyteller and Gravedigger bus tour the early timeslot of the prenote was a challenge for many. If you missed the prenote, you can watch the recording on Youtube. Look out for the Pot of Gold!

The room was packed for the Pre- and Keynote.

As usual, the Prenote was followed by the Keynote aka the “Driesnote”, in which Dries Buytaert, the founder of Drupal, gave an overview of the state of Drupal and its outlook for the future. You can watch the Keynote on Youtube too.

Dries giving the Keynote.

For me, the rest of the morning was packed with interesting discussions and code sprints around GraphQL for Drupal. If you are interested to hear more about that or get involved, find me at our booth or in the sprints room.

Sprinting with the Drupal community.

I fueled my sugar addiction with an unhealthy amount of Amazee lollipops at our gorgeous booth during the breaks. If you want one too, come by our booth and find one of our lollipop dealers.

In the afternoon the sprinting continued and I got to show off our Microsoft HoloLens to a couple of people.

Showing off the HoloLens to our friends.

If you are interested and want to give it a try, come by our booth. It's fun, I promise!

 

Sep 28 2016
Sep 28

It is probably no secret that we are one of the bigger contributors to Drupal (definitely the biggest when company size is taken into consideration). Contribution is part of our daily routine. Every time when we run into a problem that can be resolved in a general/community way we try to do that. Our developers are active in the issue queues on a daily basis. Working in the drupal.org issue queue is as common as checking new messages on our company’s Mattermost channels.

We often lead long-running focused initiatives

On a daily basis, while working on client projects, one is able to do a lot, but still not enough to push forward bigger initiatives and changes. In order to be able to do that too we regularly lead long-running focused initiatives. Examples of such initiatives are Media, Translation management, CRM and more.

Our focused initiatives helped push forward a lot of critical subsystems in Drupal 8. Due to the success of our past work we’re convinced to continue with similar activities also in the future.

Clients and community both benefit from the MD System’s commitment

At MD Systems we feel responsible towards the community. We believe that we and our clients are going to be successful if the Drupal community will be successful too. As a client, by working with a service provider that is heavily involved with the community, you benefit in form of constant innovation, hassle-free updates, continuous deployments of latest functionality and generally better experience.

Because of that we strive to invest 20% of every project’s value back into the community. Let’s put it that way. If you hire MD Systems to do your next Drupal project, audit your site, organize a training or a bootstrap week, implement a Translation management translator plugin or DAM integration for media ecosystem community will directly benefit from that.

If you are interested in our work do not hesitate to contact us and if you’d like to hear more about the things we’re currently focused at follow our blog as we’re preparing some more exciting stuff for you in the following weeks.

Are you at DrupalCon Dublin? So are we. Poke Sascha Grossenbacher (@berdir) or Janez Urevc (@slashrsm) if you’d like to meet us there.

Sep 28 2016
Sep 28

In the past, after every major release of Drupal, most innovation would shift to two areas: (1) contributed modules for the current release, and (2) core development work on the next major release of Drupal. This innovation model was the direct result of several long-standing policies, including our culture of breaking backward compatibility between major releases.

In many ways, this approach served us really well. It put strong emphasis on big architectural changes, for a cleaner, more modern, and more flexible codebase. The downsides were lengthy release cycles, a costly upgrade path, and low incentive for core contributors (as it could take years for their contribution to be available in production). Drupal 8's development was a great example of this; the architectural changes in Drupal 8 really propelled Drupal's codebase to be more modern and flexible, but also came at the cost of four and a half years of development and a complex upgrade path.

As Drupal grows — in lines of code, number of contributed modules, and market adoption — it becomes harder and harder to rely purely on backward compatibility breaks for innovation. As a result, we decided to evolve our philosophy starting after the release of Drupal 8.

The only way to stay competitive is to have the best product and to help people adopt it more seamlessly. This means that we have to continue to be able to reinvent ourselves, but that we need to make the resulting changes less scary and easier to absorb. We decided that we wanted more frequent releases of Drupal, with new features, API additions, and an easy upgrade path.

To achieve these goals, we adopted three new practices:

  1. Semantic versioning: a major.minor.patch versioning scheme that allows us to add significant, backwards-compatible improvements in minor releases like Drupal 8.1.0 and 8.2.0.
  2. Scheduled releases: new minor releases are timed twice a year for predictability. To ensure quality, each of these minor releases gets its own beta releases and release candidates with strict guidelines on allowed changes.
  3. Experimental modules in core: optional alpha-stability modules shipped with the core package, which allow us to distribute new functionality, gather feedback, and iterate faster on the modules' planned path to stability.

Now that Drupal 8 has been released for about 10 months and Drupal 8.2 is scheduled to be released next week, we can look back at how this new process worked. Drupal 8.1 introduced two new experimental modules (the BigPipe module and a user interface for data migration), various API additions, and usability improvements like spell checking in CKEditor. Drupal 8.2 further stabilizes the migration system and introduces numerous experimental alpha features, including significant usability improvements (i.e. block placement and block configuration), date range support, and advanced content moderation — among a long list of other stable and experimental improvements.

It's clear that these regular feature updates help us innovate faster — we can now add new capabilities to Drupal that previously would have required a new major version. With experimental modules, we can get features in users' hands early, get feedback quickly, and validate that we are implementing the right things. And with the scheduled release cycle, we can deliver these improvements more frequently and more predictably. In aggregate, this enables us to innovate continuously; we can bring more value to our users in less time in a sustainable manner, and we can engage more developers to contribute to core.

It is exciting to see how Drupal 8 transformed our capabilities to continually innovate with core, and I'm looking forward to seeing what we accomplish next! It also raises questions about what this means for Drupal 9 — I'll cover that in a future blog post.

Sep 28 2016
Sep 28

Republished from buytaert.net.

In the past, after every major release of Drupal, most innovation would shift to two areas: (1) contributed modules for the current release, and (2) core development work on the next major release of Drupal. This innovation model was the direct result of several long-standing policies, including our culture of breaking backward compatibility between major releases.

In many ways, this approach served us really well. It put strong emphasis on big architectural changes, for a cleaner, more modern, and more flexible codebase. The downsides were lengthy release cycles, a costly upgrade path, and low incentive for core contributors (as it could take years for their contribution to be available in production). Drupal 8's development was a great example of this; the architectural changes in Drupal 8 really propelled Drupal's codebase to be more modern and flexible, but also came at the cost of four and a half years of development and a complex upgrade path.

As Drupal grows — in lines of code, number of contributed modules, and market adoption — it becomes harder and harder to rely purely on backward compatibility breaks for innovation. As a result, we decided to evolve our philosophy starting after the release of Drupal 8.

The only way to stay competitive is to have the best product and to help people adopt it more seamlessly. This means that we have to continue to be able to reinvent ourselves, but that we need to make the resulting changes less scary and easier to absorb. We decided that we wanted more frequent releases of Drupal, with new features, API additions, and an easy upgrade path.

To achieve these goals, we adopted three new practices:

  1. Semantic versioning: a major.minor.patch versioning scheme that allows us to add significant, backwards-compatible improvements in minor releases like Drupal 8.1.0 and 8.2.0.
  2. Scheduled releases: new minor releases are timed twice a year for predictability. To ensure quality, each of these minor releases gets its own beta releases and release candidates with strict guidelines on allowed changes.
  3. Experimental modules in core: optional alpha-stability modules shipped with the core package, which allow us to distribute new functionality, gather feedback, and iterate faster on the modules' planned path to stability.

Now that Drupal 8 has been released for about 10 months and Drupal 8.2 is scheduled to be released next week, we can look back at how this new process worked. Drupal 8.1 introduced two new experimental modules (the BigPipe module and a user interface for data migration), various API additions, and usability improvements like spell checking in CKEditor. Drupal 8.2 further stabilizes the migration system and introduces numerous experimental alpha features, including significant usability improvements (i.e. block placement and block configuration), date range support, and advanced content moderation — among a long list of other stable and experimental improvements.

It's clear that these regular feature updates help us innovate faster — we can now add new capabilities to Drupal that previously would have required a new major version. With experimental modules, we can get features in users' hands early, get feedback quickly, and validate that we are implementing the right things. And with the scheduled release cycle, we can deliver these improvements more frequently and more predictably. In aggregate, this enables us to innovate continuously; we can bring more value to our users in less time in a sustainable manner, and we can engage more developers to contribute to core.

It is exciting to see how Drupal 8 transformed our capabilities to continually innovate with core, and I'm looking forward to seeing what we accomplish next! It also raises questions about what this means for Drupal 9 — I'll cover that in a future blog post.

Sep 28 2016
Sep 28

With Drupal 8 now adding new features on a regular release cycle, the Drupal 8 committers identified the need for additional release management. Today I am announcing that Chris McCafferty (cilefen) has accepted my invitation to be provisional Drupal 8 committer.

Chris is a United States-based web programmer at the Institute for Advanced Study who has worked with Drupal and the Symfony framework for over four years. He is also a core mentoring coordinator who has put in uncounted hours mentoring contributors in person and on IRC and has lead major issue triage sprints at DrupalCons in Los Angeles and New Orleans. In addition, Chris spreads the word about Drupal by mentoring at other events, such as OpenHatch Princeton.

Chris makes significant contributions to a wide variety of Drupal core issues. If you have worked in the issue queue in the last few years, you have probably interacted with Chris on topics ranging from front-end to the testing frameworks. He has the attitude and skills needed to foster collaboration among the talented contributors in the Drupal community and to continue releasing Drupal on time. Please join me in welcoming Chris.

Sep 28 2016
Sep 28

Being accountable for the planning, execution, and delivery of a project is demanding. Managing people, facilitating communication, resolving conflict, and mitigating risk are prerequisites to completing on schedule, and within an agreed budget. Add to this the often unpredictable nature of these factors and it's little wonder that project managers feel a great burden of responsibility.

This article first appeared on OpenSource.com in September 2016.

Those suited to such a role are acutely aware of this responsibility and it's something they take on quite willingly. They perceive the role of a project manager as a guardian presiding over a project in order to protect it from failure. They are the last line of defense, willing to take the fall should something go wrong. It's an admirable position of leadership they seek to adopt, but the responsibilities attached to it can become overwhelming for even the most seasoned practitioners.

That's why I think they need to lose control.

Chasing waterfalls

Software-driven projects are rarely predictable. Initial requirements may prove difficult to implement, or, on reflection, prove to be the wrong approach. People are also fallible and can behave irrationally under pressure. Those project managers who fail to recognise these contributing factors and make allowances for them are simply battling the forces of nature that ultimately derail many projects.

In truth, failure is very likely an outcome at many stages of a project, so project managers' tendency to implement strategies for avoiding it when they feel ultimately responsible seems natural. It's easy for them to believe that the more predictable and orderly things are, the less likely it is that failure will befall their project. So preparing a detailed and prescriptive plan for the work required to complete the project seems like a good place to start.

The more traditional and predictive waterfall model is one safety net managers have used for many years as they seek greater levels of security. It's a time honoured approach, and it's an especially common theme for project managers involved in software development.

Faced with commercial pressures to meet deadlines and work within the bounds of restrictive procurement rules, project managers are also averse to change. They seek predictability and produce project artifacts like gantt charts, interface designs, and technical specifications that endeavour to precisely define project outcomes. They see them as a blueprint for success and use them as a weapon against anything that may threaten it.

But the more project managers seek certainty, the more they endeavour to control the factors that may affect it. Those that receive the most attention tend to be the people around them—those responsible for producing the outputs a project requires. Suddenly, strict boundaries constrain the project team, and managers encourage that team to avoid deviation. They direct all of the team's efforts to appeasing stakeholders expecting a predefined outcome.

Whist these behaviors may be understandable products of the pressure brought to bear on the project, the project manager creates an environment in which change is perceived as a highly disruptive occurrence. Thus, the reengineering of supposedly precise specifications and delays to a fixed schedule are unacceptable. Original plans become inflexible, and project teams are subject to close scrutiny in order to ensure overall compliance with it.

The much better alternative is to take a more agile, collaborative approach—where responsibility is distributed, failure is not feared, and change is recognised as a constant. It's a more common-sense approach that better accommodates the human factors that so strongly influence the success or failure of a project.

Begin with culture

Yet, project managers unaccustomed (or even unaware) of this alternative require a fundamental shift in mindset. Overcoming the desire for a prescriptive approach is not easy. Many are trapped in staid business environments where tradition dictates practice, and the appetite for change is low.

Fortunately, more managers are recognizing the appeal of Agile approaches to project delivery. And they're heavily promoting these across the business sector while adoption in government is strengthening. People acknowledge Agile approaches as a good way to increase value, foster a greater level of engagement with users, produce better products and services, and increase the well being of the teams who produce them.

The trend itself is good leverage for project managers who wish to move toward more Agile practices. Even small measures to become more agile can benefit their projects. They should better harness their leadership abilities to influence key stakeholders and managers. If possible, they should also seek to be more involved in the procurement process and negotiate a more Agile approach at this early stage of the project.

The key message for project managers seeking a change is that you need to work on developing the right mindset both for yourself and those around you. Facilitate more collaboration, empower individuals to take on more responsibility, and encourage your teams to become more self organised. Stop obsessing about plans or processes and guide your projects rather than trying to control them.

You might even find your team celebrating your next project as something enjoyable—not just something that's over.

Agile
Sep 27 2016
Sep 27
  • The obligatory keynote from Dries Buytaert (creator of Drupal) focussed on how Drupal has changed since releasing version 8. The latest release, 8.2.0, brings features that aim to reduce the amount of context switching and complexity for managing things such as blocks, menus and even layouts.

  • Finding out how centralised media management is being planned and delivered for Drupal 8.

  • Discovering how projects such as BigPipe and RefreshLess can be used to improve the perceived performance of a complex website, and how Drupal 8 is geared to handle selective caching of dynamic content far better than ever before.

  • Streamlining frontend (FE) for larger projects by sharing twig templates between Drupal and Patternlab, allowing Drupal-agnostic FE whilst minimising code repetition, and mapping Drupal components to atomic design principles.

  • Being fully sold on using Docker for local Drupal development, unless you are on a Mac. Macs have some teething issues which are being worked on. The docker configuration files are very straightforward.

  • An interesting battle of the cache systems. The Drupal 8 ChainedFastBackend is a new caching mechanism that allows you to chain a fast in-memory backend and a consistent backend chain. But it suffers from clearing out entire cache bins when only one item changes. Solutions like LCache fix that. LCache aims to become a default for future versions of Drupal.

  • Using Drupal console (in particular interactive scaffolding) to enable junior developers to 'self-train' in their own language and to allow those new to Drupal 8, to learn it ‘from the inside out’. 

  • It is paramount to automate mundane processes such as security updates. Other companies in the field are also of the opinion that highly critical security update should be applied, then tested, rather than having to clean up a compromised site.

  • Scheduled/timeboxed releases have helped Drupal regain focus and deliver great features again. This is something that Wagtail uses and benefits from too.
  • Sep 27 2016
    Sep 27

    There may be a need to name the form elements in an array structure how the form is built. You can see this in Ubercart checkout pane form's input elements. This is very useful when one has a large multi-part form which can be grouped easily by their POST content's array format.

    Eg: panes[delivery][delivery_first_name]
    

    A simple flag on you $form construct array will do the trick. It's the #tree option. For whichever elements you set this #tree option, the element's children will be named with full reference to its parents.

      $form['panes'] = array('#tree' => TRUE);
      $form['panes']['delivery'] = array(
          '#type' => 'fieldset',
          '#title' => t('Delivery Address'),
          '#attributes' => array('id' => 'delivery-pane'),
      );
      $form['panes']['delivery']['delivery_first_name'] = array(
          '#type' => 'textfield',
          '#title' => t('First name'),
      );
    

    Here, delivery_first_name input element when rendered will have a name = "panes[delivery][delivery_first_name]", as one of it's parent is have #tree set to TRUE. Hope this helps someone looking to implement a similar functionality.

    Sep 27 2016
    Sep 27

    Configuration Management: Theory and Practice

    Andrea Pescetti

    27 Sep 2016

    0 Comments

    Andrea Pescetti

    27 Sep 2016

    0 Comments

    Andrea Pescetti, 27 Sep 2016 - 0 Comments

    Our presentation at DrupalCon Dublin 2016

    Developers often want to use Configuration Management outside its intended use case. New workflows and practices have to be established.

    We've just presented a gallery of problems and solutions at DrupalCon Dublin 2016.

    The room was packed, and many people were denied admission for security reasons. For them, and for those who didn't manage to come to this DrupalCon, we are making the full presentation available here:

    [embedded content]

    Configuration-Management-Theory-and-Practice.pdf (2.41 MB)Download
    Sep 27 2016
    Sep 27
    Whether you’re outside China and trying to get in, or inside China and trying to get out, a well-known barrier sits between the Chinese internal network and the wider internet. The Great Firewall of China (防火长城) acts as a giant filter between the two networks, restricting access to external sites considered unsavory by the Chinese government.
    Sep 27 2016
    Sep 27

    Last week, the Third & Grove and SRI teams worked to relaunch SRI.com with a new site design and content architecture.

    SRI relaunch

    We are thrilled to see this design go live, which represents a front-end refresh, as well as a back-end rebuild. As is often the case, the legacy SRI site was having issues scaling, creating problems for the marketing and biz dev teams, so the TAG team focused on re-architecting SRI's Drupal instance to allow for future content marketing flexibility, in addition to a custom Salesforce integration for tracking leads.

    This project was especially fun for our team given SRI's contribution to the world of technology—from inventing the computer mouse to registering the first domain names (not to mention inventing Apple's Siri)—working with SRI has been a #nerds dream come true :)

    Special thanks to Abby, Ross, Ed, Max, Alicia, Antonella, Damia, Mike D, Melissa, Kristina, Ramya, Maricris, Mike L, Mickey, Mike T, Katie and Rebecca for their amazing work on this project.

    Sep 27 2016
    Sep 27

    Since the community wants to make it easier to build decoupled apps, in front of Drupal, we need an easy way for developers to do it.

    This post is loosely based on https://github.com/firebase/polymerfire, which integrates Firebase with Polymer

    Why

    • To make it easy for developers to connect to Drupal without any knowledge.
    • All components work without any custom javascript, only html and css is needed.
    • Can be cached offline (app and data, both read and write)
    • Works on desktop/mobile
    • Works on Chrome, Firefox, Safari, Edge

    Components

    Drupal app

    
    <drupal-app
      url="https://drupal.org/"
      api-key="eiQezleFsV2WddFBAhF">
    
    

    Set ups the basics to connect to a Drupal backend.

    Drupal login

    Based on https://customelements.io/convoo/login-fire/

    
    <drupal-login id="auth" user="{{user}}" signedIn={{signedIn}} email-password></drupal-login>
    
    

    Renders a form so a user can login with username/password, if the user is already authenticated the session is refreshed.

    Drupal entity

    
    <drupal-entity uuid="uuid" fields="" data="{{node}}" />
    
    <template node="{{node}}">
      <article>
        <h1>[[node.title]]</h1>
        [[node.body]]
      </article>
    </template>
    
    

    Fetches an entity from the backend with the given uuid, the user can specify a list of fields that needs to be returned.

    Drupal views

    
    <drupal-view 
      path="/my-view/[[optional-parameter]]"
      limit=10
      pager|no-pager
      data="{{items}}" 
    >
    
    <ul>
      <template is="dom-repeat" items="{{items}}" as="node">
        <li>[[node.title]]</li>
      </template>
    </ul>
    
    

    Fetches a list of entities

    Drupal entity query

    
    <drupal-query 
      path="/api/node/[[optional-parameter]]"
      limit=10
      pager|no-pager
      data="{{items}}" 
    >
    
    <ul>
      <template is="dom-repeat" items="{{items}}" as="node">
        <li>[[node.title]]</li>
      </template>
    </ul>
    
    

    Fetches a list of entities

    Form components

    To make it easy for developers to add input/edit screens, we need components for common widgets as well, for example <drupal-autocomplete> or <drupal-entity-reference>

    GraphQL

    https://www.drupal.org/project/graphql might be used to make it easier to integrate polymer with the standard REST drupal backend, so a developer can use GraphQL to query the Drupal backend and adjust the query.

    Sep 27 2016
    Sep 27

    It's this time of the year again. DrupalCon Dublin is finally here. Even though it's my fourth Con already, it's always a special event.

    The conference officially only starts Tuesday but Monday for me Monday is the more important day. It's the day of setting up our booth, making sure all things arrived and in the evening there was our Amazee Story Telling Tour around Dublin. They say a picture says more than 1000 words so here are some impressions of my DrupalCon Monday:

    setting up

    settin up2

    booth last steps

    Once the booth was set up we enjoyed the welcome reception. By the way, if you want to see the finished booth make sure you come by and meet us at the exhibit hall; we're at booth 700.

    fhuby

    inky

    To finish off the day we ventured out on our Story Telling Tour learning about Irish Tales.

    sstt

    stt

    sttd

    tt

    Sep 26 2016
    Sep 26

    Earlier this month Acquia put on a great webinar hosted by Angie Byron & Gabor Hojtsy titled All You Need to Know About Drupal 8.2 and Beyond (slides linked below).

    There were many topics covered and I could not help but get super excited for some things we can look forward to in the upcoming release of Drupal 8.2 slated for October 5th 2016.

    Below are some takeaways I found particulary cool and wanted to share:

    Migrate in Core

    Currently we have a migrate UI available to us as a experimental core module. I have not played with this much to date but as a sitebuilder I am really excited to see efforts being made to develop a UI for this and bring it into core.  In previous migration efforts (using the migrate module) it was very much a job 100% slated for our devs and now I hope to be able to help with these efforts.  In Drupal 8.2 the migrate modules are still experemental but it looks like there was some mojor upgrades and a focus is being placed to get this out of experemental and into core sooner than later.

    Content Workflow

    Revision all the things! (well almost all the things)  The Content Workflow initiative is a result of Deploy and Workbench Suite of modules mantainers working together to bring this functionality into Drupal core.  These tools allow us to create/manage revisions and approval workflows for our content.  In Drupal 8.2 we are getting our first glimpse of this in core with the Content Moderation module added as an experimental core module for us to play with and provide feedback.  There is some really cool C.R.A.P. (create/read/archieve/purge) slated for this initiative down the road with things like Full-Site previews with "Workspaces".

    Block Layouts

    Some of you may remeber back in the early D8 beta days there being some work done on Block Layouts but it was pulled aong the way due to it not gong to be ready in time for launch.  Well in Drupal 8.2 we are getting a chance to see the some of this in action.  Again this is being released as a experemental core module. In 8.2 we will gain the ability to place blocks directy from the front end of the site and not have to access the blocks administration page.  This looks to be very much in line with how the inplace editor feels to an end user and an overall great usability improvement (especially for folks new to Drupal).

    There are many other greats things in the works for Drupal core slated for 8.3-8.4 that were presented.  API Improvements, Enhanced media management, Dream Fields/Data modeling, Pre Content Type Layouts, Swapable Layouts and Preview-First Views UI just to name a few.

    Check out the video/slides HERE for a full rundown and ways to help with all of these initiatives.

    Thank you Acquia, Angie & Gabor for the exciting update!

    Sep 26 2016
    Sep 26

    Search engine optimization and web accessibility are complementary processes. Focus on one and you likely positively affect the other without additional effort. First, let us define these terms:

    Search Engine Optimization is making your site discoverable by search engines and ranking as high as possible for various keywords and phrases.

    Web accessibility refers to the inclusive practice of removing barriers that prevent interaction with, or access to websites, by people with disabilities.

    On the surface, they may appear to be completely unrelated. Let us look at why that is not the case.

    Overlap between SEO and Accessibility

    Users with disabilities often need to access websites in different ways.

    • A person who is deaf cannot hear videos with audio or podcasts and needs to have captions and transcriptions in order to consume them.

    • A person who does not have the full use of his/her hands cannot use a mouse and must be able to click on a link or button with the keyboard or with additional assistive technology such as a sip and puff device or a switch.

    • And a person who is blind cannot use a mouse and cannot see the screen so must use screen reader software that reads a web page back to her.

    What does this have to do with search engines? Well, Google has many of the same limitations in accessing sites as people with various disabilities do.

    Google cannot hear the audio in a podcast or “watch” a video. It needs a text version in order to access the content. Google cannot click with a mouse. If a link or button or widget cannot be activated without a mouse, Google does not have access to it either. And if content is not in text format or marked up properly, Google cannot parse it. Essentially, you can consider Google to be a user who is blind, deaf, and mouseless.

    In a nutshell, both SEO and web accessibility hinge on the ability to access a site’s content and make sense of the content through its structure and the relationship between the individual bits of content. Let us look at each of these:

    Accessing a site’s content

    Google recommends checking your site with a text browser like Lynx because it is about how search engines would see. See Mastering Lynx for Search Engine Optimization.

    In order for a search engine or user who is blind or deaf (and various other disabilities) to access a piece of content, it needs to be in text format. Embedding text in an image or video or putting the content in audio format makes it inaccessible. Google cannot parse and index it if it is not text the same way a user with a disability cannot hear or see the content to access it.

    Making sense of content through its structure and relationship

    Getting the content into text is a step in the right direction but another step is needed in order to make the content truly meaningful. The content must be marked-up properly. Imagine taking a web page that has a lovely visual display, copying the words out of it and throwing them in a Word doc without any layout or formatting. For example, take a look at this demo page. Here is what we would see:

    This is the web page with visual layout and styling:
    A sample website with styling

    This is similar to what a search engine or person who is blind might get from the page if it were poorly marked up...one big blob of largely meaningless text:
    A sample site viewed without styling

    It is difficult to make sense out of each piece of text. If I am looking for the concert date and ticket price of The Obelisks, how do I find it in that mess of text?

    On the other hand, if the page were properly marked up, Google and the blind user would be able to discern what the main navigation is, what the topic of the page is, what the main content of the page is, what is superfluous information, what information the tables contain and what the contents of each cell in the table means. It is proper markup that gives search engines and screen readers the context they need to make sense of the text.

    • If the main menu is wrapped in a nav tag and contains a heading, this clearly communicates that the list of links is the main menu of the site. And as a blind user, I could easily click on the Tickets link in the main nav and expect to find the information I was after.
    
    <nav>
     <h2>Main menu</h2>
     <ul>
       <li><a href=”#”>Home</a></li>
       <li><a href=”#”>News</a></li>
       <li><a href=”#”>Tickets</a></li>
       <li><a href=”#”>Survey</a></li>
     </ul>
    </nav>
    • If headings are used properly, Google and the blind user can get a sense of the hierarchy of the page and what information is most important and how the bits of information relate to each other.

    • When the tables have a caption, their purposes are more clear and if the table rows and/or columns have headers, it is much easier to understand the contents of each cell. Here is a visual of what a screen reader user would have read to them when they bring up a list of tables on the page from our sample page:

    Example of how a screen reader would interpret a captioned table

    They could then navigate around in the table cells and find the information they were looking for thanks to the properly labeled headers in the table. Google is also more likely to be able to make sense out of the data.

    Benefits Beyond SEO and Accessibility

    Accessible and SEO friendly sites also have additional benefits:

    We can build sites that automatically rank better in searches just by paying attention to the markup we use, which also translates to a more accessible site.

    • Not only are sites easier to understand and use by search engines and users with disabilities, they are easier to use and understand by everyone! For example, users whose native language is not that of the site’s language, people with limited bandwidth connections, and people accessing the site on mobile devices all benefit.

    • Sites are also easier to consume in other formats. For example, having your phone read a website back to you while you are jogging or navigating a website while you are driving your car and interacting with the website via voice command - and touch and talking UIs are just the tip of the iceberg. More UIs are on the horizon in which people access your site in new ways. Building sites that are accessible and machine friendly makes it more likely that they will be compatible with those new ways.

    • Transcripts can be scanned faster than watching a video. This provides a better user experience which can translate into higher visit durations and more authority with Google. Transcripts and captions also help with on-page SEO by increasing density of targeted keywords and increase relevancy.

    • Accessible content also means better shareability on social networks. Sites become more meaningful and easier to parse for social networks.

    SEO and Accessibility Techniques

    So how do we make sites search engine friendly and accessible? Consider these techniques:

    Technique

    SEO

    Accessibility

    Follow W3C web standards. Validate your HTML. Validate your CSS. Validate your Feed.

    Makes sites easier to parse.

    Sites can be parsed more accurately.

    Use semantic markup for structure and programmatic clarity of content.

    For example, <main>, <header>, <nav>, <footer>, <aside>, <cite>, <abbr>, <small>, <blockquote>, etc.

    Makes sites easier to understand and gives context and relationship to content.

    Makes sites easier to understand and gives context and relationship to content.

    Set the page’s language in the html tag. For example:
    <html lang=”en-US”>

    This sets the language to U.S. English.

    The page will be indexed based on this language,

    Browsers can detect the language and offer to translate, and screen readers will read the text back in correct language with proper pronunciation.

    Use unique page names in the <title> tag. Best practice is to list a unique page title followed by a separator and then name of the site.

    Given a lot of importance in rankings and is what is used in the search engine listing. It can be customized to target specific keywords or queries.

    What is shown in the page’s browser tab, and is the first thing read out by the screen reader to tell a user what page they are on.

    Use headings to provide organization, structure, and relationships

    Use headings to denote the start of a new section (hide from visual display if necessary but keep available to screen readers).

    Helps define page structure and relationship between content and makes page easier to understand and digest.

    Defines programmatic start and ending of sections of a page and makes page easier to understand and digest. Also provides a way to navigate quickly around the site as screen reader users can bring up lists of headings and jump directly to the individual headings.

    Use lists to properly mark up ordered and unordered lists of items.

    Search engines see list items as related and sequential

    User can bring up a list of links to get a sense of the page content and also to use to navigate around the page quickly.

    Use alternative texts for images

    Search engines can not “see” images and rely on the text version of the image to be conveyed in the image’s alt attribute.

    Users with visual impairments can not always see the images and rely on the text version of the image to be conveyed in the image’s alt attribute.

    Video with audio

    Captions and audio descriptions make the video content indexable and the additional content can affect rankings.

    Captions and audio descriptions make the video more consumable by users with hearing disabilities.

    Audio alone

    Transcriptions make the audio indexable and the additional content can affect rankings.

    Transcriptions make audio files available to users with hearing disabilities.

    Create readable and descriptive URLs

    Search engines consider the url in their ranking algorithms. Make the URL readable and relevant to the page.

    When other accessibility fails, the url can help a person determine the purpose of a link. For example if another site links to your site improperly (using “click here” or “read more”), the user may be able to determine the content of the page from the link url instead of the link text.

    Summary

    In summary, both SEO and web accessibility are closely intertwined when it comes to your site’s content and structure. Sites that are optimized for both factors opens the gates to a broader audience as they become easier to understand and use by search engines and users with disabilities. As new technologies are developed, this connectivity between SEO and accessibility will only increase, so it is important to take the steps necessary to make your site as accessible as possible.

    Additional Resources
    Building an Accessibility Toolbar with Drupal | Blog Post
    How Drupal Won an SEO Game Without Really Trying | Blog Post
    Accessibility Best Practices for Content Editors | eBook

    Sep 26 2016
    Sep 26

    26 Sep 2016

    Everyone in the Drupal community is excited about the DrupalCon Dublin that kick starts today! The registration is open at Dublin Convention Center until 18:00 today. 

    Opening Reception

    Date: 26th Sep 2016

    Time: 17:00 to 19:00

    Room: Forum Hall, Dublin Convention Centre

    some snacks and refreshments and have some amazing discussions around creating incredible digital solutions in Drupal.

    Animate Your Site

    Date: 28th Sep 2016

    Time: 17:00 to 18:00

    Room: Liffey Meeting 2 | Amazee Labs 

    Nikhil and Vidit are presenting this session on the third day of DrupalCon. Animation is skeuomorphism. It is a custom created illusion that makes the websites highly user friendly and creates the perception of a highly dynamic website. It helps in grabbing the attention of visitors and hence results in increased ‘time on site’ as compared to non-animated sites.

    In this session Nikhil and Vidit will discuss about the following

    1. What is Animation?
    2. Where to use?
    3. Types of animation
    4. 12 basic rules of Animation
    5. How can we make it interesting?
    6. How can we achieve animation across the devices?
    7. Performance impact and how can we avoid
    8. Animation in Drupal
    9. Demo of animation in Drupal 8

    Be there to begin your own experiments with animate.js and many other front end js and CSS libraries. 

    Project Estimation Tool

    In this DrupalCon we are showcasing our Project Estimation Tool powered by Platform.sh and built in Drupal. Meet us to know everything about it and how it can help you expedite your project estimates. You may also click here to sign up for your 45-days free trial.  

    [embedded content]

    Hope you have a great DrupalCon!

    Sep 26 2016
    Sep 26

    With over 2,000 people expected to be in Dublin for DrupalCon this week, it's likely that someone, somewhere is going to need some assistance. We're all very helpful people in the Drupal community and so help should easily be available. But sometimes you get caught out and can't find people nearby - you get lost, you lose your phone, you're in an area of town and haven't a clue how to get back to your home, you are locked out of your AirBnB, you've gone to kiss the Blarney Stone not realising it was 350km away!

    If you need help with anything while in Dublin, please get in contact with us. We have lots of local knowledge (and a team of 15 people here for DrupalCon) willing to help you. You can contact us via:

    email: [email protected]
    email: [email protected]
    phone: +353 (0)1 524 0312
    twitter: @annertech
     

    We'll be keeping a good monitor on all of the above and will do whatever we can to help anyone that needs it.

    Sep 26 2016
    Sep 26

    Drupal caching layer has become more advanced with the advent of cache tags & contexts in Drupal 8. In Drupal 7, the core din't offer many options to cache content for authenticated users. Reverse proxies like Varnish, Nginx etc. could only benefit the anonymous users.  Good news is Drupal 8 handle many painful caching scenarios ground up and have given developers / site builders array of options, making Drupal 8 first class option for all sort of performance requirements.  

    Lets look at the criteria for an un-cacheable content:

    • Content that would have a very high cardinality e.g, a block that needs to display user info
    • Blocks that need to display content with a very high invalidation rate. e.g, a block displaying current timestamp

    In both of the cases above, we would have a mix of dynamic & static content. For simplicity consider a block rendering current timestamp like "The current timestamp is 1421318815". This rendered content consists of 2 parts:

    • static/cacheable: "The current timestamp is"
    • Dynamic: 1421318815

    Drupal 8 rendering & caching system provides us with a way to cache static part of the block, leaving out the dynamic one to be uncached. It does so by using the concept of lazy builders. Lazy builders as the name suggests is very similar what a lazy loader does in Javascript. Lazy builders are replaced with unique placeholders to be processed later once the processing is complete for cached content. So, at any point in rendering, we can have n cached content + m placeholders. Once the processing for cached content is complete, Drupal 8 uses its render strategy(single flush) to process all the placeholders & replace them with actual content(fetching dynamic data). The placeholders can also be leveraged by the experimental module bigpipe to render the cached data & present it to the user, while keep processing placeholders in the background. These placeholders as processed, the result is injected into the HTML DOM via embedded AJAX requests.

    Lets see how lazy builders actually work in Drupal 8. Taking the above example, I've create a simple module called as timestamp_generator. This module is responsible for providing a block that renders the text "The current timestamp is {{current_timestamp}}".

    <?php
    /**
    * @file
    * Contains \Drupal\timestamp_generator\Plugin\Block\Timestamp.
    */
    namespace Drupal\timestamp_generator\Plugin\Block;
    use Drupal\Core\Block\BlockBase;
    /**
    * Provides a 'Timestamp' block.
    *
    * @Block(
    * id = "timestamp",
    * admin_label = @Translation("Timestamp"),
    * )
    */
    class Timestamp extends BlockBase {
    /**
    * [email protected]}
    */
    public function build() {
    $build = [];
    $user = \Drupal::currentUser()->getAccount();
    $build['timestamp'] = array(
    '#lazy_builder' => ['timestamp_generator.generator:generateUserTimestamp', array()],
    '#create_placeholder' => TRUE
    );
    $build['#markup'] = $this->t('The current timestamp is');
    $build['#cache']['contexts'][] = 'languages';
    return $build;
    }
    }

    In the block plugin above, lets focus on the build array:

    $build['timestamp'] = array(
    '#lazy_builder' => ['timestamp_generator.generator:generateUserTimestamp', array()],
    '#create_placeholder' => TRUE
    );
    $build['#markup'] = $this->t('The current timestamp is');

    All we need to define a lazy builder is, add an index #lazy_builder to our render array.

    #lazy_builder: The lazy builder argument must be an array of callback function & argument this callback function needs. In our case, we have created a service that can generate the current timestamp. Also, since it doesn't need any arguments, the second argument is an empty array.

    #create_placeholder: This argument when set to TRUE, makes sure a placeholder is generated & placed while processing this render element.

    #markup: This is the cacheable part of the block plugin. Since, the content is translatable, we have added a language cache context here. We can add any cache tag depending on the content being rendered here as well using $build['#cache']['tags'] = ['...'];

    Lets take a quick look at our service implementation:

    services:
    timestamp_generator.generator:
    class: Drupal\timestamp_generator\UserTimestampGenerator
    arguments: []
    <?php
    /**
    * @file
    * Contains \Drupal\timestamp_generator\UserTimestampGenerator.
    */
    namespace Drupal\timestamp_generator;
    /**
    * Class UserTimestampGenerator.
    *
    * @package Drupal\timestamp_generator
    */
    class UserTimestampGenerator {
    /**
    *
    */
    public function generateUserTimestamp() {
    return array(
    '#markup' => time()
    );
    }
    }

    As we can see above the data returned from the service callback function is just the timestamp, which is the dynamic part of block content.

    Lets see how Drupal renders it with its default single flush strategy. So, the content of the block before placeholder processing would look like as follows:

    <div id="block-timestamp" class="contextual-region block block-timestamp-generator block-timestamp">
    <h2>Timestamp</h2>
    <div data-contextual-id="block:block=timestamp:langcode=en" class="contextual" role="form">
    <button class="trigger focusable visually-hidden" type="button" aria-pressed="false">Open Timestamp configuration options</button>
    <ul class="contextual-links" hidden=""><li class="block-configure"><a href="http://www.qed42.com/admin/structure/block/manage/timestamp?destination=node">Configure block</a></li></ul>
    </div>
    <div class="content">The current time stamp is
    <drupal-render-placeholder callback="timestamp_generator.generator:generateUserTimestamp" arguments="" token="d12233422"></drupal-render-placeholder>
    </div>
    </div>

    Once the placeholders are processed, it would change to:

    <div id="block-timestamp" class="contextual-region block block-timestamp-generator block-timestamp">
    <h2>Timestamp</h2>
    <div data-contextual-id="block:block=timestamp:langcode=en" class="contextual" role="form">
    <button class="trigger focusable visually-hidden" type="button" aria-pressed="false">Open Timestamp configuration options</button>
    <ul class="contextual-links" hidden=""><li class="block-configure"><a href="http://www.qed42.com/admin/structure/block/manage/timestamp?destination=node">Configure block</a></li></ul>
    </div>
    <div class="content">The current time stamp is 1421319204
    </div>
    </div>

    The placeholder processing in Drupal 8 happens inside via Drupal\Core\Render\Placeholder\ChainedPlaceholderStrategy::processPlaceholders. Drupal 8 core also provides with an interface for defining any custom placeholder processing strategy as well Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface. Bigpipe module implements this interface to provide its own placeholder processing strategy & is able to present users with cached content without waiting for the processing for dynamic ones.

    With bigpipe enabled, the block would render something like the one shown in the gif below:

    Lazy builder with Bigpipe

    As you can see in this example, as soon as the cached part of the timestamp block "The current timestamp is" is ready, its presented to the end users without waiting for the timestamp value. Current timestamp loads when the lazy builders kick in. Lazy builders are not limited to blocks but can work with any render array element in Drupal 8, this means any piece of content being rendered can leverage lazy builders.

    N.B. -- We use Bigpipe in the demo above to make the difference visble.

    Sep 26 2016
    Sep 26

    Body: 

    Drupalcon Dublin is starting this week. Particularly exciting one for me since
    I went to university here about a million years ago (a.k.a. the early nineties).

    This was another era entirely, before the internet. I think the arrival of the
    internet changed Ireland even more than most other countries. It is mainly
    rural, and stuck on the western edge of Europe on the Atlantic. "Surrounded by
    water" as the song says. The water comes down from above as well. Very, very
    frequently.

    So Ireland remains geographically on the edge of Europe, but digitally it is
    extremely connected. Companies from Silicon Valley discovered a country with a
    young and educated workforce, so they set up their European operations here from
    the late 1990s on.

    This changed Ireland. For most of its recent history it had been a poor country
    where people mostly emigrated to find work. The Catholic church had a lot of
    power over society in general, the health and education systems in particular.

    Now, there are many foreigners living here and you hear people from all over the
    world who speak English with Irish accents. This is something that is still
    quite amazing for me.

    It's a privilege to be here. Thank you, erdfisch! More to come ...

    Sep 26 2016
    kim
    Sep 26

    The Drupal open source project only exists because of code contributions by tens of thousands of developers and Drupal focused companies around the world. In his recent post, project founder Dries Buytaert blogged that “The Drupal community has a shared responsibility to build Drupal and that those who get more from Drupal should consider giving more”.

    Australia’s contribution to Drupal code is significantly underrepresented, with PreviousNext the only Australian company in the Top 100 contributors listed on Drupal.org’s global marketplace. DrupalSouth represents the best opportunity for a wider pool of Australian Drupal developers to change this status by participating in DrupalSouth's official Code Sprint, being held on Wednesday, 26th October.
     

    Sponsored by PreviousNext, some of Drupal 8’s most prolific code contributors will be on hand to help you make your dent in the Drupal universe on Wednesday October 26.

    Registration

    So we can make sure we have enough capacity to understand what level of experience you have, we require you to pre-register your attendance via the registration form.

    Venue & Schedule

    The Code Sprint will be held on Level 2 in DrupalSouth’s conference venue. Directions will be available in the foyer on the day.

    The Code Sprint will be held on Wednesday October 26 and officially start at 10am, finishing no later than 5:30pm.

    What is a Sprint?

    A sprint is an opportunity to get together with other like-minded people and work together on something that interests you. It can be Drupal core issue, a contrib module you want to port, writing documentation, writing tests. Whatever scratches your itch!

    Sprints are not just for developers. Bug reporters, QA testers, and documentation editors are all able to contribute. If you want to get involved, then you are welcome to join in.

    Mentoring

    While co-sprinters at Drupal events are usually always happy to help, the sprint is not a Drupal training event.

    There will be a mix of experience levels, and if you are new to Drupal, there will be people at the event who can get you started. The best way to get involved is to find a group of people who all want to work on the same thing, and to help each other.

    Preparation

    We recommend following the Drupalcon guide on getting set up before the sprint. https://events.drupal.org/neworleans2016/mentored-core-sprint#setup
    You will need to bring your own laptop, snacks, drinks etc.

    What will we be Sprinting on?

    The PreviousNext team are involved in a number of core and contrib projects for Drupal 8, including:

    • Default Content
    • Media Entity Browser
    • LDAP
    • Contact Storage
    • Title

    Feel free to suggest other projects you’re keen to work on when you register.
     

    DrupalSouth Code Sprint
    Sep 25 2016
    Sep 25

    In many modern frameworks, data modeling is done by building out database tables. In Drupal, we use a web-based interface to build our models. This interface makes building the database accessible for people with no database experience. However, this easy access can lead to overly complex content models because it’s so easy to build out advanced structures with a few hours of clicking. It’s surprising how often Drupal developers are expected to be content modeling experts. Here’s a well-written overview of content modeling for the rest of us who aren’t experts yet.

    Data Modeling Goal

    Our goal when modeling content in Drupal is build out the structure that will become our editor interface and HTML output. We also need to create a model that supports the functionality needed in the website. While accomplishing this, we want to reduce the complexity of our models as much as possible.

    Getting Started

    One of the first things to do when building a Drupal site is to build content types. So, before you start a site build, start with either a content model or a detail page wireframe. This spreadsheet from Palantir will help you. The home page design may look amazing, but it’s unhelpful for building out content types. Get the detail pages before you start building.

    Why Reduce Complexity?

    The more content types you create, the more effort it will take to produce a site. Further, the more types you have, the more time it will take to maintain the site in the future. If you have 15 content types and need to make a site-wide change, you need to edit 15 different pages.

    The more pages you need to edit, the more mistakes you will make in choosing labels, settings, and formatters. Lastly, content can’t easily be copied from one type to another which makes moving content around your site harder when there are many content types. So, the first thing you’ll want to do with your content model is to collapse your types into as few types as feasible. How many is that?

    5 Content Types is Enough

    Drupal has many built in entities like files, taxonomy, users, nodes, comments, and config. So, the vast majority of sites don’t need any more than 5 content types. Instead of adding a new content type for every design, look for ways to reuse existing types by adding fields and applying layouts to those fields.

    Break Up the Edit Form

    Drupal 8 allows you to have different form displays for a single content type. With either Form Mode Control or Form Mode Manager, you can create different edit experiences for the same content type without overloading the admin interface.

    Now that we’ve got the goal in mind and some tools to get us there, we’ll dive into the specifics of configuring field types such as hero images and drop down lists in my next post.

    Sep 25 2016
    Sep 25

    DrupalCon is brought to you by the Drupal Association with support from an amazing team of volunteers.
    Built on COD v.7, the open source conference and event management solution. Creative design by ADCI Solutions.
     
    DrupalCon Dublin is copyright 2016. Drupal is a registered trademark of Dries Buytaert.

    Sep 24 2016
    Sep 24

    DrupalCon is brought to you by the Drupal Association with support from an amazing team of volunteers.
    Built on COD v.7, the open source conference and event management solution. Creative design by ADCI Solutions.
     
    DrupalCon Dublin is copyright 2016. Drupal is a registered trademark of Dries Buytaert.

    Sep 23 2016
    Sep 23

    "Someone is looking for Drupal developers. Are you interested?", I asked one of my friends. "I will never touch Drupal again.", That is the most negative statement I have heard so far. Yes, Drupal has an interesting learning curve. It is not easy to master quickly. When we talk about learning Drupal, There are some of us left Drupal after many years as a Drupal developer, disappointed, frustrated. It is a sad truth some of us have worked with Drupal for many years, and still not find the beauty of her. I want to discuss how we can avoid it and how to obtain the power of Drupal quickly in an exciting way.

    Here is something interesting about Drupal. After seven years into it, I found myself is still learning new thing and gain a little bit deeper understanding of it. When looking into the code of the core and contributed modules, I can see what the other developers were thinking; I saw how they tackled the problem. I have a great sense of connection with them. It is not just merely the code itself. It is a collaborated among many developers in the past, present and future. So, keep learning is the key to getting deeper inside of it.

    Drupal is a tool. We are learning the skill to use this tool. It can be boring if the purpose is just to learn and understand it. It is a tool. So, the best way is to use it. Use it in the best possible way we can find. Always, find multiple solutions and choose one of the best to implement it.

    Most of the requests from our customers, managers are reasonable. A lot of time, they are looking for a better user experience. It is the critical element leading to the success of a product. Enhancement of user experiences is a big thing. Never push it back off quickly. There is nothing like Drupal can't do it. Yes, we can do it. We have a lot of contributed modules to do it. If we can not find one, we build one and contribute it back to the community. So, others do not need to invent the wheel again. We take on all kinds of the challenge and find the best possible way to face it. By doing that, we dive deep inside of the water.

    When it comes to working on a ticket and solving a problem, we create a patch, and there is no error. That is not sufficient. We can ask ourselves couple more questions. Are there other ways to do it? Is the way what I just did will affect other functions and will this limit the future expansion? Are there any bad things introduced down the road? Is there anything that might sabotage the whole system because of this change? We are going to find the best possible way, a native way. Always looking for the best and willing to take on challenges. It helps us learn it and getting deeper. It is how we can learn stuff that others will not get it from tutorial videos.

    If your manager is not a taker and wants to burn you out, always take the challenge. When facing a problem, do not find a way to avoid it. Find as many as possible ways to address the problem. Pick one of the best one; Find a natural way that might have come with the original system design.

    Solving a problem, fix a bug is not a big deal. Solve it in a right way is a deal. There are always many methods to solve a single problem, choose the right one. Do not get satisfied by fixing something with a single shot. Ask ourselves to look for more ways to it, use the best one. It is like giving away your talent to solve the problem. It leads me to a commercial ad on a Canadian TV channel. "Greatness is not what you have; it is what you give." Give your greatness to Drupal. The more you give, at the same time, the more skill you get.

    Sep 23 2016
    Sep 23

    Is creating website really so hard? This is a question I get from people not in the industry after I tell what we do at AGILEDROP. My reply is that web development is hard because it is just one form of programming. And programming is hard. Difficult to learn and even more difficult to master.

    Why is programming so hard?

    When you are developing, you are creating new things. Spawning solutions from thin air. Programming is an art. Programming is also inventing things. Manuals for inventing can not exist. Instructions on how to do programming will are never complete, only indicative, guiding. What you do with programming has not been done before, not the same.

    Many times, developing complicated software results in problems, frustration. There is a constant need to think in new ways. Problem-solving is the core of the art. As a programmer, you need to embrace and accept that you’ll never know when and in what form problem will appear. The reality is not elegant or simple; it is chaotic and unpredictable.

    You will find documentation is wrong. Weird hardware bug takes you days until you will realise it was not your fault. Many times you spend hours looking for a spelling error that was staring you in the face all the time.

    To be a programmer, you need to be a person who gets excited about solving hard problems. For example, if you found math to be an interesting subject in school, you will have no issues with programming.

    So, is web development hard?

    Compared to mobile or desktop development, web development is not hard. Most web development today is done on top of open source which makes frameworks, tools, and documentation accessible to everyone.

    You also need to learn basic conceptual foundation.  You shouldn’t start with something like jQuery or Angular!  You need to focus on understanding the basic web development models: HTML, Form processing, and back-end interaction such as with a database.  Know those layers before you start getting into the advanced stuff.  Without an understanding of the basic foundation, it’s going to take you a lot longer than it needs to.

    Where to start learning?

    Whether you are new to web development, I would advise starting with an open source software that has an active community. When I started in the Drupal , people in the community enabled me to grow very fast from a beginner to an entirely independent developer.

    Sep 23 2016
    Sep 23

    Drupal core has supported CSS and JavaScript file aggregation since around 2007. Dozens of small files are concatenated into a handful of larger files to save on TCP connections, and CSS files are preprocessed to remove whitespace etc. which saves bandwidth.

    Before talking about asset aggregation in Drupal 8, it’s worth considering whether it’s still relevant after ten years; why improve something that’s about to become obsolete? HTTP/2 allows multiple asset files to share a single TCP connection, which reduces the overhead of multiple requests for multiple files compared to regular HTTP.

    However, asset aggregation doesn’t only reduce the number of network requests, but saves on overall bandwidth too. Minification of CSS in Drupal significantly reduces file size, and zlib compression is much more efficient with one larger file than a few dozen smaller ones. Additionally, while Drupal core doesn’t support js minification, most ‘Drupal’ JavaScript from contributed and custom modules and themes is provided unminified - Drupal.org project packaging and many site builds aren’t pre-minifying JavaScript. So for now, asset aggregation remains a useful aspect of web performance, albeit something we should keep under review as HTTP/2 develops into generalised use.

    While there have obviously been changes to Drupal’s asset aggregation since 2007, the implementation in core has remained remarkably similar:

    • When building an HTML pages, modules and themes can add CSS and Javascript to be served as part of the overall request.
    • When rendering CSS and JS in the HTML <head> and the footer, files are put into groups (for example to allow different groups for different media queries). The groups are hashed to create a unique file name. If the file doesn’t exist, within the main page request the file is generated and saved to disk. Then the browser can read the aggregated files from disk.

    This has a number of drawbacks:

    • If no JavaScript or CSS files exist on disk, the HTML page itself can’t be served until they’ve been created.
    • In a cold cache situation on a busy site, this means <em>no</em> HTML page can be served until some assets have been written to disk, and each asset has to be created serially.
    • This in turn leads to stampedes, with multiple pages trying to generate the same files
    • Because everything is done in the page, features like js minification on-the-fly would be prohibitively slow to add.
    • The ability to add arbitrary files under arbitrary conditions makes it hard to predict what the aggregates will be without the full context of the main page request.

    In 2011 I opened a Drupal core issue to suggest a different approach, based on the way that image derivates in Drupal core work.

    Instead of creating files in the main page request, we’d only generate the URL to the files. Then a page controller at the file path intercepts any requests for missing files, and creates them lazily, writing to disk so that the next request can get the file straight from disk. This approach was implemented in two Drupal 7 modules, http://drupal.org/project/agrcache and http://drupal.org/project/advagg but for various reasons it’s never yet been adopted for core.

    Drupal 8 requires all assets to be registered via a library, which means instead of dozens or hundreds of individual files added per page, there are usually a handful of libraries (which may include dozens or hundreds of files). From the list of library definitions for a page, it’s possible to recreate the order and groupings of the individual assets.

    During 8.0.x’s development cycle we discussed using the library information to build asset aggregate URLs - encoding the information needed to produce the aggregate in the filename itself. This would massively reduce the necessary work in the main request, even compared to agrcache and advagg, however the issue stalled due to numerous pre-requisites and difficulty of implementation.

    One of the advantages of the new Drupal 8 release cycle is that even though an issue might not have got into 8.0.x, it can be released in later minor version as long as it maintains backwards compatibility for the public API, and these come up every six months.

    So as part of my funded core time for Third and Grove, I’ve revisited that 2011 issue to implement lazy asset-generation, with the patch currently passing tests. This approach removes file generation from blocking the main page request, it allows individual asset aggregates to be built in parallel, meaning that the full HTML page and all assets should be served considerably faster on cache misses. It also opens up the possibility of adding JavaScript minification to core, since any extra processing when minifying JavaScript files should be outweighed by the ability to do that work in parallel and serve smaller files.

    The patch still needs some reviews, but with luck might be included in the 8.3.x minor release.

    Sep 23 2016
    Sep 23
    The purpose of software testing is to reduce issues to a minimal level and to carve out optimal quality for a product. When it comes to bugs and defects, there are different schools of thought, but quality is always the main focus.There is no concrete definition of bugs or defects written in stone or certified by a governing body, but ideally both fall into these category of issues:
    Sep 23 2016
    Sep 23

    Today’s the day for our Drupal developer’s blog post again, which means a lot of attention to detail and practical tips — this time on caching in Drupal 7. The 7th release is a strong platform, and many developers prefer it for site building, as well as for blog writing ;) We have posts about creating CTools popups, working with the Book module, building apps with PhoneGap, using Drupal 7 tools, configuring search with ApacheSolr, and much more in the development category. But today is the day to delve into the nuances of caching! ;)

    A cache is a web developer’s tool that helps get the requested data as quickly as possible and with the least system effort. Essentially, it is an intermediate buffer which stores data that is often requested. How does this buffer work in practice? Usually it is a table in the database with the data at the ready, or, instead of a table, the data can often be stored in a file.

    We can give a simple example of caching. Suppose that a certain website page is often visited by new users, and, for each of these users, the page script has to perform a series of operations that take some time (let’s say, 30 seconds). Only after all these calculations performed does a user sees the desired result on the screen. So, every time a user visits a page, he waits 30 seconds to get the desired result. You might say, after the first function execution, why don’t we save the result of this execution and just show it to him, skipping the long execution process? This means that the data of the 30-second performance will be just saved in the above described “intermediate buffer” and instantly delivered to the user. That’s the main philosophy of caching.

    Drupal has a number of tools to manipulate data and cache them according to specific algorithms. These tools and methods of their use are exactly what we are going to discuss.

    Drupal caching tools and their use

    As mentioned above, the Drupal cache is stored in a database table. However, our content management system distributes cash and divides it into certain segments, each of which is in a separate table with an individual name. Why does the segmentation take place, and what benefits do we get from this kind of pattern? Let’s consider these segments and give examples of their practical use.

    Fields of the cache segments

    By default, each cache segment consists of 5 fields: 

    $сid — identification cache (ID) for the data in the repository. You can use any character string, so long as it is no more than 255 characters long. We recommend starting an identifier with a module name.

    $data — as is clear from the name, it’s the place to store our data. Complex data types will be automatically serialized.

    $expire — (optional). The cache lifetime. It can have the following values:

    • CACHE_PERMANENT: shows that the data should never be removed, except in the case of the expressly specified element’s ID being listed during the cache_clear_all() function callback.
    • CACHE_TEMPORARY: shows that the element should be removed during the next general cache clearing.
    • UNIX is a timestamp: it shows the element’s lifetime in the UNIX format. After that it behaves as CACHE_TEMPORARY.

    $created is the cache saving time in Unix format.

    $serialized is a flag (0 or 1) that shows whether the cached data was(1) or wasn’t(0) serialized.

    Functions for working with the cache

    • cache_clear_all() — clears the cache data.

    • cache_get() — returns the cache data.

    • cache_get_multiple() — returns the data from cache, from the array of cache ID-s.

    • cache_is_empty() — checks whether the cache is empty.

    • cache_set() — stores data in the cache.

    • _cache_get_object() — gets the cache object by the segment ($bin).

    For example:

     function cache_set($cid, $data, $bin = 'cache', $expire = CACHE_PERMANENT) {
            return _cache_get_object($bin)->set($cid, $data, $expire);
    }
    

    Descriptions of the cache segments

    1. {cache} is a (default) segment for storing the general cache. It is commonly used to register themes, local dates, lists of SimpleTest tests and so on, or when the data is impossible to classify, and creating a separate segment for it makes no sense. It is often used to cache data from custom modules.

    2. {cache_block} is added when the Block module is enabled. When a region theme is loaded, the data is loaded by all blocks and the region is checked for being built from the cache. Of course, the hook_block_view() hook will not be executed if the cache for the block is given. A request to the {cache_block} returns a block which is already rendered.

    Do not forget also about the caching settings when creating a block through hook_block_info(), which you can optionally specify to one of the following parameters:

    • DRUPAL_CACHE_PER_ROLE (by default): The block may vary according to the user role and the rights granted to him.
    • DRUPAL_CACHE_PER_USER: The block may vary depending on the user during a page view. However, this option can be resource-intensive for sites with many users, and it should be used only when DRUPAL_CACHE_PER_ROLE is not enough.
    • DRUPAL_CACHE_PER_PAGE: The block may vary depending on the page being viewed.
    • DRUPAL_CACHE_GLOBAL: The block is the same for every user on every page where it is visible.
    • DRUPAL_CACHE_CUSTOM: The module implements its own caching system.
    • DRUPAL_NO_CACHE: The block should not be cached. And, when you create a block, it gets a CACHE_TEMPORARY flag, which means that the data will be deleted during the next general cache clearing.

    3. {cache_bootstrap} — this cache segment is responsible for the Drupal initialization data (module lists, variables, hooks enabled in the system, etc.) For this segment, there exist the following identificators ($cid) for the data in the repository:

    • bootstrap_modules is the list of modules implemented by hooks of the top-priority loading (which are loaded before other modules).
    • hook_info is the list of all hooks that are available for implementation.
    • lookup_cache is the list of classes that are dynamically loaded and the files where they are stored.
    • module_implements is the list of hooks together with modules that have the implementation of these hooks.
    • system_list is the list of enabled modules and themes together with dependencies.
    • variables is a cache of variables (the "variables" table).

    4. {cache_field} — in this segment, the data for all fields is stored. ID($ cid) is formed according to the field: type_of entity: id_of entity rule.

    For example, for the taxonomy fields with a tid equal to 14: field: taxonomy_term: 14

    Here, a set of fields and their values related to a given entity are stored.

    5. {cache_filter} is a segment created by the Filter module (core) which is responsible for filtering the text formats. That is, for texts, you can create a ready-made cache according to its MD5 hash. For example, the check_markup() function uses the SHA-2 hash to check whether the cache segment {cache_filter} has an already filtered text, and returns it in case of positive result. If there is no filtered text in the cache, the list of enabled filters of the current input format is loaded, and the text is processed according to the filter settings, which entails a certain time expense. So, when possible, use the cache when enabling the heck_markup().

    6. {cache_form} is a caching segment for form building. By its logic, it is different from the above described segments and is not used to improve performance, but rather to avoid any security vulnerabilities when building forms with FORM API. This table has the ability to grow rapidly (it has a lifetime of 6 hours specified in the core includes/form.inc), so if a site has many forms plus a large attendance, you should consider setting up Cron (or other custom solutions) to regularly clean this segment.

    7. {cache_image} is a segment reserved by the Image module. As such, there is no image cache in it, and the table basically serves to save the data about the manipulations with pictures.

    8. {cache_menu} is a segment reserved by the Menu module which serves for caching and storing the data on links from all menus created via Drupal interface. The cache ID itself is formed in this way:

     $cid = 'links:' . $menu_name . ':tree-data:' . $GLOBALS['language']->language . ':' . hash('sha256', serialize($parameters));
    

    For example:

     links:main-menu:page:admin/reports/status:ru:1:1
    

    9. {cache_page} is one of the most important cache segments. It is used to store cached pages for anonymous users. If, during a page being built for a certain user, a cache has been found, only 2 hooks will be executed: hook_boot() and hook_exit(), the rest will be skipped. To enable this cache, you just need to go to admin/config/development/performance and enable the appropriate caching.

    10. {cache_path} is a segment responsible for maintaining the correspondences between the system path and its alias.

    11. {cache_update} is a segment reserved by the Update manager module. The cache data contains all the information on the releases for the enabled modules. However, the segment acts more like a data storing table, and does not influence the performance. Updating the table happens only when Drupal gets new data on the releases of the modules.

    Also, additional segments create third-party modules (hacked, l10n_update, token, views). Among them it is worth mentioning {ctools_object_cache} which is a cache segment used to store large objects being edited at the moment. That's why, instead of the $cid field, this table has $sid(Session ID), the identifier of the current user session. Similarly, the same table has no $expire, so it is not erased after clearing the cache via the interface, but is cleaned every day according to Cron. An example can be the cache of the configured but not yet saved views.

    To sum up, we can say that a cache segment does not always work as a buffer, exactly, as was stated at the beginning. Therefore, knowing each segment and its purpose, you can use this tool skillfully and successfully in practice.

    Creating custom cache segments

    How about creating your own segment for individual purposes, such as, for example, a custom module? In this situation, you will need to just clone a standard segment {cache} and create your own on its basis.

    For example, create the "My module" module, for which "cache_my_module" will be your new cache segment.

    To clone the cache table, implement hook_schema() in my_module.install and add your table.

     /**
     * Implements hook_schema().
     */
    function my_module_schema() {
     
      $schema['cache_my_module'] = drupal_get_schema_unprocessed('system', 'cache');
      $schema['cache_my_module']['description'] = 'Cache table for My module.';
     
      return $schema;
    }
    

    Here you go — the table has been created. The next important step is cleaning the table during the system cache cleaning. For this purpose, Drupal has a hook called hook_flush_caches(). Apply it. To do so, write the following in the my_module.module file:

     /**
     * Implements hook_flush_caches().
     */
    function my_module_flush_caches() {
      return array('cache_my_module');
    }
    

    The function example below shows the cache use. A specially created resource-intensive cycle calculates the amount according to a certain rule. During the first run, this function was executed in 5.85 sec., while next time and ever after it took approximately 0.001s.

     /**
    * Example function.
    */
    function my_module_cache_page() {
      timer_start('cache_module');
     
      $cache_id = 'cache_example_files_count';
      $sum = 0;
     
      if ($cache = cache_get($cache_id, 'cache_my_module')) {
            //if there is cache for this ID, assign data to it
            $sum = $cache->data;
      }
      else {
            // do some resource-intensive calculations
            for ($i = 0; $i < 30; $i++){
          $files_count = count(file_scan_directory('.', '/.*/'));
            $sum += $files_count * $i;
            }
       //save our calculations in the cache
        cache_set($cache_id, $sum, 'cache_my_module', REQUEST_TIME + 15 * 60);
      }
      //display the time spent
      $timer = timer_read('cache_module') / 1000;
      print $sum . ' We got a sum in = ' . $timer . 'seconds.';
    }
    

    As you can see, the difference is considerable. However, for significant loads on the site, you should focus on minimizing the requests to the database. So the question is how to move the cache outside the database.

    Moving the cache segments outside the database

    You can do it, for example, with Memcached. Memcached should be installed on the server. You can either install it yourself, if it’s a dedicated server, or ask your hoster. Next, you need to move all cache segments. For this purpose, there is a ready Memcache Storage module. Before installing it, you need to link the module’s functionality with the Memcached daemon on the server. This is done by adding the following code lines to settings.php:

     $conf['cache_backends'][] = 'sites/all/modules/memcache_storage/memcache_storage.inc';
    $conf['cache_default_class'] = 'MemcacheStorage';
    

    Now you can enable the module. But it should be noted that Memcached is using memory. And, as we have already mentioned, the cache segment {cache_form} can be very significant in size, especially if there is a large number of users. So keeping this data in RAM is not a great idea. Therefore, use these lines to ask Drupal to return this segment cache to your database:

     $conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
    

    There are several common practices in the effective use of Memcached. Since we have already moved the cache to RAM, there is no point in Drupal’s request to the database when building a page at the bootstrap phase, therefore:

     // sending the cache page to RAM
     
     
    $conf['cache_class_cache_page'] = 'MemcacheStorage';
    // deactivating the link to the database
    $conf['page_cache_without_database'] = TRUE;
    

    In addition, there is functionality that directly affects the database with the cache, since, at the bootstrap stage, the hook_boot() and hook_exit(0) hooks are used anyway. We will fix it also:

     $conf['page_cache_invoke_hooks'] = FALSE;
    

    Besides Memcached, you can use other solutions. For example, APC, Boost, Varnish, XSache, Redis. All these systems can be used simultaneously, moving certain cache segments in this or other solution.

    Good luck in your work with cache segments and caching in Drupal 7!

    Sep 23 2016
    Sep 23

    Mark Carver (markcarver), Senior Front End Performance Engineer with Tag 1 Consulting and maintainer of the Bootstrap base theme joins Mike Anello to discuss the past, present and future of Bootstrap, Dreditor, and render arrays.

    Interview

    DrupalEasy News

    Three Stories

    1. We're saying goodbye ;-( - Implement User Enhancements on Drupal.org and port Dreditor features.
    2. Who sponsors Drupal development? - blog post by Dries Buytaert and Matthew Tift.
    3. What's new on Drupal.org - August 2016 - blog post by Tim Lehnen.

    Sponsors

    Picks of the Week

    Upcoming Events

    Follow us on Twitter

    Five Questions (answers only)

    1. Travel (road trips)
    2. Plex
    3. Getting out from behind the keyboard more often.
    4. Buffalo
    5. When he created his drupal.org account, hired as a school district's web site developer.

    Intro Music

    Subscribe

    Subscribe to our podcast on iTunes, Google Play or Miro. Listen to our podcast on Stitcher.

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

    Sep 23 2016
    Sep 23

    As many people in the Drupal community know, I travel a lot. Today I'm in Paris having just completed a migration in-flight during my trip from Montréal. At the end of August I was in San José, Costa Rica where I presented both of the migrate talks my colleague Novella and I have worked on over the past year (unfortunately she could not make it as she moved to Detroit that week). It was fun to present talks I've worked with for so long... familiar. Low-stress. All the notes are now safely stored in markdown format on GitHub. Bliss.

    Since they are both in an accessible format I have posted them here for others to access. Of coruse, particularly with the project management talk, the real fun in the presentation is the examples we cite as we talk through each issue, so you'll have to live without that. Here they are:

    Migration Shotgun Tour (Montréal 2016, Costa Rica 2016) - in markdown and as HTML/JS slides.

    Project Planning a Migration Project (Montréal 2016, Costa Rica 2016, Ottawa 2015) - in markdown and as HTML/JS slides.

    ...unfortunately there are no recordings of these talks. I tried to capture audio of one of them and did not realize the disk was full. :-/

    Prior to these two talks I have done many different variations of these presentations at other camps and summits going back as far as 2013 when I presented commerce_migrate_ubercart to the Toronto Drupal community. It was my first-ever Drupal talk. Since then I became a maintainer of that module and done many talks and countless migrations since! I'm hoping to get back into Commerce migrations when 2.x hits beta, which I hear will be coming soon.

    My next upcoming migrate talk will be a full-day training at BadCamp 2016 in Berkeley, California. It is already sold out (sorry!).

    See you at DrupalCon Dublin?

    Before BadCamp 2016 I will be in Dublin for DrupalCon... sorta! Specifically I will be at the Business Summit on Monday and the Friday Sprints, but NOT at the conference itself (ie, Tuesday/Wednesday/Thursday). Obviously I don't have a talk at the conference this time around... but I will still be in Dublin for that time so I may still see some of you at the parties. If you want to get lunch outside the conference venue or join me for some sight seeing let me know!

    I'm on twitter (and yes DMs will ding my phone, even when I travel, so long as I'm paying attention to it). If it is work related, you can also reach out to me through the contact form at kafei.ca.

    Pages

    About Drupal Sun

    Drupal Sun is an Evolving Web project. It allows you to:

    • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
    • Facet based on tags, author, or feed
    • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
    • View the entire article text inline, or in the context of the site where it was created

    See the blog post at Evolving Web

    Evolving Web