Planet Drupal

Evolving Web: Integrating Auth0 with Drupal for Single Sign-On Authentication

58 minutes 42 seconds ago
Using Auth0 to create a centralized login page for Drupal sites

Drupal’s basic user authentication system is ideal for small and isolated apps. But when users are signing into multiple interactive sites and apps, it makes sense to offer a centralized authentication system to save users from remembering multiple passwords.

These days, social sites have become de facto identity providers. Users expect websites to provide social login and single sign on functionality. In these scenarios, the built-in Drupal authentication system is very limited.

Introducing Auth0: authentication and authorization as a service

There are several ways of enabling single sign-on and social logins on Drupal websites. In this article, we’ll introduce Auth0 and explain how to use it to create a cool, centralized login page like the one shown below.

Auth0 provides authentication and authorization as a service. It includes various methods to authenticate, such as username/password, social accounts, SAML and OTP. It can also connect on-premise identity databases. The authentication mechanism is device-agnostic, so it works consistently across various devices.

Auth0 implements OAuth 2.0 — an open standard for authentication that can be used between applications and websites. It also implements other standards that can be used for authentication, including SAML and OpenID Connect.

Here are some of the ways you can integrate Auth0 with Drupal

  • As a single sign-on across multiple Drupal apps, where Auth0 acts as a central store for credentials

  • To allow users to log into Drupal using existing credentials from systems such as LDAP, Google Suite, or Office 365

  • To integrate social logins such as Google and Facebook

How to implement Auth0

In the steps below, you’ll learn how to set up Auth0 on a Drupal site for a typical use case. It will enable users to log into your Drupal site using their social media accounts. They'll also be able to create an account if they don't already have one.

There are two Auth0 modules you can choose from:

  • Auth0 module on GitHub: is the official module. It has more features but doesn't follow all of Drupal coding standards.

  • Auth0 module on Drupal.org is a fork of the official module on drupal.org. It follows coding standards, but lacks some functionality, as many changes have not been merged from the aforementioned GitHub repository.

When we integrated Auth0 on a client’s site a few months ago, we spent a good amount of time analyzing these two modules.

Only some basic features were required, all of which were available in the Drupal.org module. We therefore opted for cleaner code over the additional features.

In fact, both modules contained errors that we needed to fix. The generic patches that resulted from this process were submitted to both repositories. These patches were recently merged; there is some collaboration underway to sync changes between the two repositories. In the future, this will save users the extra step of choosing a module.

Create an Auth0 Application

Here is the basic configuration to get started with Auth0 for Drupal.

Note that it’s very important that the callback you use in this configuration is HTTPS. You should always use HTTPS in production (or even during development if sensitive user accounts are being used).

  1. Create an Auth0 account and log into the Auth0 Dashboard.

  2. Create a new application and select Type as "Regular Web Applications".

  3. In the Settings tab, do the following:

    1. Add https://example.com/auth0/callback to the Allowed callback URLs section. Make sure you replace example.com with the domain name of your site. You can also add local URLs.

    2. Add https://example.com/user/logout to the allowed logout URLs section.

    3. Add https://example.com to the Allowed Origins (CORS) section to allow the origins that will be able to make requests.

  1. Proceed to the next step and select PHP for "What technology are you using for your web app?"

  2. Go to Connections > Social and enable the social logins that you want to use (these links are located in left sidebar of the Auth0 Dashboard)

You are now done with the basic setup! Users can now create accounts, or log in using their credentials from the providers that you enabled in the previous step.

Optional Configuration

Additionally, Auth0 provides many features for building advanced authentication mechanisms, and it can determine how data is stored and passed to applications.

For example, Auth0 enables you to:

  • Use add-ons to generate access tokens for systems such as Salesforce, Azure Service Bus and SAP.

  • Configure social connections for authentication.

  • Implement username and password authentication to have an Auth0 DB or your own DB connected to store authentication information.

  • Use passwordless authentication to send a login link to email or OTPs to mobile.

  • Use multi-factor authentication.

  • Customize data shared with apps, but using simple JavaScript based rules.

Configure Auth0 in Drupal

Next, you'll need to configure Drupal to connect to the Auth0 Client we created:

  1. Go to the Auth0 configuration page (admin/config/auth0) in your Drupal site’s admin area.

  2. Add the Auth0 Credentials Client ID, Domain and Client Secret. This information is in the Auth0 dashboard.

  3. Make sure you select RS256 as the "JWT signature algorithm". This is the default algorithm configured in the Auth0 Client.

Advanced Setup

Depending on how you want users to log in, you can use the Auth0 hosted login page or embed a widget in the Drupal login page/block:

  • Select Redirect login for SSO to use an Auth0 hosted login page. We recommend this option because it’s more secure. It is ideal if you have multiple web applications using the same authentication information — users will be logged in automatically without having to provide their credentials each time. If you want more control over how the widget looks using the hosted login approach, you can customize the look in the "Hosted Pages" section in the Auth0 Dashboard.

  • Select Redirect login for SSO to embed a widget in the login page and block. This makes more sense for an isolated app.

Similarly you can select other options, such as: allowing users to signup via Auth0, or requiring users to verify their email addresses before they can log in.

Next Steps

Now that you have done the basic Auth0 setup, it’s time to learn more about what Auth0 can bring to your Drupal site and explore how you can extend Auth0 functionality:

  • Read the Auth0 official documentation pages.

  • Extend the Auth0 module’s functionality by subscribing to various events, such as Auth0UserSigninEvent and Auth0UserSignupEvent.

We’d love to hear about new ways you’ve found to implement Auth0 to streamline authentication. Leave us a comment to share your questions, experiences and use cases.

+ more awesome articles by Evolving Web

Sooper Drupal Themes: Drupal 8 Menu Tutorial And How To Create Dropdown Menus | 8 Days To Drupal 8 | Day 8

5 hours 46 minutes ago

We're counting down the days to the official SooperThemes Drupal 8 Release! Count with us as we will be writing a Drupal 8 related blog post every day for the next 8 days.

Drupal 8 menus, menu links, and dropdown menus video tutorial

view on sooperthemes.com if you can't see the video

A well designed menu is a menu that works great on all devices and gets your users where they need to go with minimal effort. We'll first get into the basics of creating and placing menu links in Drupal 8 and then cover the topic of dropdown menus. 

Managing Menu Links In Drupal 8

Menus are part of the structure of your Drupal website and you manage them by clicking Structure and then Menus. Here you find a listing of menus installed on your website. The most important item in the list is the Main Navigation. There may be other menus in your website, but there is one menu that is more important than all others because it links to your most important pages and is placed at the top of your page. 

At the far right in the Menus administration page click the "edit links" item in the Main Navigation row. This will take you to an overview of the links in your main menu. If you just installed the Drupal 8 default installation profile this menu will only contain the Home link. If you installed one of the Glazed Theme demos the main menu will contain a number of links already

Drupal 8 Links Administration

Adding New Menu Links In Drupal 8

Once you are at the Main Navigation administration form (Structure > Menus > Main Navigation/edit menu) you see an overview of the links that are already in your main menu. Here you can add, edit, and delete links. You can also change the order of links by dragging the move icon at the left hand side of the table.

To add a new link click the "+ Add link" button at the top of the table. For the menu link title fill in the link text that you want to appear in your main menu. In the link field you can add an internal path, or an external URL. With the weight option in the end of the form you can tell Drupal to place new menu items to the front or the back of the menu. For example you can add a weight of 10 to you Contact link because you typically want that link to appear in the end of the menu.

The other optionsnot important now and they'll be covered in the next section when we talke about dropdown menus. 

Drupal 8 Creating A New Link

Creating A Dropdown Menu

Dropdown menus are a popular solution when you want site visitors to be able to reach a large number of pages in a single click. One such situation is in the main demo website of our Glazed Theme and Glazed Builder products. We know people want to explore the elements and features that are offered to we organize close to a 100 menu items all in the main navigation.

There are generally 2 different paths to get a dropdown menu in your Drupal website: From your theme or from a module. If you use our Glazed Theme you have a dropdown menu system built into the theme. If you use a theme that doesn't support dropdown menus (like Drupal's default theme) and you don't want to code it yourself, you can rely on a module like SuperFish.

Drupal 8 Glazed Main Demo Dropdown Menu

Dropdown Menus Included In Glazed Theme

The menu system in Glazed theme is one of the biggest selling points of the theme because it's a beautiful, user-friendly menu that works perfectly with Drupal's native menu administration. With the flick of a switch you can have a horizontal menu or a vertical menu. It supports multi-level menus by automatically creating a megamenu for large devices and collapsing into a beautiful vertical menu on small devices. The menu's design is customizable in the Glazed Theme Settings system.

To create a dropdown menu on your Glazed Theme website, or when using any theme that has support for dropdown menus built in we're only have to edit our Main Navigation menu links to have parent and child links. By parent links we mean the menu links that are in show navigation bar and the child links are the links that are contained in a dropdown box that appears only when we hover a parent link. One little quirck in Drupal is that you have to remember to enable the Expanded checkbox on every parent link for your dropdowns to work. Check out the video above to see how we build the menu structure.

Dropdown Menus With The SuperFish Drupal 8 Module

If your theme doesn't support dropdown menus natively you can add the SuperFish module to your Drupal website. You might also use this module if it has some features or design elements that you prefer over the system built into your theme. 

The SuperFish module also relies on the menus created in Drupal's native menu administration pages, and you'll also be creating a menu structure with parent and child links. Check out the video above to see how the structure is made.

Once you have the menu structure set up you can download the SuperFish module and follow the instructions on their project page to install it. Next you will go to the blocks administration page to remove the Main Navigation block to then replace it with the SuperFish Main Navigation block. This is a new block the is generated by the SuperFish module. Once you place this block you can view your homepage and the dropdown menu should be working. As was the case in our demo that we did in our video above you may have to do some theming to style the menu.

OPTASY: How to Migrate Content to Drupal 8 Using the Migrate Module: No Line of PHP Needed!

9 hours 52 minutes ago
How to Migrate Content to Drupal 8 Using the Migrate Module: No Line of PHP Needed! radu.simileanu Tue, 04/24/2018 - 16:42

Whether you're "constrained" to migrate content to Drupal 8 or you're just eager to jump on the Drupal 8 bandwagon and harness all its much-talked-about advanced features, the most important “warning/advice” to keep in mind is:

Don't migrate mindlessly!

Meaning that before you even get to the point of:
 

  • triggering the Migrate module's capabilities and adjusting them to your migration project's needs and requirements
  • selecting and combining all the needed contrib modules
  • writing down your YAML files for carrying out your content migration process
     

You'll need to think through every little aspect  involved in /impacted by this process:
 

Drupal blog: State of Drupal presentation (April 2018)

10 hours 23 minutes ago

This blog has been re-posted and edited with permission from Dries Buytaert's blog. Please leave your comments on the original post.

© Yes Moon

Last week, I shared my State of Drupal presentation at Drupalcon Nashville. In addition to sharing my slides, I wanted to provide more information on how you can participate in the various initiatives presented in my keynote, such as growing Drupal adoption or evolving our community values and principles.

Drupal 8 update

During the first portion of my presentation, I provided an overview of Drupal 8 updates. Last month, the Drupal community celebrated an important milestone with the successful release of Drupal 8.5, which ships with improved features for content creators, site builders, and developers.

Drupal 8 continues to gain momentum, as the number of Drupal 8 sites has grown 51 percent year-over-year:

This graph depicts the number of Drupal 8 sites built since April 2015. Last year there were 159,000 sites and this year there are 241,000 sites, representing a 51% increase year-over-year.

Drupal 8's module ecosystem is also maturing quickly, as 81 percent more Drupal 8 modules have become stable in the past year:

This graph depicts the number of modules now stable since January 2016. This time last year there were 1,028 stable projects and this year there are 1,860 stable projects, representing an 81% increase year-over-year.

As you can see from the Drupal 8 roadmap, improving the ease of use for content creators remains our top priority:

This roadmap depicts Drupal 8.5, 8.6, and 8.7+, along with a column for "wishlist" items that are not yet formally slotted. The contents of this roadmap can be found at https://www.drupal.org/core/roadmap.

Four ways to grow Drupal adoption

Drupal 8 was released at the end of 2015, which means our community has had over two years of real-world experience with Drupal 8. It was time to take a step back and assess additional growth initiatives based on what we have learned so far.

In an effort to better understand the biggest hurdles facing Drupal adoption, we interviewed over 150 individuals around the world that hold different roles within the community. We talked to Drupal front-end and back-end developers, contributors, trainers, agency owners, vendors that sell Drupal to customers, end users, and more. Based on their feedback, we established four goals to help accelerate Drupal adoption.

Goal 1: Improve the technical evaluation process

Matthew Grasmick recently completed an exercise in which he assessed the technical evaluator experience of four different PHP frameworks, and discovered that Drupal required the most steps to install. Having a good technical evaluator experience is critical, as it has a direct impact on adoption rates.

To improve the Drupal evaluation process, we've proposed the following initiatives:

Initiative Issue link Stakeholders Initiative coordinator Status Better discovery experience on Drupal.org Drupal.org roadmap Drupal Association hestenet Under active development Better "getting started" documentation #2956879 Documentation Working Group grasmash In planning More modern administration experience #2957457 Core contributors ckrina and yoroy Under active development

To become involved with one of these initiatives, click on its "Issue link" in the table above. This will take you to Drupal.org, where you can contribute by sharing your ideas or lending your expertise to move an initiative forward.

Goal 2: Improve the content creator experience

Throughout the interview process, it became clear that ease of use is a feature now expected of all technology. For Drupal, this means improving the content creator experience through a modern administration user interface, drag-and-drop media management and page building, and improved site preview functionality.

The good news is that all of these features are already under development through the Media, Workflow, Layout and JavaScript Modernization initiatives.

Most of these initiative teams meet weekly on Drupal Slack (see the meetings calendar), which gives community members an opportunity to meet team members, receive information on current goals and priorities, and volunteer to contribute code, testing, design, communications, and more.

Goal 3: Improve the site builder experience

Our research also showed that to improve the site builder experience, we should focus on improving the three following areas:

  • The configuration management capabilities in core need to support more common use cases out-of-the-box.
  • Composer and Drupal core should be better integrated to empower site builders to manage dependencies and keep Drupal sites up-to-date.
  • We should provide a longer grace period between required core updates so development teams have more time to prepare, test, and upgrade their Drupal sites after each new minor Drupal release.

We plan to make all of these aspects easier for site builders through the following initiatives:

Initiative Issue link Stakeholders Initiative coordinator Status Composer & Core #2958021 Core contributors + Drupal Association Coordinator needed! Proposed Config Management 2.0 #2957423 Core contributors Coordinator needed! Proposed Security LTS 2909665 Core committers + Drupal Security Team + Drupal Association Core committers and Security team Proposed, under discussion Goal 4: Promote Drupal to non-technical decision makers

The fourth initiative is unique as it will help our community to better communicate the value of Drupal to the non-technical decision makers. Today, marketing executives and content creators often influence the decision behind what CMS an organization will use. However, many of these individuals are not familiar with Drupal or are discouraged by the misconception that Drupal is primarily for developers.

With these challenges in mind, the Drupal Association has launched the Promote Drupal Initiative. This initiative will include building stronger marketing and branding, demos, events, and public relations resources that digital agencies and local associations can use to promote Drupal. The Drupal Association has set a goal of fundraising $100,000 to support this initiative, including the hiring of a marketing coordinator.

Megan Sanicki and her team have already raised $54,000 from over 30 agencies and 5 individual sponsors in only 4 days. Clearly this initiative resonates with Drupal agencies. Please consider how you or your organization can contribute.

Fostering community with values and principles

This year at DrupalCon Nashville, over 3,000 people traveled to the Music City to collaborate, learn, and connect with one another. It's at events like DrupalCon where the impact of our community becomes tangible for many. It also serves as an important reminder that while Drupal has grown a great deal since the early days, the work needed to scale our community is never done.

Prompted by feedback from our community, I have spent the past five months trying to better establish the Drupal community's principles and values. I have shared an "alpha" version of Drupal's values and principles at https://www.drupal.org/about/values-and-principles. As a next step, I will be drafting a charter for a new working group that will be responsible for maintaining and improving our values and principles. In the meantime, I invite every community member to provide feedback in the issue queue of the Drupal governance project.

An overview of Drupal's values with supporting principles.

I believe that taking time to highlight community members that exemplify each principle can make the proposed framework more accessible. That is why it was very meaningful for me to spotlight three Drupal community members that demonstrate these principles.

Principle 1: Optimize for Impact - Rebecca Pilcher

Rebecca shares a remarkable story about Drupal's impact on her Type 1 diabetes diagnosis:

Principle 5: Everyone has something to contribute - Mike Lamb

Mike explains why Pfizer contributes millions to Drupal:

Principle 6: Choose to Lead - Mark Conroy

Mark tells the story of his own Drupal journey, and how his experience inspired him to help other community members:

Watch the keynote or download my slides

In addition to the community spotlights, you can also watch a recording of my keynote (starting at 19:25), or you can download a copy of my slides (164 MB).

Drupal blog: Defining Drupal's values and principles

11 hours 9 minutes ago

This blog has been re-posted and edited with permission from Dries Buytaert's blog. Please leave your comments on the original post.

Since its founding, Drupal has grown a great deal, and today there are thousands of contributors and organizations that make up our community. Over the course of seventeen years, we have spent a great amount of time and effort scaling our community. As a result, Drupal has evolved into one of the largest open source projects in the world.

Today, the Drupal project serves as a role model to many other open source projects; from our governance and funding models, to how we work together globally with thousands of contributors, to our 3,000+ person conferences. However, the work required to scale our community is a continuous process.

Prompted by feedback from the Drupal community, scaling Drupal will be a key focus for me throughout 2018. I have heard a lot of great ideas about how we can scale our community, in addition to improving how we all work together. Today, I wanted to start by better establishing Drupal's values and principles, as it is at the core of everything we do.

Remarkably, after all these years, our values (what guides these behaviors) and our principles (our most important behaviors) are still primarily communicated through word of mouth.

In recent years, various market trends and challenging community events have inspired a variety of changes in the Drupal community. It's in times like these that we need to rely on our values and principles the most. However, that is very difficult to do when our values and principles aren't properly documented.

Over the course of the last five months, I have tried to capture our fundamental values and principles. Based on more than seventeen years of leading and growing the Drupal project, I tried to articulate what I know are "fundamental truths": the culture and behaviors members of our community uphold, how we optimize technical and non-technical decision making, and the attributes shared by successful contributors and leaders in the Drupal project.

Capturing our values and principles as accurately as I could was challenging work. I spent many hours writing, rewriting, and discarding them, and I consulted numerous people in the process. After a lot of consideration, I ended up with five value statements, supported by eleven detailed principles.

I shared both the values and the principles on Drupal.org as version 1.0-alpha (archived PDF). I labeled it alpha, because the principles and values aren't necessarily complete. While I have strong conviction in each of the Drupal principles and corresponding values, some of our values and principles are hard to capture in words, and by no means will I have described them perfectly. However, I arrived at a point where I wanted to share what I have drafted, open it up to the community for feedback, and move the draft forward more collaboratively.

An overview of Drupal's values with supporting principles.

While this may be the first time I've tried to articulate our values and principles in one document, many of these principles have guided the project for a very long time. If communicated well, these principles and values should inspire us to be our best selves, enable us to make good decisions fast, and guide us to work as one unified community.

I also believe this document is an important starting point and framework to help address additional (and potentially unidentified) needs. For example, some have asked for clearer principles about what behavior will and will not be tolerated in addition to defining community values surrounding justice and equity. I hope that this document lays the groundwork for that.

Throughout the writing process, I consulted the work of the Community Governance Group and the feedback that was collected in discussions with the community last fall. The 1.0-alpha version was also reviewed by the following people: Tiffany Farriss, George DeMet, Megan Sanicki, Adam Goodman, Gigi Anderson, Mark Winberry, Angie Byron, ASH Heath, Steve Francia, Rachel Lawson, Helena McCabe, Adam Bergstein, Paul Johnson, Michael Anello, Donna Benjamin, Neil Drumm, Fatima Khalid, Sally Young, Daniel Wehner and Ryan Szrama. I'd like to thank everyone for their input.

As a next step, I invite you to provide feedback. The best way to provide feedback is in the issue queue of the Drupal governance project, but there will also be opportunities to provide feedback at upcoming Drupal events, including DrupalCon Nashville.

groups.drupal.org frontpage posts: Have your say in where Drupal 8 is going by participating in key initiatives

12 hours 8 minutes ago

Maybe you have seen Dries Buytaert's DrupalCon keynote and are looking forward to all the goodies coming in future Drupal 8 versions. The truth is none of those things will happen without people who want to make them happen to solve their own challenges with implementing and showcasing Drupal solutions. Are you implementing decoupled solutions and have issues you are working on? In the middle of building up a suite of integrated media solutions? These core team meetings are ideal to bring in these issues and discuss solutions and to be part of shaping up where Drupal 8 is heading. Read on for details.

  1. There is a weekly meeting on all API first work (REST, Waterwheel, JSON API, GraphQL) every Monday 2pm UTC on Google Hangouts. A link to the current hangout is posted 5 minutes before the meeting in the #drupal-wscci IRC channel.
  2. The Out of the box/demo team also meets every Monday at 3pm UTC on Google Hangouts.
  3. The Javascript office hours are held weekly in https://drupal.slack.com/archives/javascript every Monday at 4:30pm UTC. Get an invite at http://drupalslack.herokuapp.com/.
  4. The Panels ecosystem meeting is on every Tuesday at 5pm UTC in the #drupal-scotch IRC channel.
  5. The usability meeting is every week at 7:30pm UTC on Tuesday at https://drupal.slack.com/archives/ux, get an invite at http://drupalslack.herokuapp.com/
  6. There is a media meeting every Wednesday at 2pm UTC, join at https://drupal.slack.com/archives/media, get an invite at http://drupalslack.herokuapp.com/.
  7. Wanna help with migrate? The team either meets in Google Hangouts or the #drupal-migrate IRC channel. (Discussed at the start of the meeting based on lead availability in IRC). Meetings are on Thursdays 9pm UTC and 2pm UTC on a weekly alternating basis.

Below is the calendar of all the meetings, subscribe to the Ical feed at https://calendar.google.com/calendar/ical/happypunch.com_eq0e09s0kvcs7v5...

DrupalEasy: DrupalEasy Podcast 209 - Local Development Environments

16 hours 15 minutes ago

Direct .mp3 file download.

Ted Bowman and Mike Anello, both back from DrupalCon Nashville, spend some quality time together to catch up on all the latest happenings involving local development environments. Ted hosted some BoFs about the topic, and Mike posted a comparison of some of the more popular Docker-based, Drupal-focused local development tools, so we figured it was a good time to devote an entire podcast on the topic. In addition, Mike and Ted name their "favorite thing" from DrupalCon Nashville.

Discussion Sponsors Follow us on Twitter 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.

Dropsolid: Solr search and multilingual content in Drupal

16 hours 35 minutes ago
24 Apr Make SOLR understand your multilingual content to improve the user experience Kevin VB Drupal 8 Apache

We all use searches multiple times a day without ever giving them a second thought. Browsing a webshop to find that one particular product, searching through forums to find a solution to your specific problem, or filtering stores based on your location to find the closest one, etc.

All of these examples require the same thing: content that is indexed in such a way that it can be filtered. In general, this is quite easy to set up: all you need is a database and a query to get you started.

However, what should you do if your visitors are more demanding and expect to be fed the right content when searching for plurals or a combination of words or synonyms? In the majority of cases, such complex queries fall beyond the reach of default search solutions, leading to dreaded messages like ‘Your search yielded no results’. This very quickly leads to user frustration and, subsequently, fewer conversions on your website. And this is only the start of it… What if your website also serves Germanic languages other than English? Suddenly, you are confronted with concatenations of words such as the infamous ‘Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz’ or ‘Chronischevermoeidheidssyndroom’.

In this blogpost, we explain how you can configure Apache Solr to improve your multilingual content indexing and querying. We will shed some light on the ways indexing and querying is configured and can be tested, so you can make sure that Solr can understand your content and return a better result when users are searching through it. We will be using Dutch as an example, because of its compound word complexity. The underlying principles, however, are valid in plenty of use cases for other languages and search-related problems.


What are compound words?

First things first: let’s analyze our definitions. If we stick with the example of ‘chronischevermoeidheidssyndroom’. This word consists of multiple building blocks: the adjectives ‘Chronische’ and ‘vermoeidheid’ and the noun ‘syndroom’. In Dutch, it is perfectly acceptable to combine these elements into one long noun - and the exact same principle applies to German. In English, the direct translation looks very similar: ‘Chronic Fatigue Syndrome’. The only difference, of course, is those handy spaces in between the individual components! Most language processing tools split words by spaces, which makes it easy to search for parts of a search term, as they already appear split up in the text. In the case of the German and Dutch examples above, this isn’t so easy to do. Because of this added complexity, we will need to configure our language processing tool to understand what the possible compound words are and how they are combined. Luckily, there are certain grammar tools around that make it possible to tackle this added complexity through handy algorithms!


Getting started

First of all, we must make sure to install the necessary modules:

The Search API acts as a bridge between different search servers and the Search API Solr allows to communicate with a Solr server.
Once those modules have been installed, the most important one for multilingual sites is the Search API Solr Multilingual module. This module allows to connect with a Solr server with better support for non-English languages.

If you are using the 8.2.x branch of Search API Solr, you won’t have to download the multilingual module, as it is merged into the Search API Solr module.
Once these modules have been installed, you will be able to set up a connection to a Solr server using the Multilingual backend connector. We will not go any deeper into the whole installation process, as the modules all come with their own detailed installation instructions.


Configuring your Solr server for multilingual content

The multilingual Solr module also provides a download mechanism that generates the Solr configuration files that are needed to support multilingual content indexation. 
One of the most important files in this configuration is the schema_extra_types.xml file.

This file declares a field type called text_nl, which has some filters declared when indexing the content and some when performing a query on the index. Some names speak for themselves, for example:

  • MappingCharFilterFactory: this uses the accents_nl.txt file to map a certain character to another. Using this, we can filter out special characters. This means that  the search mechanism can still understand what you’re looking for if you search without using this special character.
  • CharacterWhitespaceTokenizerFactory: this tokenizer splits words based on whitespace characters - this way each word get indexed.
  • LengthFilterFactory: Filters out words based on the max and min values. Example: min=2, max=100 will filter out words that are less than 2 characters and longer than 100 characters.
  • LowerCaseFilterFactory: makes the token lower case.
  • StopFilterFactory: Filters out words which are mentioned in the stopwords.txt file attached to this filter. This list contains words with no added value, like eg. but, for, such, this or with.
  • SnowballPorterFilterFactory: The most important argument for this factory is the language argument, as this will define how the stem of a certain word is defined. As you can see in the example, we are using Kp and not NL for Dutch stemming. This is because the Kp stemmer better stems Dutch words. Want to know more about this algorithm? You can find all the details via this link
    In short, this filter will result in plural words being indexed together with the stem of the word. E.g. 'modules' → 'modules', 'module'
  • RemoveDuplicatesTokenFilterFactory: removes any duplicate token.

Some filters are more complex, so let’s explain them more in-depth:

  • WordDelimiterFilterFactory: this filter will split words based on the arguments.
    • CatenateNumbers: If non-zero number parts will be joined: '2018-04' → '201804'.
    • GenerateNumberParts: If non-zero it splits numeric strings at delimiters ('2018-04' → '2018', '04'.
    • SplitOnCaseChange: If zero then words are not split on CamelCase changes. Example: 'splitOnCaseChange' → 'split', 'On', 'Case', 'Change'.
    • GenerateWordParts: If non-zero words are splitted at delimiters. 'DrupalCon' → 'Drupal', 'Con'.
    • PreserveOriginal: if non-zero the original entry is preserved. 'DrupalCon' → 'DrupalCon', 'Drupal', 'Con'.
    • CatenateAll: If non zero words and number parts will be concatenated. 'DrupalCon-2018' → 'DrupalCon2018'
    • CatenateWords: If non zero word parts will be joined: 'high-resolution-image' → 'highresolutionimage'
    • Protected: the path to a file that contains a list of words that are protected from splitting.
  • DictionaryCompoundWordTokenFilterFactory: this filter splits up concatenated words into separate words based on the list of words given as dictionary argument. Example: 'flagpole' → 'flag', 'pole'
  • SynonymFilterFactory: This filter allows to define words as synonyms by passing along a list of synonyms as synonyms argument. This list is a comma separated list of words which are synonyms. This can also be used to solve spelling mistakes.
    • Example: drupal, durpal - Will make sure that when a user searches for durpal, results with drupal indexed will be returned as possible matches.

With this setup, you should be able to make your search indexing and querying a lot smarter. You can find different synonyms.txt, nouns.txt and accent.txt files if you search the web for your language. 


Where can I find these txt files?

Remember the section about the compound words? This is where this knowledge comes in handy. We spent a long time browsing the web to find a good list of compound words and stop words. To make your life easier, we’ve attached them to this blog post as GitLab links for you to see, edit and collaborate on. These files are for Solr version 5 and above and are for the Dutch, English & French language.

Pay attention, however! When adding these files to an existing index, you will need to use a multilingual server connection and then reindex your data. If you don’t do this, your index and query will no longer be in sync and this might even have a negative impact on your environment.


Testing indexed and query results

When you have installed a Solr server and core, you can visit the Solr dashboard. By default, this can be reached on localhost:8983/
If you select your core, you will be able to go to the Analysis tab.

This screen allows to perform a search and see how the index (left input) or the query (right input) will handle your value. It’s important to select the field type, so the analysis knows what filters it needs to use on your value.


Things to avoid

Let’s stick with our example of the Dutch word ‘Chronischevermoeidheidssyndroom’ and see how the index will handle this word. If you don’t configure Apache Solr with support for Dutch, it will only store ‘chronischevermoeidheidssyndroom’ in the index. If someone were to look for all kinds of ‘syndromes’, this item wouldn’t show up in the website’s results. Perhaps you would expect otherwise, but Apache Solr isn’t that smart.


What you do want to happen

However, if the index is configured correctly with support for Dutch words, it will return the following results:
 

 Name of filter

 

 MappingCharFilterFactory

 C|h|r|o|n|i|s|c|h|e|v|e|r|m|o|e|i|d|h|e|i|d|s|s|y|n|d|r|o|o|m

 WhitespaceTokenizerFactory

 Chronischevermoeidheidssyndroom

 LengthFilterFactory

 Chronischevermoeidheidssyndroom

 LowerCaseFilterFactory

 chronischevermoeidheidssyndroom

 DictionaryCompoundWordTokenFilterFactory

“chronischevermoeidheidssyndroom”, “chronisch”, “chronische”, “scheve”, “vermoeid”, “vermoeidheid”, “syndroom”, “droom”, “room”

 StopFilterFactory

“chronischevermoeidheidssyndroom”, “chronisch”,  “chronische”, “scheve”, “vermoeid”, “vermoeidheid”,  “syndroom”, “droom”, “room”

 SnowballPortretFilterFactory

“chronischevermoeidheidssyndroom”, “chronisch”,  “chronische”, “scheve”, “vermoeid”, “vermoeidheid”,  “syndroom”, “droom”, “room”

 RemoveDuplicatesTokenFilterFactory

“chronischevermoeidheidssyndroom”, “chronisch”,  “scheve”, “vermoeid”, “syndroom”, “droom”, “room”


The word ‘Chronischevermoeidheidssyndroom’ will eventually be indexed with the following result: ‘chronischevermoeidheidssyndroom’, ‘chronisch’, ‘scheve’, ‘vermoeid’, “‘syndroom’, ‘droom’, ‘room’. If somebody searches for any of these words, this item will be marked as a possible result.

If, for example, we run a search for ‘Vermoeidheid’, we should expect that our beloved  ‘Chronischevermoeidheidssyndroom’ pops up as a result. Let’s try this out with the Solr analysis tool:

 MappingCharFilterFactory

 V|e|r|m|o|e|i|d|h|e|i|d

 WhitespaceTokenizerFactory

 Vermoeidheid

 WordDelimiterFilterFactory

 Vermoeidheid

 LengthFilterFactory

 Vermoeidheid

 LowerCaseFilterFactory

 vermoeidheid

 SynonymFilterFactory

 vermoeidheid

 StopFilterFactory

 vermoeid

 SnowballPortretFilterFactory

 vermoeid

 RemoveDuplicatesTokenFilterFactory

 vermoeid


Eventually, our query will search for items indexed with the word ‘vermoeid’, which is also a token index when indexing the word 'Chronischevermoeidheidssyndroom'.


In short

When up a Solr core for multilingual content, it’s important that we provide extra field types that handle the text in the correct language. This way, Solr can index the word in such a way that plurals and concatenations of words are understood. This, in turn, provides a better experience to the user who is looking for a certain piece of content. With everything configured correctly, a user running a search for ‘syndroom’ will be served all compound words as a possible result, providing the user a better overview of your site’s content.
 

You can find our Dropsolid resources here: https://gitlab.com/dropsolid/multilingual-solr-config 

 

More blogs

CU Boulder - Webcentral: Drupal.org Should Take a Page from Apple During Major Releases

17 hours 4 minutes ago

Before the critical security update to SA-CORE-2018-002 was released on March 28, I was doing the same thing as many other members of the Drupal community.

via GIPHY

I was also looking for any updates about the status of Drupal.org or the 7.58 update on various Slacks, Twitter and Reddit.  While there were a lot of jokes like asking everyone else to stop refreshing, there was also a lot of discussion about deployments and security.  In the Slack for people working with Drupal in higher education, several people thanked Michael Hess and the University of Michigan for the time he devotes to Drupal’s security.

People were asking a lot of questions about why the Drupal.org infrastructure wasn’t scaled in anticipation of the traffic.  Lots of suggestions for improving the experience were given including taking a page from Apple’s playbook to just take the entire site down and link just to the security update.  That one caught my eye. Apple doesn’t take their store down because they don’t know how to scale.

I’m not sure if this is where I first read about this, but Scotty Loveless was discussing this back in 2013.  At the time he wrote…

In 2013, do they really not have the web chops to update their store live?  Of course they do… 

I believe Apple takes down the online store prior to product launches because that's one of their 'Christmas morning' traditions.

They have done it as long as I can remember and will most likely continue long into the future.

In many ways Apple is more like a family than the average company.  Taking the key web properties down before major announcements allows more of their family to participate in the event.  Regardless of someone's role at Apple, they’ve contributed directly or indirectly to what is about to be announced.  They may not have been the lead engineer on the product or even have any idea what is about to be announced, but by doing their job well they enable other people to focus on a different job.  Shutting down parts of apple.com is a small way they all share in the excitement of what they are able to achieve as a group.

While most members of the Drupal community don’t contribute directly to the security team, everyone clicking refresh over and over again is trying to contribute to Drupal’s security by securing even one site.

I don’t follow Apple as closely as I used to, but it looks like they still take the store down before big announcements.

I might be too late to change the plan for tomorrow's release, but I would like to see Drupal.org taken down when the community is waiting for major security update like this.  Maybe respond to all requests for a URL on Drupal.org with a simple message like...

We’ve taken Drupal.org offline while we prepare to distribute a critical security update. 

When the update is available, it will be linked here.

While you wait, take a few minutes to think about the amazing community you are a part of who are likely all clicking refresh over and over again right now too.

Rather investing resources scaling Drupal.org up so it's able to run normally, let's embrace the fact that Wednesday is not normal and that we're all in this together.

I've started a thread on r/drupal/ to discuss.

Developer Blog

Drupal Europe: Program vision and update

17 hours 23 minutes ago

During our first few weeks of selling Drupal Europe tickets, we were frequently asked about how our program is going to be structured. In this post we will outline the structure of our program and what it means for you.

Why change what works?Pedro Lozano (Drupalcon Barcelona 2015)

Our organizers are regular attendees at DrupalCons and other Drupal events. DrupalCon has always had a very high level of quality in terms of sessions, speakers and diversity.

At a DrupalCon you would usually see the following elements:

  • Monday — Summits for industry-specific groups such as Government, Media and Publishing, etc. (Separate ticket required)
  • Monday — Training in a small number of topics presented by experienced professionals in a hands-on manner for a whole day (Separate ticket required)
  • Tuesday to Thursday — Sessions and workshops organized into tracks based mostly on expertise area (Backend development, Frontend, Design/UX, Site Building, Project Management, etc.) as well as common shared interests (Being Human, Building Community, Core conversations, etc.)
  • Sprints for some attendees on all days of the conference but really in full swing on Friday with a great group of mentors available to onboard new contributors
  • BoFs which provide an unconference style setup for people to self-schedule topics and gather with other people around a shared interest
  • Social events including well-known gatherings like Women in Drupal and First-Time Attendee Social

To meet the high expectations of our community, we will keep as much as possible of what worked well. At the same time, we wanted to improve the structure of the program by gearing it towards people who are interested in seeing Drupal applied to specific industries.

Speaking with many past sponsors and attendees, we observed that the main difference between European and non-European events is our fragmented markets. With fragmented markets you have a lower chance of meeting with colleagues, business partners, and customers from your markets, which leads to lower sponsor involvement.

Even if the program is outstanding, lack of sufficient business support makes the event impossible to put on. The primary feedback from all parties was that a Drupal event this size works best as a melting pot of different aspects of Drupal. This is an event where developers, decision makers, project managers, and other roles can share their work and get inspired by real-life stories like Drupal used to control insulin pumps, usage on cruise ships and many more.

Since we cannot really influence the European geopolitical questions, we looked at other aspects to help unify markets. In Europe, Drupal has a strong base in government, publishing, education, social media, and more. There are even Drupal distributions for these purposes originating from Europe. Also we have historically held various business events like the Drupal Business Days as well as popular events like Drupal Splash Awards that have contributed to Drupal’s strong European influence.

Therefore we are incorporating these successful event formats into Drupal Europe.

How Drupal Europe will be differentFocus on industry verticals

Instead of having a specific day for industry participants, we decided to organize the whole event around where Drupal is applied. Drupal Europe focuses on the following verticals:

  • Digital Transformation + Enterprise
  • Government
  • Healthcare
  • E-Commerce
  • Higher Education
  • Publishing + Media
  • Social + Non-profit
  • Infrastructure
  • Drupal Community
  • Drupal + Technology
  • Agency Business

Instead of primarily focusing on the technology used (e.g. frontend), you will see frontend talks in the government vertical, the e-commerce vertical, and so on. A great React online store implementation would be presented in the e-commerce vertical. A compelling multi-channel civic project will be included in the government vertical. We believe this focus of the program will help attendees see the value Drupal brings to their respective markets. It should also compel potential speakers who may not use the latest bleeding edge technology but have deeper industry know-how and insights to present.

Having specific industry verticals allows sponsors to meet with their peers, partners and clients and exchange information about important industry topics and around Drupal and Open Source Software in general. Also they have the chance to learn from other verticals that might face similar challenges in their growth. As a sponsor you can buy sponsorship packages targeted specifically at the verticals.

While focusing more on business, we did not want to lose the spaces and opportunities a conference of this size usually provides to Drupalers. Therefore the last three verticals are more focused on us Drupalers and represent the traditional structure with a focus on community, Drupal technology, and agency business.

Working on the program at DrupalCon NashvilleExpertise tagging

There is of course not one true way to organize sessions, so while our primary organization structure will be verticals, we’ll also use tagging on sessions so you can identify content based on expertises like frontend, backend, and so on… We also believe it is useful to keep the varied lengths and formats including panels, longer workshops and short lightning talks in most verticals.

Given this direction, Drupal Europe will not host summits on Monday.

Expanded opportunities for contribution

However, we also want to strengthen the space provided for contribution. Therefore we will hold a contribution day with mentors already on Monday (additionally to the usual mentored contribution day on Friday). Our contribution room will be open on all days in the conference venue. Join us on Monday to possibly get your contributions committed at the conference!

Birds of a Feather and Trainings

We don’t see a reason to change the unconference aspect and will make space for Birds of a Feather sessions as much as the conference venue allows us to.

Some training providers reached out to us to discuss training possibilities for Monday. We have space for training on Monday, and are still in talks with possible trainers.

Social events

We are also looking forward to continuing the traditional social events and already have an enthusiastic sponsor lined up for Trivia Night.

We’ve seen the success of Splash Awards in various countries across Europe: The Netherlands, Germany and Austria, Norway, Bulgaria, Denmark, France and Romania. We are proud to host the first European Splash Awards! Winners from local competitions can compete in this international contest. It is not too late to organize your local Splash Awards.

One ticket for Drupal Europe gives you access to all this great content. Don’t wait — buy your ticket now!

Join the program team!

Currently we’re looking for volunteers to help the program team create the best possible program. It would be great if you have a background or strong interest in one of the conference verticals so we can reach out to the most interesting speakers.

If you are interested, please email us at program@drupaleurope.org

If you have valuable contacts that you think could help us make Drupal Europe an awesome event, please refer them to us or this blog post.

DrupalEasy: Using Drupal's Linked Field module to output fields as links in view modes

1 day 3 hours ago

With Drupal 8, the use of view modes (both default and custom) is gaining momentum. This is especially true because of their ability to be easily utilized by Views. Rather than specifying a list of fields with all the required configuration in a View configuration, many site-builders are finding it much easier to define a set of view modes for their entities, have them themed once, then re-used throughout the site - including as part of a View's output via the "Show: Content" option in a View's "Format" configuration. 

One hiccup that can slow this down is the not-uncommon occurrence of when a field needs to be output as a link to some destination. While this is relatively easy to do with Views' "Rewrite fields" options, there isn't an obvious solution when using view modes.

Enter the Linked Field module. As its name implies, it provides the ability for any field to be output as a link via its formatter settings. The formatter can be configured with a custom URL or it can use the value of a URL from another field value.

Think of this module as an "Output this field as a custom link" option for view modes!

The "Advanced" configuration section for the formatter settings includes the ability to custom things like the title, target, and class attributes for each link. 

If your goal is to maximize the use of display modes throughout your site, then this contributed module is an important tool in your arsenal.  

Hook 42: Mentoring at DrupalCon - Fostering a New Generation of Contributors

1 day 4 hours ago

DrupalCon is more than just a conference for networking and learning; it provides an avenue for contributing back to the project during code/contribution sprints. Being a beginner to the issue queue can be daunting and overwhelming. With the help of mentors, novices can get the tools and support they need to jump in and start contributing.

Chris, AmyJune, Daniel, and John took it upon themselves to volunteer as mentors at the DrupalCon Nashville Sprints and we thought we’d share their afterthoughts to empower others to help with mentoring in the future.

Jacob Rockowitz: Content First, Technology Second

1 day 4 hours ago

Many years ago, I was going for a morning stroll in New Jersey with my dad. We walked past a complete stranger and my dad said, “Hello.” My parents are divorced and I lived (mostly) with my mom in Brooklyn, so I spent the majority of childhood in a place where no one says hello to strangers. I was bewildered so I asked him why did we just said hi to a complete stranger and he said...

That is truly what he said and I can honestly say, it is the one and only time I have ever heard Sheldon Rockowitz swear. He broke his polite demeanor to emphasize to me the importance of saying hi.

Fast forward 20 years. I am now a father and my four-year-old son is complaining that he has no one to play with. I point to the closest child his age and tell him to go up to the kid and say 'Hi, my name is Ben'. He did it and discovered the concept and value of initiating a greeting with a complete stranger. And he made a friend for the day at the playground.

Two years ago, we were on a summer trip in Montreal and hanging out in a playground. Like many parents, I was laying low on the sidelines, observing my child's interaction with other kids. Ben walks up to a kid on the swing set and says, "I am not sure what language to say ‘Hi’ in, but my name is Ben." Ben's natural ability to adjust his approach blew my mind because he not only found a way to communicate with a complete stranger who might not be comfortable speaking his language, but he also shifted his method based on what he knew - and this is equally important - what he didn’t know. Kids are the future, and they teach us valuable lessons all the time.

Ben taught me..

The Drupal community and software needs to say "Hi" and make people feel comfortable

Improving the evaluator experience has become one of our communities initiatives. There are many approaches and plenty of awesome people contributing...Read More

Jeff Geerling's Blog: Post-Mollom, what are the best options for preventing spam for Drupal?

1 day 7 hours ago

Earlier this month, Mollom was officially discontinued. If you still have the Mollom module installed on some of your Drupal sites, form submissions that were previously protected by Mollom will behave as if Mollom was offline completely, meaning any spam Mollom would've prevented will be passed through.

For many Drupal sites, especially smaller sites that deal mostly with bot spam, there are a number of great modules that will help prevent 90% or more of all spam submissions, for example:

Security public service announcements: Drupal 7 and 8 core critical release on April 25th, 2018 PSA-2018-003

1 day 10 hours ago

There will be a security release of Drupal 7.x, 8.4.x, and 8.5.x on April 25th, 2018 between 16:00 - 18:00 UTC. This PSA is to notify that the Drupal core release is outside of the regular schedule of security releases. For all security updates, the Drupal Security Team urges you to reserve time for core updates at that time because there is some risk that exploits might be developed within hours or days. Security release announcements will appear on the Drupal.org security advisory page.

This security release is a follow-up to the one released as SA-CORE-2018-002 on March 28.

  • Sites on 7.x or 8.5.x can immediately update when the advisory is released using the normal procedure.
  • Sites on 8.4.x should immediately update to the 8.4.8 release that will be provided in the advisory, and then plan to update to 8.5.3 or the latest security release as soon as possible (since 8.4.x no longer receives official security coverage).

The security advisory will list the appropriate version numbers for each branch. Your site's update report page will recommend the 8.5.x release even if you are on 8.4.x or an older release, but temporarily updating to the provided backport for your site's current version will ensure you can update quickly without the possible side effects of a minor version update.

Patches for Drupal 7.x, 8.4.x, 8.5.x and 8.6.x will be provided in addition to the releases mentioned above. (If your site is on a Drupal 8 release older than 8.4.x, it no longer receives security coverage and will not receive a security update. The provided patches may work for your site, but upgrading is strongly recommended as older Drupal versions contain other disclosed security vulnerabilities.)

This release will not require a database update.

The CVE for this issue is CVE-2018-7602. The Drupal-specific identifier for the issue will be SA-CORE-2018-004.

The Security Team or any other party is not able to release any more information about this vulnerability until the announcement is made. The announcement will be made public at https://www.drupal.org/security, over Twitter, and in email for those who have subscribed to our email list. To subscribe to the email list: login on Drupal.org, go to your user profile page, and subscribe to the security newsletter on the Edit » My newsletters tab.

Journalists interested in covering the story are encouraged to email security-press@drupal.org to be sure they will get a copy of the journalist-focused release. The Security Team will release a journalist-focused summary email at the same time as the new code release and advisory.
If you find a security issue, please report it at https://www.drupal.org/security-team/report-issue.

ComputerMinds.co.uk: Rebranding ComputerMinds - Part 3: Website design

1 day 13 hours ago

Now that we had settled on the branding and had established and planned exactly what we needed to create, I could start looking at designing the new website.

I wanted a clean, spacious site with a modern look and feel. I always keep a close eye on changing design trends and it was important that for our site I was careful to design something that would age well.

Over the years, Photoshop was my go-to software choice when designing, but after becoming increasingly frustrated by slow workflow I recently switched to using Sketch for larger projects. Sketch uses a modular, symbol based design where elements are quickly and easily reused. This makes edits super easy - changing the design of a button would change it everywhere it is used, not allowing inconsistencies to creep in.

Document setup involved ensuring some useful plugins were installed, then creating a new document with the standard Sketch template ‘Web Design’. This template gives you three pages to get going - one for assets (symbols), one for a style guide and one for the actual designs. Pages in Sketch are basically just canvasses but having these three allows easy navigation and quick workflow. An adjustment to the layout settings to ensure we had the correct size grid and we could almost get going.

The last thing I did was to, in the style guide page, create some simple shapes of all the colours from the branding guidelines that I created previously. I then created styles with these colours. This way, the colours would be consistent and if they ever changed it was easy to change them in one place, and not every item that used them.

Starting with the desktop header (as a symbol so it could be reused on each page), I immediately threw in the compact logo, without the word ‘ComputerMinds’. This was following on from an earlier decision to move away from the company name being so prominent. The address bar would always show the name anyway. After years of always seeing company logos on the left of the header, I wanted to move away from this. The recent rebrand of The Guardian saw a move away from this too, the new logo firmly positioned on the right of the header. Now, we had something most didn’t, a symmetrical logo. This meant we could have a symmetrical header by placing the logo in the middle.

Next up came the footer, also a reusable symbol. As we weren’t using the company name in the header this was a perfect opportunity to use a larger logo. Keeping it clean, I added the compact logo, contact information, social links, 2 menus and legal information, meeting requirements.

Once the the header and footer of a site are designed it really begins to look like a website. Before I could design any other page elements I needed to design something that would also be seen on almost every page - buttons. And with buttons come form elements. I've seen a recent trend with buttons with square corners and with either block colours or simple line borders. For our site I wanted something a little different so added a subtle shadow and simple movement on hover.

As with many of our recent development projects, we wanted to use tiles. This would allow us to create pages using tiles as building blocks, which is exactly what we’ll need for most pages. So these were designed next. As mentioned earlier, I wanted to create a more engaging experience for users by encouraging more visual content. With this in mind I created a collection of tile designs that incorporated large images and video and used the full width of the screen, bleeding off of the grid. These also used consistent, large headings and body text.

As well as visually engaging tiles, it was also necessary to create tiles to communicate through text alone. Using the colour palette created in the branding phase, I designed tile types that would allow variation visually through background colours, leaving the text to be communicated clearly. It’s also worth noting the prominence given to headings. Purposefully large to work well with whitespace, the headings make it absolutely clear what the visitor is reading.

During the designing of the tiles, I was also always thinking of the pages the site would have to be sure that the tiles were designed with the likely content in mind. Creating each tile type as a symbol in Sketch allowed me to quickly create page designs for multiple pages and adjust styles centrally.

In addition to these pages, we also required designs for pages that would not be made using tiles. A big part of our site and one we’re proud of is our many articles. Starting with a single article page I wanted to design a page that focussed the viewer on the content, without distraction. To achieve this I created white space either side of the content, narrowing the page and focussing the viewer (you're locked in right now, aren't you!). I also incorporated a title tile to display the article title clearly and created a header and footer for the article with all information the viewer might expect. These title tiles are also used on most pages of the site, making it absolutely clear which page you are on and adding further consistency. 

So the design was now complete. We had headers, footers, tiles, form elements, headings, body and more in all screen sizes. Such as the way we operate at ComputerMinds, this was all subject to adjustment as the project grows and more people get involved the requirements may change. As I said before, this is not a problem when using Sketch with the reusable elements.

Next up, we were to try something new - creating the front end using a pattern lab!

Tim Millwood: Getting started with React and Drupal

1 day 20 hours ago
Getting started with React and Drupal

Over the weekend I decided it was long overdue that I learnt React, or at least understood what all the fuss was about, so with npm in hand I installed yarn and started my quest.

We're going to use Create React App to setup our base React install. First install then run the command to create a react app called "drupal-react":
npm install -g create-react-app
create-react-app drupal-react
cd drupal-react

You can now run npm start (or yarn start) to start your app locally and open it in a browser. Here you'll see a React default page, this is all created from a React component called "App". If you take a look at the file src/App.js you will see the component and how the render() method returns the page HTML as JSX. We need to replace to the code returned here to show some Drupal nodes, so how about replacing it with (or just adding) <NodeContainer />. This will call a new component, so at the top of app.js we will also need to import that, so with the other import code add import NodeContainer from './NodeContainer';.

Now to create the NodeContainer component. First we need to add the Axios library which we'll use to query the Drupal REST API, run npm install axios --save. Then create the file src/NodeContainer.js, and in there add the following code:
import React, { Component } from 'react'
import axios from 'axios'

class NodeContainer extends Component {
  constructor(props) {
    super(props)
    this.state = {
      nodes: []
    }
  }

  componentDidMount() {
    axios.get('http://example.com/api/nodes')
    .then(response => {
      this.setState({nodes: response.data})
    })
    .catch(error => console.log(error))
  }

  render() {
    return (
      <ul>
       {this.state.nodes.map((node) => {
          return(
           <li={idea.nid}>{node.title}</li>
          )
        })}
      </ul>
    )
  }

}

export default NodeContainer

At the top of the file React and Axios are both imported, the class for NodeContainer is then created. The constructor method is where we add the state node, componentDidMount() is called to get the nodes from the View /api/nodes, which then gets rendered as an unordered list.

To create the /api/nodes view install the core Rest module. This will allow you to create a "REST Export" view. Here the path can be set to /api/nodes, and you can select nid, and title.

As long as you left npm start running, you should be able to go back to your browser, and view a nice list of Drupal nodes being rendered in React.

Next, routing, to make these node titles clickable! 😱

timmillwood Mon, 23/04/2018 - 07:20 Tags drupal planet drupal-planet drupal drupal8 drupal 8 drupal development react reactjs javascript Add new comment

Sooper Drupal Themes: Drupal 8 vs Drupal 7 Performance 2018: Drupal 8.5 Is Faster With Glazed Theme Main Demo! | 8 Days To Drupal 8 | Day 7

2 days 14 hours ago

We're counting down the days to the official SooperThemes Drupal 8 Release! Count with us as we will be writing a Drupal 8 related blog post every day for the next 8 days.

Drupal 8 is known for being heavier and slower than Drupal 7. However, Drupal 8 doesn't deserve this image and I think it got this image from lazy benchmarking: Testers just install Drupal's default profile, run some ab tests and call it a day. This is not a realistic test! Real Drupal websites will have hundreds of pages, menu items, configuration objects, more complex theming, more modules etc. 

I did some more extensive testing to compare our Drupal 7 products with the Drupal 8 versions that are to be released next week. The beautiful thing (for this test) about our products is that we maintain them with feature parity across Drupal 8 and 7. We provide installation profiles that combined have thousands of content items, menu items, and configuration settings that make them very close to real-world Drupal 8 & 7 websites. Perfect material for benchmarking!

Test 1: Drupal 8 vs Drupal 7 Cached Page Delivery

Drupal 8 default profile cached page benchmark. Drupal 7 255% faster than Drupal 8.

Ok let's get this over with first. Drupal 8 is built on a PHP core that is slower to parse than Drupal 7 and uses more memory. On an empty Drupal installation you will really notice this difference because the empty shell will act like a magnifying glass on the underlying architecture. In the chart above you can see that Drupal 7 is more than twice as fast at delivering cached pages to anonymous users. 

This test is what most people will refer to when saying Drupal 8 is slower than Drupal 7 but this is in fact the least interesting test for 2 reasons:

  1. Nowadays it is very easy to put a cache in front of Drupal. You can use Nginx, Varnish, or Cloudflare with the free plan to serve thousands of cached pages per second, regardless of whether Drupal 8 or 7 or anything else is behind the cache. 
  2. Any empty installation with Drupal's default profile is a bad model for a real website.
Test 2: Drupal 8 vs Drupal 7 Autenticated Views Portfolio Display 

Drupal 8 Glazed Main Demo views display benchmark. Drupal 8  is 228% faster than Drupal 7.

For this second test we use the Main Demo installation profile with our Glazed Theme and Glazed Builder products. This means we have a dropdown menu with 100+ items, a database with around 100 nodes, lots of views displays and contrib modules, and our Glazed theme is enabled which subthemes the bootstrap basetheme. This is a much closer simulation of a real-life Drupal website than the default profile is!

We're benchmarking a views display that draws fields from nodes and taxonomy terms, does some interesting templating and is then pulled into a page using Glazed theme to display the view along with peripheral content.

As you can see in the chart Drupal 8 is now twice as fast as Drupal 7. Despite the heavier core, Drupal 8 is faster when handling large amount of configuration, views, and heavier themes like Glazed and the Bootstrap basetheme. I suspect this is due to the more elaborate caching architecture in Drupal 8. Especially template files are now heavily cached and so are other important Drupal components.

Tested page: https://demo.sooperthemes.com/glazed-main/portfolio/premium1

Test 3: Drupal 8 vs Drupal 7 Autenticated Drag and Drop Page 

Drupal 8 Glaezd Main Demo views display benchmark. Drupal 8 12,5% than Drupal 7.

Our previous test showed an extreme example of Drupal 8 being faster due to its better handling of views. This 3rd test shows what we typically see when benchmarking Drupal 8: Drupal 8 is slightly faster in loading pages in our Glazed Theme demos. We see similar results when testing drag and drop pages, or other content types that don't use the drag and drop builder. In fact our Page Builder module does not significantly impact performance even when loading multiple Glazed Builder editors within the same page. 

The Drupal 8 and 7 installation profiles have near feature-parity but in fact the Drupal 8 version includes the Admin Toolbar module and the Drupal 7 profiles do not include an admin menu module. This means that each page comes with an additional 200 menu items in the Drupal 8 tests. In Drupal 7 I usually install the admin_menu module for faster administration, and this module is known to be significant burden on the server. The fact that Drupal 8 is faster in our tests despite loading the additional 200 menu items is impressive! 

Tested page: https://demo.sooperthemes.com/glazed-main/elements/layout-elements/columns

Conclusion: Drupal 8 Is A Heavier System With More Extensive Caching That Can Make It Faster Than Drupal 7 In Real-Life Situations

At the start of its life Drupal 8.0 got a lot of criticism for being slow. Now in 2018, Drupal 8.5 has seen a significant number of performance improvements and while it's still slower than Drupal 7 at the core, it's faster in complex situations that are more relevant to real-life Drupal websites.

Drupal 8 is faster where it matters, and more scalable! It's also important to add that both test installations did not have any special settings enabling caching of content, views, blocks, etc. Drupal 8 has a much more advanced and more granular caching system that lets you finetune and optimize your experience for logged in users on a grander scale than was every possible with Drupal 7. Notably there is the BigPipe module that gives you lightning fast loadtimes for your primary content and it can then separately lazy-load less important content, like the footer, menus, and sidebar blocks.

For sure this test brings good news to SooperThemes customers, who will enjoy a faster experience our of the box with our Glazed demo installation profiles. As a side note: importing demo content is also twice as fast in our Drupal 8 installation profiles versus Drupal 7.

What is your experience?

Drupal's performance is a complex thing to test and I'm sure you can get different results in varying situations, if you have any questions about the test or if you want to share your own experience with Drupal 8's performance let me know in the comments!

Advomatic: Diversity and Staying Grounded: Recapping Drupalcon 2018

4 days 4 hours ago

It was great to get back to DrupalCon this year.  I really enjoyed the Con, and this was one of my favorite DrupalCons in the eight years I’ve been going. Drupal as a community is getting more serious about diversity. In the past, there’s been an undercurrent of people saying “diversity is good” for a... Read more »

The post Diversity and Staying Grounded: Recapping Drupalcon 2018 appeared first on Advomatic.

Checked
1 hour 38 minutes ago
Drupal.org - aggregated feeds in category Planet Drupal
Subscribe to Planet Drupal feed