Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough
Sep 21 2020
Sep 21

This week brought a new, stable release for Smart Date 3.0.0. You're welcome to dig through the various Smart Date release notes to read up on all the changes from the previous, 8.x-2.x branch but I thought I would use this space to talk about some of the key themes.

Support for Drupal core Date Range fields

One piece of feedback I've heard a number of times is that people wanted the Admin Experience (AX) improvements of Smart Date and its more natural formatting for date and time ranges, but were hesitant to depend on a contrib module for custom storage of their date values. Knowing that this was a barrier to adoption, I started to think about how Smart Date was started as effectively a fork of the core Date Range field. Given this common ancestry, it wouldn't be too hard to make at least some of Smart Date's functionality available to Date Range fields.

This is now possible in Smart Date 3. You can use the Smart Date widget, meant to draw best practices from popular calendar software from Google, Apple, and others, and leverage Smart Date Formats for formatting output. In fact, the latter is also available for core date and time fields, to make it easier to keep the output consistent across your site.

This means you can hedge your bets by continuing to use core fields for storage, but Smart Date to enhance your forms and output. It also makes Smart Date easier to drop into an existing site.

Unfortunately, there are some limitations to this mixed approach. For one, the setup for allowed duration values is moved to the widget configuration for core date range fields, which means they can't be enforced for content created programmatically, as an example. Also, you lose the performance benefits of storing your time values as timestamps. There are a variety of other minor concessions, but perhaps the most significant functionality you forego in this approach are the biggest features introduced in the 8.x-2.x branch: the ability to manually set time zones per event and Smart Date's practical and easy-to-use integration for recurring dates.

An easier Admin Experience out of the box

The primary goal for Smart Date when it was first created was to make life better for content authors. The new release continues to build on that effort, though in more subtle ways.

When using a Smart Date field that allows unlimited values (recommended in case you want to enable recurring events at any point), Smart Date now allows you to suppress the additional, empty field set Drupal creates in addition to the one for the default values. An author can still add more field sets as needed, but it's another change meant to make Drupal work a little more like the calendar software authors are using every day.

For sites where the timezone widget is used, the default set of timezones can be daunting to choose from. The Chosen module can help, but in a recent talk about Smart Date, an attendee asked if it was possible to choose which time zones would be shown in the dropdown. It was a great idea and not difficult to implement. If you need to have time zones associated with your events but don't need support for the long, global set of timezones, using this new configuration for Smart Date's timezone widget can make life significantly easier.

When formatting dates and times with time zones, Smart Date formats now do a better job of determining when there’s value in also showing the time in the site’s default time zone. You now also have the option to force your format to never append the site time.

Support for Drupal’s next-generation themes

There’s significant work underway to get Drupal’s gorgeous new Olivero theme into Drupal 9.1 as experimental and to move Claro towards being stable -- and eventually Drupal’s default admin theme. Meanwhile, during DrupalCon Global we kept hearing the buzz about Gin, the customizable, contrib cousin to Claro. We’ve grown to love Gin and have made it our default for new sites, especially as we transition to building sites in Drupal 9.

It only makes sense, then, for Smart Date to look great and function as expected in Olivero, Claro, and Gin. SmartDate 3.0 has made a variety of changes to make sure that whichever one of these your site uses, Smart Date will be a seamless addition.

Feedback is always welcome

There have been a number of other, smaller changes: better support for formatting German-language dates, improved Fullcalendar View integration, additional views options for recurring dates, and many more. 

As always, the best way to learn about the power and potential of Smart Date is to test it out yourself. I encourage you to try out the Smart Date module and I’d love to hear your feedback. After all, much of what makes Smart Date as feature-rich as it is today came from the Drupal community, either directly as patches, or as feature requests. 

Please feel free to open issues for ways you think the module could be even better, or reach to @mandclu on Twitter, or in the #datetime channel in Drupal’s slack.

Aug 19 2020
Aug 19

Are you hosting a Drupal Users Group Meetup and looking for icebreaker ideas? Here are 15 icebreakers more fun than just simply going around the room and having attendees state what’s already on their LinkedIn profile.

Five Professional Development Icebreakers

Learning and knowledge-sharing are at the heart of every Drupal user group. These five icebreakers get attendees to open up by asing them to share a little history about their Drupal experience.  

  1. Experience Counts: How many years have you been using Drupal and/or which version did you start with? 
  2. Humble Beginnings: What was the very first Drupal site you worked on? 
  3. ID This: Share your Drupal.org User ID name and tell the story behind it.
  4. My Drupal Discovery: In two sentences or less, how did you discover Drupal?
  5. Rose and a Thorn: One person starts by saying their name and sharing one ‘rose’ about Drupal, and the next person - after introducing themselves - shares one ‘thorn’ about Drupal. Alternate ‘rose’ and ‘thorn’ until all attendees have shared.

Five Networking Icebreakers

One of the core purposes of user groups is to bring people together who share an interest in Drupal. These next five icebreakers ask attendees to introduce themselves by sharing a Drupal tip, problem, or recommendation. Maybe they will even find something in common with another member that will surprise them.  

  1. Blue Sky: List one topic, issue, or Drupal challenge you would like to hear about at a future Meetup.  If you can’t think of one, name your favourite past Meetup.
  2. Module Talk: What is your favourite module? 
  3. Name Dropping: Do you have a Drupal mentor? If so, who? Are you anyone’s mentor?
  4. Sessions Galore: If you could only attend one DrupalCon Global session, which one would it be? Real or imaginary.
  5. Trusted News Source: Do you use Drupal Slack and if so, what is one channel you recommend others join?

Five Fun Icebreakers

For something more casual, or for a meeting with a lot of newcomers, give any one of these five ‘fun’ icebreakers a try. 

  1. If Drupal Were An Animal: If Drupal were an animal, what would it be and why?
  2. If I Were A Drupal Drop: Draw yourself as a Drupal drop and share with the group. What characteristics or hobbies does it have? See this one in action
  3. The Virtual Diner: What are you having for lunch and is any of it blue? (best if you are holding your Drupal Users Group virtually, over the lunch hour). 
  4. Your Lucky Day: Give everyone a fortune cookie and have them read the fortune adding ‘in Drupal’ at the end of the sentence (only works for in-person meetups).
  5. What's the Punchline Again?: Ask attendees to tell a joke only Drupal users or programmers would understand (I admit this this one did not go over so great…. you may want to prepare a few jokes in advance).

That's it!

Members of the monthly London Canada Drupal Users Group range from college students studying web technology to Drupal Grand Masters with years of experience in the industry. There are over 300 members in the group and each meeting has about 10 to 25 people in attendance, which is a great size for icebreakers activities I list above. 

Icebreakers help participants loosen up and enable collaboration before the main speaker and host take over. A good icebreaker will help people remember names, not be intimidating to participate in, not require much work beforehand, and -- we hope -- offer a warm reason for someone to start conversations after the meeting ends. 

What are your favourite icebreaker activities? Have you tried any of the methods above at your Drupal Users Group? Give me some new ones to try! Let us know about your experiences in the comments.

Jun 25 2020
Jun 25

The fundamental building blocks of running an efficient and user-focused public transportation network and building a well-designed, effective, and user-centric website are actually pretty similar: You need talented people, quality data, and elite technology to get the most out of your investment.

That’s why the widespread adoption of open data standards combined with an effective and affordable technology like Drupal helps to ensure that public transit works for all users.

Ultimately, the key to great transit service is not about getting 100 percent of people to ride public transit for 100 percent of their trips. Success comes from giving people a viable choice of getting around without needing to drive -- a choice built on affordability, convenience, and quality

Giving people viable choices to get around does not end with good urban planning, congestion management, and low fares. It includes giving people the information they need to plan trips, to plan their day, and to plan travel across, through, and around their cities using transportation solutions that meet their evolving mobility needs.

Where does most of that information come from? Open Data.

Open Source & Open Data A Smooth Ride

Many cities have General Transit Feed Specification (GTFS) feeds available online. These are usually curated by regional public transit agencies. 

GTFS is just one example of many Open Data resources available and in use by transit agencies. But having access to that data is only part of the equation. The important question to answer is how are they to manage that data and repurpose  it in a way that is responsive, accessible, meaningful, and convenient for people to consume? 

Transit authorities, including such mass transit hubs as Santa Clara Valley Transportation Authority, Bay Area Rapid Transit District, and New York City - Metropolitan  Transportation Authority, are turning to open source technologies, like Drupal. 

Why? Because it is possible to handle real-time data in Drupal and harness such resources as GTFS, Google APIs, and other APIs, to fuel a great-looking, purpose-driven site, be it on a smartphone, ipad, or pushed outward to something else entirely, like digital billboards and signage solutions.

Why Drupal for Transportation?

The Drupal open-source content management system (CMS) fits the unique needs of the transportation and transit industry. 

Drupal supports:

  • high-traffic websites with hundreds, thousands, or more registered users of varying privileges and access roles;
  • websites that require the ability for many users to act as contributors and publish content in the form of pages, articles, blog posts, and forum posts;
  • sites with complex structures that require a finely tuned architecture to serve relevant content to its end users;
  • organizations that demand very high security of their websites; and
  • websites that receive a high volume of traffic and require a solid backend in order to ensure functionality in spite of traffic spikes.

Drupal is non-proprietary and benefits from one of the largest open-source communities in the world. It has more than a million passionate developers, designers, trainers, strategists, coordinators, editors, and sponsors working together to constantly develop, iterate, update, refine, and improve its technology.

In addition, thousands of Drupal service providers benefit from support through digital experience platform Acquia’s forward-thinking, ever-expanding catalogue of enterprise-ready technology solutions and technical support. 

I encourage you to connect with us to learn more about Drupal solutions in transportation -- or any other large-scale industry. We’d also love to receive the opportunity to bid on your next project or complete an RFP. 

May 19 2020
May 19

Web accessibility helps to make the world wide web usable for everyone. Many of the most common accessibility issues making sites difficult or impossible to use in a non-traditional way can be easily fixed. 

Developers need to ensure that page markup does not contain duplicate IDs because many screen readers and assistive technologies use IDs within the page as landmarks for the user to easily parse the content.

The following hook modifies any exposed view filter to have aria labels on each form element as well as inserts the view name into the form element, form element label, form actions wrapper, and form submit button ID (e.g. edit-submit-[VIEW_NAME]-[VIEW_DISPLAY]).

The addition of aria-labels acts as an agnostic accessibility feature to inform the user the purpose of the element:

/**
* Implements hook_form_alter().
*/
function MYMODULE_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
 // Add aria-labels to views exposed filters.
 if ($form_id === 'views_exposed_form' && strpos($form['#id'], '-block-') !== FALSE) {
   // Assumed structure (e.g. views_exposed_form_[view_name]_[block_name]).
   $exploded_form_id = explode('views_exposed_form_', str_replace('-', '_', $form['#id']));

   if (isset($exploded_form_id[1]) && !empty($exploded_form_id[1])) {
     // Get the view id.
     $view = explode('_block_', $exploded_form_id[1]);
     $view = isset($view[0]) ? $view[0] : '';

     if (!empty($view)) {
       // Get the view display id.
       $view_display = explode($view . '_', $exploded_form_id[1]);
       $view_display = $view_display[1];
       // Get the view display title.
       $view = Views::getView($view);
       $view->setDisplay($view_display);
       $clean_view_display_title = Html::getClass($view->getTitle());

       foreach ($form['#info'] as $info) {
         if (isset($form[$info['value']])) {
           $clean_info_value = Html::getClass($info['value']);

           // Add an aria-label to the form element.
           $form[$info['value']]['#attributes']['aria-label'] = $view->getTitle() . ' ' . trim($info['label'], ':');
           // Update the id on the form element and label.
           $form[$info['value']]['#id'] = 'edit-' . $clean_view_display_title . '-' . $clean_info_value;
         }
       }

       if (isset($form['actions'])) {
         $form['actions']['#id'] = 'edit-actions-' . $clean_view_display_title;

         // Update the id on the submit button.
         if (isset($form['actions']['submit'])) {
           $form['actions']['submit']['#id'] .= '-' . $clean_view_display_title;
         }
       }
     }
   }
 }
}

This second hook modifies any Table view display to prepend the view name and view display name to the table header ID attribute and corresponding table row header attribute (e.g. [VIEW_NAME]--[VIEW_DISPLAY]--[EXISITNG_ID]):

/**
* Implements template_preprocess_views_view_table().
*/
function MYMODULE_preprocess_views_view_table(&$variables) {
 $view_name = Html::getClass($variables['view']->id());
 $view_display = Html::getClass($variables['view']->getDisplay()->display['id']);
 $id_prefix = $view_name . '--' . $view_display . '--';

 // Update each table header 'id' to be
 // prepended with [VIEW_NAME]--[VIEW_DISPLAY]--.
 foreach ($variables['header'] as $header_key => $header) {
   if (
     isset($header['attributes']) &&
     isset($header['attributes']->storage()['id'])
   ) {
     $variables['header'][$header_key]['attributes']->setAttribute('id', $id_prefix . $header['attributes']->storage()['id']);
   }
 }

 // Update each row 'headers' to be
 // prepended with [VIEW_NAME]--[VIEW_DISPLAY]--.
 foreach ($variables['rows'] as $row_key => $row) {
   if (isset($row['columns']) && !empty($row['columns'])) {
     foreach ($row['columns'] as $column_key => $column) {
       if (
         isset($column['attributes']) &&
         isset($column['attributes']->storage()['headers'])
       ) {
         $variables['rows'][$row_key]['columns'][$column_key]['attributes']->setAttribute('headers', $id_prefix . $column['attributes']->storage()['headers']);
       }
     }
   }
 }
}

Comment below for other ideas, or if you need help using these. 
 

May 15 2020
May 15

There is a lot of excitement in the Drupal community about the release of Drupal 9. In particular, one of the most appealing elements is how the transition to Drupal 9 promises to be the easiest major upgrade in more than a decade.

In reminiscing with other community members about some painful upgrades from long ago, it got me thinking about how the nature of the majority of Drupal modules has changed.

Early Days - Modules as Solutions

My first big Drupal project was using the 4.6 version of core. One of the things I remember was the way many of the modules available tried to anticipate a particular use case and provide a “solution” -- essentially an attempt at a fully-formed (if configurable) way to make Drupal meet a set of needs. 

An example of this is the Job Search module I helped to maintain for a time. It had a preconfigured relationship between jobs and resumes, and permissions associated with different actions you would expect users to take: post jobs, apply for jobs, and so on.

There were frequent requests from users who wanted it to work just a little differently from how it was made. Sometimes these changes got incorporated back into the module, but sometimes they remained a special case - a customization that was really only useful in the context of their site. That started to change with the rise in popularity of toolsets and modules like CCK, which were more about making Drupal more flexible so it can be quickly customized to meet a very specific set of needs.

Rise of the Toolsets

What we’ve seen since that time is an increasingly powerful set of modules that extend the capabilities of Drupal, but leave it up to the site builder to decide how these capabilities should be applied. Image API, Responsive Images, Metatags, and many more are examples of modules that gave Drupal important new abilities, but without any recommended starting point on how they should be used.

Even a tool like Features was built to help make those configuration decisions portable between sites or environments on the same site. But increasingly all decisions on how these should be set up fell entirely on the site builder. Which was fine for those of us used to Drupal (or fortunate enough to work among an experienced team of Drupal experts) but more daunting for someone trying to put together a simple site.

In that time we’ve seen Drupal become the CMS of choice for governments, record labels, and major universities, but we’ve seen competitors slowly take over niches where Drupal used to be popular, such as startups and charities. Having to build from scratch can be less attractive for an organization with limited resources, so it’s understandable they’d be tempted to go an easier route, if available.

A Middle Way

Distributions have been one attempt at addressing this problem, such as the popular Commerce Kickstart, which helped to install a ready-to-use e-commerce site. The challenge we’ve seen in using distributions is that they’re complex to maintain, so often you’re not able to use the latest versions of core or popular contrib modules. Or when it comes time to upgrade, it has built-in assumptions about what’s installed, which can make it more complex to upgrade the component pieces. And finally, a distribution is typically only an option when you’re starting to build (or potentially re-build) a site, not for adding incremental functionality.

One of the exciting features Drupal introduced in version 8 was configuration management.  

In addition, Drupal Console gives us an easy way to export individual elements: a content type, a view, and related dependencies. At Digital Echidna we’ve been experimenting with using these to create modules that are effectively just sets of related configuration meant to be a starting point to help us quickly address a particular use case: a locations map, an events calendar, and yes, even a jobs board.

smart date logoSmart Date Module

Now, I’ve adapted this approach to help anyone interested in using (or even just trying out) the Smart Date module I’ve mentioned many times in this blog. It’s easy to install the Smart Date Starter Kit and it will give you a functional (if basic) Event content type and a view with displays to show upcoming and past events. 

It isn’t preconfigured for recurring events (since not every site needs that) but if you want to add that, it’s as simple as installing the Smart Date Recurring submodule and then updating the configuration of the “When” field to allow recurring events. That’s it! The view has already been set up to properly aggregate events with multiple events.

If you also need your events to show in a calendar, you can use the Smart Date Calendar Kit. Installing it via composer gives you all the dependencies (including Smart Date and Fullcalendar View) plus everything described above in the starter kit. The calendar is connected to the list views as navigation tabs, so it should be a robust starting point to manage events on your site.

Both of these are just an initial set of configurations so you can add as much additional complexity as necessary to suit the specific needs of your site. And we’ve tried to build in some admin experience best practices, such as built-in administrative links to add content, so it’s intuitive to maintain out of the box. 

I hope you’ll try them out and post an issue if you think there are ways these could be made even better.

Future Considerations

The recent Drupal business survey posted by Dries hints that there may be similar conversations already happening elsewhere in the community, so it will be interesting to see the results when they’re announced at DrupalCon Global in July. It’s yet another reason to be excited about Drupal 9, and the future direction for this platform. With all kinds of innovations happening each and every day, it is an exciting era in the history of Drupal. 

Apr 08 2020
Apr 08

The desire to find low-cost, high-convenience and accessible solutions is quickly transforming eLearning into the predominant global educating force of this century. But with more than 700 learning management system (LMS) suppliers in the marketplace, it can be hard to know where to start.

Ideally, your LMS should blend in with the software you’re already using and be shareable with other systems (e.g.  SCORM compliant). 

If you are a Drupal user and considering adding online training courses to your products or services, you will be happy to know that there is a SCORM-compliant, open-source learning management system distribution for Drupal 8 called Opigno. This means that anyone with some basic Drupal knowledge can set up a fully functional online learning environment without having to learn the ins and outs of another platform.

Opigno can be either used by individuals starting an online training business, or by corporations and institutions looking for a scalable and reliable tool to train their employees, clients, or partners.

Opigno launched in 2013 and has been evolving ever since.

timeline of opigno maturity

Chart source credit: Opigno
 

Opigno is delivered as a Drupal distribution making it possible to have an operational e-learning platform very quickly by following the automated installation process.

Client Case Study

How one of our clients is using Opigno to deliver training to its own staff and as an assessment application tool to HR managers within its membership.

The Centre for Research & Education on Violence against Women and Children (CREVAWC)’s role is to facilitate the collaboration of individuals, groups, and institutions to pursue research and training opportunities to understand and prevent abuse.

I am working on a project to update and replace CREVAWC’s legacy online training system, with one that uses Opigno. 

CREVAWC’s online training has two key audiences. Member organizations use this system to enroll their employees in one of two separate training sessions (a one-hour or three-hour course), and HR managers use it to access the user completion data for general reporting purposes.

I find Opingo easy to use. The functionality provided out of the box is robust and easy enough to configure for online training and courses. The default theme makes for a good starting point too, though it is not quite up to accessibility standards. 

Our client needs its LMS to house SCORM compliant training courses, certificates, and as an interface to register for live seminars; it also needs to be able to grant access to registered administrators so they can view user completion data for their own reporting purposes.

The client’s public-facing site content management system is Drupal 8. This is great for me as a developer because it makes for the training system to integrate with its existing site that much easier. I am really happy with the seamless experience we are creating, complete with single-sign-on (SSO) and theme that matches the organization’s brand and that meets AODA standards. The change required is minimal and mostly includes font, colour, and logo changes.

We configured Opigno to achieve the following use case scenarios:

  • Training Courses: a course is an entity that contains one or several modules, allowing client to add in one step, several new modules to a training course;
  • Modules: a module is an entity designed to contain some online activities. It allows them to precisely configure the navigation within the activities composing that module, for example to define the order (sequential, random), the feedbacks, the minimum score, etc; and 
  • Activities: this is the base entity for online activities: it can be a theory slide, a quiz, an external activity loaded from a SCORM package, or even a H5P activity (interactive content).

Finally, courses, modules, instructor-led training and live meetings can be attached directly to the training. They can be marked mandatory for the training's validation and/or they can be combined together to be a learning path.

Opigno does have many other abilities and use-cases other than the ones I list above. For example, it can handle paid training using eCommerce functionality built on top of the Drupal Commerce contrib module. It can also integrate with a LRS using the TinCan API, meaning data from various LMS’s can be collected and displayed in a single place. Live meetings and collaborative workspaces are available too, although these are paid features through a third-party service. If you do choose to use these features, you would incur a monthly subscription fee. 

macbook open to landing page of CREVAWC training courses

Is Opigno right for me?

So, out of the hundreds of systems available, why did CREVAWC choose an Opigno solution? How do you know what’s right for your own LMS project? Here is a list of criteria we used for our own client that led us to the Opigno Drupal 8 distribution: 

  • You are familiar with Drupal and/or your public-facing site uses Drupal. Though not mandatory, your LMS should be able to 'blend in' with the software you’re already using. Otherwise, it could end up being more work than you first anticipate.
  • You need SCORM-compliant training courses, certificates, and an interface to register for live seminars.
  • You prefer open-source solutions over proprietary ones.
  • You want something secure and easy to update.

Are you considering using or do you use an LMS solution in your organization? Have you recently inherited one that needs some upgrades, or one that needs immediate help? We can help. 

Reach out to us by phone, chat, or email. 

Feb 24 2020
Feb 24

The first stable release of Smart Date delivered on my original vision for the module, namely, the need for a more app-like editor experience and intelligent formatting of dates and times in Drupal.

Thanks to feature requests and input from others in the Drupal community, it also included several enhancements that I had not originally thought for it to include - such as structured markup for more customizability, support for zero duration events, and better deduplication in formatting time and date ranges.

It was mid-2019 when we shared the first stable release of Smart Date. In the months since it’s been great to see its growing adoption by the Drupal community. 

What's New In Smart Date 2.0

Smart Date 2.0 is the latest major release (February 2020) of the Smart Date module. It contains many new features and optimizations inspired by and directly supported through Drupal’s active community and contributions of code. 

Recurring Events Made Easier in Drupal

Many websites - including a number of sites built by Digital Echidna - use the excellent Recurring Date Field module to handle recurring events. The only downside is that this module stores recurring instances separately, which changes how views need to be built to show them and requires special integration with other modules. 

Smart Date 2.0 stores the generated instance as standard field values. A single view lists recurring and non-recurring dates together. Any other modules that already work with Smart Date (such as Fullcalendar View) will work with Smart Date’s recurring dates:

screen view of recurring dates editor

Ready for Fullcalendar View 3.0

Speaking of calendars, at this point in time, using Smart Date with Fullcalendar View requires a patch. Mingsong, the maintainer of Fullcalendar View, plans for the 3.0 release to include an API to support additional integrations. Smart Date 2.0 has already implemented this API, and will work with Fullcalendar View 3.0 when it’s released.

Ability to Assign Timezones to Dates

We heard from the Drupal community that they wanted the ability to assign timezones to dates. For example, when building a site that lists concert tour dates, each event needs to show with the time in the local time zone. With Smart Date 2.0, a widget supports assigning these kinds of localized time zones on a per-date basis. When displayed, it shows the date in its specified timezone, but also reflects the site or user’s time, for the same date.

More Display Options for Date Values

For recurring dates, a special formatter now shows a translatable output of the recurring rule, with a configurable number of previous and upcoming instances:

date value display options

Smart Date users also requested that it allow the display of the start time and duration instead of the range from start to end. Thanks to Drupal’s object-oriented architecture, this was pretty easy to implement. Examples:

date options

Optimized for Claro and Adminimal

An exciting part of Drupal’s 8.9 release was the inclusion of the new Claro admin theme. Besides a design refresh, Claro is also built for accessibility. Smart Date 2.0 works as well with Claro as it does with Seven, and has also been tweaked to work well with the popular Adminimal admin theme.

Tested for Accessibility

Developing for inclusion is something of a passion for us at Digital Echidna, so this release includes accessibility improvements, for both the core widget and recurring dates elements.

Ready for Drupal 9

This release has been tested with the most current tools available to be ready for Drupal 9. It will likely need a few more tweaks before the planned release of Drupal 9 on June 3, 2020 but we will do our best to have Smart Date ready!

Bonus... A Module Starter Kit

We now also created a Smart Date Starter Kit to get you up and running quickly. If you just want to test it out, or maybe want to drop a simple implementation into a site build you’re working on, this starter kit will create an Event content type with an associated view to show upcoming and recent events in different tabs.

Community Contributions

I’m extremely grateful for all the positive feedback we’ve received so far, how the Drupal community has embraced Smart Date, and how they have helped it address a far broader set of use cases than I could have ever imagined on my own.

In that spirit, I want to introduce you to one of the community members who has been a passionate contributor to Smart Date on a variety of issues, Stefan Korn. Stefan is an Acquia Certified Drupal Developer and a freelancer in central Germany.

I recently connected with Stefan over email (I live and work in Canada) to ask him a few questions about his experience using Smart Date. 

This following is a transcript of our interview. 

When did you start using Drupal, and what got you into it?

I started using Drupal in 2011, starting with my first few projects in D6 but quickly turning to D7. A customer asked me about my opinion on Drupal and so I took a look and soon got hooked with Drupal.

What types of sites or other applications do you like using it for?

I am using it for all kind of sites, from brochure websites to eCommerce and bigger web sites. I am actually more or less only working with Drupal, so you name it …

Other than helping with modules, are there other ways you participate in the Drupal community?

I have occasionally been to Drupal Meetups in the Rhein/Main area (Frankfurt, Germany). I am participating in Drupal Stackexchange and a German Drupal forum, but not too frequently. Due to my freelance work I am in contact with several organizations, companies, agencies and people that are using Drupal.

How did you first hear about Smart Date?

I was searching for a more flexible date solution for D8 and was weighing between Smart Date and Datetime Extras. Smart Date made it and I am happy about that. It was even before 2.x and the cool recurring date feature, so the best part was still to come.

What were your first impressions?

First impression was very good, it solved the problem I was encountering with the core date (displaying the date exactly to my customers liking, using all day option).

You’ve contributed a lot of code fixes. Do you find it challenging to find the time for this work?

Yes, it’s challenging to find the time and since I am a self-employed freelance developer I also need to look at where to get the “Bucks” from and that’s sometimes difficult to align with code contribution …

Have you launched any sites yet with it?

There is one site that should be launched soon and I am planning to use it for a project of my own too.

Are there any changes or new features you’d like to see in the next major version?

I am generally into having a very good UI for the entering dates (quick and intuitive). I am also curious about views integration, which I haven’t tested very deeply so far.

Are there other pain points you’ve encountered in using and managing times and dates in Drupal?

Not specifically, I think the core datetime truly lacks some features to make it a viable solution in a project that is using dates and times at its core. So there is really a need for Smart Date.

[end of transcript]

The Path Forward

It’s so exciting to see Smart Date continue to evolve. I’m looking forward to seeing where the ongoing engagement with the Drupal community will take it next.

Jan 23 2020
Jan 23

Drupal’s massive and passionate community has long been the envy of the open-source world. The many thousands of active contributors to Drupal are its strength, and one of the key reasons Drupal continues to be a force while others have stumbled.

With the release of Drupal 9 rapidly approaching, the support of the community is more important than ever. Here’s your chance to make the first release of Drupal 9 even better!

The annual Drupal Global Contribution Weekend, where Drupal User Group Meetups all over the world volunteer Drupal development time and make open-source contributions, is this weekend.

Anyone can take part in this initiative either from the comfort of their own home or at a contribution event near them. It is a great way to meet new people, learn about Drupal, and be part of something bigger. 

Check this Drupal map to see if there is a group meeting near you.

If you are planning to attend Southwestern Ontario’s contribution Meetup event in London, Canada on January 25th, (still time to RSVP) read on to get some helpful pre-event recommendations. 

Drupal 8 license plate

Pre-Attendance Checklist

Here are five things you can do ahead of time so that you are prepared for a quick start - especially if you have not contributed to Drupal core before: 

  1. Create a user account on Drupal.org if you do not have one
  2. Install Git on your laptop* (Yes, you will need a laptop)
  3. Make sure your laptop has a local development environment* (more on this later)
  4. Set up Drupal*
  5. Have some knowledge of how to create and apply patches using git*

Do as many of these steps beforehand as you can. If you need help with one or more, someone can help you on the day. 

*Not mandatory if you plan to contribute to documentation or marketing issues on Drupal.org, instead of code.

Resources For Beginners

Some other things we recommend beginners do ahead of time is to get familiar with the following resources:

  • Search the Drupal 8 Issue Queue. A list of issues tagged as ‘novice’ can be found here.  
  • Read guidelines on how to make a good issue.
  • Chat with the Drupal community using Slack and speak to core maintainers directly in the #contribute channel.
  • Join the slack channel for #Global-contribution-weekend
  • Read Echidna’s How to Contribute to Drupal blog series 

Local Development Environment

To have a successful contribution weekend you will need a solid local development environment and to install the latest development branch of Drupal. You can use any local environment you are comfortable with and in my opinion, either Pantheon, XAMPP, or the Acquia Dev desktop, would have what you need.

  • Pantheon sandbox is easy to setup. You can work with it either in SFTP or Git mode if you don't want to set up a server on your computer. 
  • XAMPP is a simple, lightweight Apache distribution that works well to create a local web server for testing and deployment purposes.
  • The Acquia dev desktop local comes with almost all tools you would ever need - Apache, PHP, mySQL and drush - and it installs Drupal in one click so you can get going, faster.

At the Southwestern Ontario event, we will have available a limited number of older machines ready and set up, specifically for guests to use for writing and testing patches, etc. 

Social

Finally, let people know you participated on your social media by using the hashtags #ContributionWeekend #Drupal, and tag the Drupal Users Group that organized the event you attended. 

For Southwestern Ontario's event, use @LondonDUG and hashtag #WRDUG, download and post this badge. 

London Ontario building with loon

Digital Echidna is a proud sponsor of the Southwestern Ontario Global Drupal Contribution Event 2020. 

--

 

Sep 10 2019
Sep 10

Just like the poem says, “Little drop makes the mighty Ocean,” all contributions matter in the growth of the Drupal global community. 

A diverse community results in great things. To ensure the longevity of Drupal digital experiences and the adoption of this open-source technology, Drupal itself must be ready for a global audience. 

Contributors are Drupal's most valuable asset, and are the sole force behind improvements to the platform and the community itself. There are so many ways to contribute to Drupal. One way non-native English speakers like me can contribute to Drupal, is simply by volunteering time translating Drupal’s user interface text. 

Why does translation matter?

Drupal, by default, assumes modules and themes are written in English. This assumption of English as a default language creates a common ground and standard for sharing with the Drupal community. 

Modules and themes must be translated from English to other languages. To translate Drupal is to translate from English, the pieces of text (or set of “strings” in programming terminology) that are visible in buttons, menus, field captions, messages, and so on. 

At present in Drupal, there are 100 languages with about 115 translation groups. According to the translation status of Drupal 8, only Ukranian, French, and German are considered 100 per cent (with 9,353 strings) translated.

Malayalam is one of the languages in which I am fluent and it is a language spoken by 36 million people in Kerala, a southern state in India. Malayalam has incomplete versions of the text in core. Parts of the interface will still show up in English, while other parts need corrections and improvements of the language. 

When I started contributing to this particular translation project, it was immediately noticed and embraced by others in the online community. First, I was a Translation Self Moderator and Translation Content Moderator, then made Translation Community Manager. 

Translating Drupal means opening doors for talented developers everywhere to embrace the Drupal open-source platform. 

Whenever I do translation I feel like I’m solving a puzzle. When I get a chance to contribute to my mother tongue and home community, it is always a happy and prideful moment. I feel connected to a place very far away from where I live now, in Canada. 

I often think of Julia Carney's immortal lines (from her poem, Little Things), "Little drops of water,/Little grains of sand,/Make the mighty ocean/And the pleasant land./So the little minutes,/Humble though they be,/Make the mighty ages/Of eternity". Meaning, if things are done well and effectively on a regular basis, even if it’s only for a short while each day, it adds up to something substantial.

Interested? You too can join the Language Team from the Drupal Translation page and help out in the language of your choice by suggesting translations that will be later approved by team members with Content Moderator role. Strings can have multiple suggestions at a time, and even translated strings can receive further suggestions to help fine-tune translations. There is also something in it more than the greater good or feeling of a job well done -- issue contributors get credits on drupal.org. 

I want to thank both Steve Bayer (SteveBayerIN) and colleague M Parker (mparker17), for helping me get started.  

ഈ ലേഖനം വായിച്ചതിന് നന്ദി ! :-)

Read other blogs in this series, How To Contribute to Drupal

--

Did you enjoy this article? Get more just like it by signing up to receive Digital Echidna’s free e-newsletter, delivered to your inbox every month. Subscribe today.

May 24 2019
May 24

Time is always of the essence. From a consumer perspective, you want to know when events take place, when something’s open or closed, how long a meeting or activity will last. And, from a development perspective, you want to be able to create a date field that’s intuitive for the users, but doesn’t involve a lot of custom work.

There’s a default functionality in Drupal 8 that, while functional, is cumbersome. So I recently developed a module called Smart Date that will make things a lot easier for site developers -- and provide that functionality that editors want.

I initially identified the need back when I was working on a client site that required me to enter some sample content. We’ve all used calendar software -- whether it’s a Google or Outlook calendar, or even what you have on your phone.

In this instance, with Drupal, I needed to enter the year, month, and date. I also had to enter a start hour, start minute, and define whether it was AM or PM. And then do it all over again for the end time, meaning 12 fields to fill out for each instance. As a user, we have an expectation and assumption that entries would autopopulate end times -- but you know what they say about assumptions.

I wanted Drupal to have that same ease of use. To achieve that, I made a date widget that adds a concept of duration. Like your calendar application, it can assume a default duration, so as soon as you enter the start, it can populate the end for you.

As a site builder you can choose this default duration, so if you want it to be one hour (like Google and Apple’s calendars) if can do that out of the box. If you’re building a recruiting site that should default to 15-minute intervals, that’s up to you.

You can even restrict what intervals are available. In the default setup, editor has the convenience of choosing from a default duration or making a custom range if they need something that isn’t listed. But suppose you’re organizing a conference where the sessions will all be 45 or 90 minutes in length. As a site builder, Smart Date allows you to enforce these constraints.

Another request we’ve had from clients is the ability to designate events as “all day”. Again, something we’ve all become used to in our calendar applications. And a perfectly valid use case in how we need to register events on the sites we build. But up until now, we’ve had to custom build a solution as a customization, again and again. Smart Date gives your editors this ease-of-use with the click of a button – again unless the needs of your solution dictate that as a site builder, you need to take that option away (which you can).

Another request we get again and again – and have had to build custom – is to make the display of time and date ranges more intelligent. For example, if you were formatting a date range by hand, if the start and the end were on the same date, you wouldn’t write the date on both, you’d only write it once. Smart Date has this kind of intelligence built in. It’s a little more complex to set up, but hopefully, the presets will work for a wide range of use cases, and in time we’d like to see translations available on localize.drupal.org so a wide variety of cultures can get their preferred date and time formats available on install.

One last major aspect of Smart Date is performance. At Digital Echidna, we know that the speed of a site is a critical component of the overall experience, not to mention SEO. We test our sites at various points during development to ensure they’ll meet the appetite by web visitors for a site that not only looks great and is easy to use, but loads quickly so they get done what they need, and go back to surfing for funny cat videos.

In a recent mid-development site performance audit, I realized that the slowest page identified was an events archive, even though it held almost no content. When I looked at the query Drupal had constructed based on the view configuration, I realized the core date fields were storing values as strings, and at query, every row had to convert multiple values into date formats in order to make the required comparisons. I’ve since spoken to a number of other developers within the Drupal community, who have had to build workarounds so that date and time stored in Drupal can be accessed in a way that meets web visitors’ ever-increasing expectations for fast page loads.

MySQL has its own DATETIME field especially to provide fast queries for storing and accessing this type of data, but the Drupal core team chose not to use it but a solution that depends on this wouldn’t be portable to other database engines, which is understandable. For Smart Date, I chose to store the values as timestamps, which have some limitations in their ability to store values in the far future or distant past, but more than meet the need for what we see as a typical use case, storing coming or recent events.

The beauty of this approach is that we could use functionality built into Drupal 8 for date and time functionality (handling of date and time widgets, with validation, etc) and its built-in capabilities for storing and retrieving timestamps (which are still used for node creation and revision dates, for example) and only write the code that is necessary to translate between the two.

It’s a testament to the object-oriented infrastructure of Drupal 8 that we could build this solution using different parts of what’s already in Drupal 8 core, and focus our efforts on adding code where it really adds value.

The module has already started to get feature requests, so I expect we’ll see its capabilities continue to grow, as other developers submit patches to “scratch their own itch”. That pooling of community effort is another key strength for Drupal, as we can all benefit from the work we do individually to make things better.

We hope that Smart Date will make Drupal sites better solutions: for site builders, for the editors that use them, and for the visitors who come to consume the content. All by making it easy for Drupal to work like the calendar application we’ve all become accustomed to using, from technology giants like Google, Apple, and Microsoft.

At Digital Echidna, we’re committed to improving that experience across the board with our products, so that when someone who is not as familiar with Drupal is entering content, it’s going to be a positive, intuitive, and enjoyable experience. When we discover a new, better, or more intuitive way to do things, we add that to our baseline development toolbox to ensure that all of our customers can benefit from that improved experience.

We often take for granted how much back-end work goes into creating what appears to be a simple bit of online functionality. But these things take time -- and with Smart Date, I’m hoping that this module will provide a better experience that lets people spend less time developing and frees up more time to focus on creating innovative, customer-focused solutions.

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