Development News

Lullabot: Social Share Links Are (Probably) Spying On You

Main Drupal Feed - Wed, 03/11/2020 - 15:35

We've worked on countless websites that have social media sharing functionality. You know, those little links that let you easily post to Facebook, Twitter, or some other social network?

These widgets work by requiring a developer to embed a script tag on their site. Like this:

Jeff Geerling's Blog: The 2020 Drupal Local Development Survey

Main Drupal Feed - Wed, 03/11/2020 - 14:52

DrupalCon Minneapolis is two months away, and that means it's time for the 2020 Drupal Local Development Survey.


Local development environment usage results from 2019's survey.

If you do any Drupal development work, no matter how much or how little, we would love to hear from you. This survey is not attached to any Drupal organization, it is simply a community survey to help highlight some of the most widely-used tools that Drupalists use for their projects.

Take the 2020 Drupal Local Development Survey

Tag1 Consulting: How Claro became more accessible and stayed innovative - part 3

Main Drupal Feed - Wed, 03/11/2020 - 13:29
Throughout Drupal's existence, no other changes have made as much an impression on users as refreshes of the administrative interface in Drupal. Content editors and site builders have a long list of expectations when it comes to the editorial experience they wish to use, and surveys and tests had shown that Seven was showing its age. Now, thanks to Claro, the new administration theme for Drupal 8, user interfaces for all editors in Drupal are now optimized for accessibility and usability in addition to a realistic roadmap for the future.Read more preston Wed, 03/11/2020 - 08:27

WordPress 5.4 RC2

Wordpress News - Tue, 03/10/2020 - 21:40

The second release candidate for WordPress 5.4 is now available!

WordPress 5.4 is currently scheduled to be released on March 31 2020, and we need your help to get there—if you haven’t tried 5.4 yet, now is the time!

There are two ways to test the WordPress 5.4 release candidate:

For details about what to expect in WordPress 5.4, please see the first release candidate post.

RC2 addresses improvements to the new About page and 5 fixes for the following bugs and regressions:

  • 49611 – Block Editor: Update WordPress Packages WordPress 5.4 RC 2
  • 49318 – Bundled Themes: Twenty Twenty content font CSS selector is too important
  • 49585 – REST API: Fix typo in disable-custom-gradients theme feature description
  • 49568 – Block Editor: Fix visual regression in editor’s color picker
  • 49549 – Bundled Themes: Calendar widget CSS fixes on various Bundled themes
Plugin and Theme Developers

Please test your plugins and themes against WordPress 5.4 and update the Tested up to version in the readme to 5.4. If you find compatibility problems, please be sure to post to the support forums so we can figure those out before the final release.

The WordPress 5.4 Field Guide has also been published, which details the major changes.

How to Help

Do you speak a language other than English? Help us translate WordPress into more than 100 languages!

If you think you’ve found a bug, you can post to the Alpha/Beta area in the support forums. We’d love to hear from you! If you’re comfortable writing a reproducible bug report, file one on WordPress Trac, where you can also find a list of known bugs.

Debug Academy: From Historian to Drupal Developer - How Debug Academy Launched My New Career

Main Drupal Feed - Tue, 03/10/2020 - 14:39
From Historian to Drupal Developer - How Debug Academy Launched My New Career A Little Bit of Background

In 2017, I graduated with a PhD in history from The George Washington University, where I studied German colonialism in Africa. After graduation, I ended up teaching at a private secondary school part-time to get my foot in the door. Some days were enjoyable, some days were painful, and I never fully adjusted to life in the classroom at that level. With no opportunity to transition to full-time in my near future, and the little joy I was getting out of the hard work I was putting into my lessons, I realized that I needed to make a change. I weighed my options, and ultimately landed on the most off the wall route in comparison to where I was starting from, and that was to pursue a web development career.

JackG102 Tue, 03/10/2020

Mediacurrent: Extending Drupal With a Flutter Native Mobile App Experience

Main Drupal Feed - Tue, 03/10/2020 - 12:32

If you’ve discovered this blog post, chances are you're looking for Drupal expertise and knowledge from Mediacurrent - and likely also have or plan to have a Drupal site. You've probably considered ways to extend the reach of your Drupal site. Combining Drupal and Flutter is a simple way to create a mobile app experience and reach a wider audience through App Store exposure. This post explains how.

Native mobile app experience

You’ve invested lots of time and resources into building your Drupal website. Then lots of effort populating it with great content and making sure it stays updated with fresh content. And now your analytics show you have strong audience engagement, but it’s really just holding steady and you’re looking for new ways to market your content and reach new audiences and engagement.

Perhaps your quest to optimize the mobile experience has led you to consider a mobile application. A mobile application (or "app" in the commonly used short form) can serve as an alternative marketing solution that extends your existing Drupal website. This can help attract new visitors by means of an App Store, or provide existing visitors with a new mobile experience built with a mobile application framework called Flutter.

What is Flutter?

Flutter is a cross-platform mobile application framework created by Google, with its first stable release in 2018. It competes with other frameworks like Facebook’s React Native, Microsoft’s Xamarin, and Apple’s Swift and SwiftUI. Flutter is a declarative framework written with the Dart programming language, which is comparable to Javascript in syntax. It’s an open source framework that is free to use and promotes community contributions into the code repository.

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.

Source: https://flutter.dev/

For a deeper introduction, check out Mediacurrent’s presentation on Decoupled Drupal with Flutter (Florida Drupalcamp 2020).

Benefits Cross-platform with a single codebase

The main benefit of Flutter over native platforms, like Swift for iOS and Java/Kotlin for Android, is the ability to compile native applications from a single codebase. While it’s already in progress, but not yet production-ready, there will be support in the future for web and desktop applications that can also be driven from the same, single codebase.

Source: https://techcrunch.com/2019/05/07/googles-flutter-framework-spreads-its-wings-and-goes-multi-platform/

Open Source

While the framework was built by Google, it is an open source project. It’s free to install and use for business or personal projects without the propriety limitations of other frameworks. As with other open source projects, there is a large developer community that drives the project and provides contributions back to it in the form of writing documentation, performing code changes, and knowledge sharing of technical challenges. Get involved today in the Flutter community!

Dart programming language

Flutter’s programming language of choice, Dart, makes the framework relatively easy to learn and get started building applications. It’s particularly easy to learn and understand because it has features and borrowed concepts that are similar to other languages and frameworks, but with it’s own syntax and infrastructure. Also, it’s fast!

Flexibility and customization

Flutter is flexible and highly customizable. It is similar to Drupal in that it’s easy to get started, but when you need to extend and customize it for your own use cases, instead of reinventing the wheel for everything, there are pre-built packages and code snippets to get you going. In Drupal, there are contributed modules on Drupal.org. In React Native, there are packages on Node Package Manager (npm). In Flutter, there are Dart and Flutter packages.

Fast and steady growth rate

Flutter released its first official version in December 2018. In a little over a year, interest in the Flutter framework has increased dramatically and is still rising according to a Google Trends report.

trends.embed.renderExploreWidget("TIMESERIES", {"comparisonItem":[{"keyword":"React Native","geo":"","time":"today 5-y"},{"keyword":"Flutter","geo":"","time":"today 5-y"},{"keyword":"Xamarin","geo":"","time":"today 5-y"}],"category":5,"property":""}, {"exploreQuery":"cat=5&date=today%205-y&q=React%20Native,Flutter,Xamarin","guestPath":"https://trends.google.com:443/trends/embed/"});

Source: https://trends.google.com/trends/explore?cat=5&date=today%205-y&q=React%20Native,Flutter,Xamarin

Flutter has also surpassed both React Native and Xamarin on Stack Overflow, at least with the number of technical questions being asked around the technology. With the widespread adoption rate comes more developers building more complex applications, which results in more documentation, resources, and knowledge sharing in the Flutter community that can drive its continued growth and adoption.

Source: https://insights.stackoverflow.com/trends?tags=flutter%2Creact-native%2Cxamarin

Integrated developer tools with hot reload

It’s easy to get up and running with a Flutter application to start building proof-of-concept applications. Development is fast and fun with features like hot reload and Visual Studio Code editor integration. With hot reload, the changes made in the editor can be seen in real-time in a device simulator.

Everything is a Widget

A Flutter application’s user interface is composed of building blocks called widgets. A widget is comparative to the term "View" in other frameworks, except that Flutter widgets are all-encompassing, whereas other frameworks offer more separation with views, view controllers, layouts and other components.

The main building blocks to any Flutter application are going to be Stateless or Stateful widgets. These are essentially the container widgets that act as the parent to one or many more child widgets. Stateful widgets are reactive to state changes, so when the state of the data changes, the widget rebuilds it’s UI.

Examples of widgets can be structural elements like buttons and images, element styling like fonts and colors, and even layout control like padding and margin.

Source: https://hackernoon.com/flutter-create-beautiful-native-apps-in-record-time-nv1e93whh

Decoupled Drupal with Flutter

Drupal is great at complex data structures and content management. It’s also secure and highly customizable with solutions for mostly anything, and if there isn’t a solution, there are APIs to build the solution.

Flutter makes it easy to compose screens and control the navigation of an app. It also makes it possible to build a single app that can be compiled to both iOS and Android platforms. With Flutter, you get a lot of functionality baked in that typically comes with extra effort in the other frameworks.

Flutter makes it easy and fast to build beautiful mobile apps.

Source: https://flutter.dev

In order to decouple Drupal with Flutter, Flutter needs to be able to communicate with Drupal. Luckily for us, there are solutions built right into Drupal core for exposing data to external systems, such as JSON API and RESTful Web Services.

There is also a JSON:API Flutter package available to help with the communication between Drupal JSON API and Flutter. This package was used in the Contenta Flutter demonstration in this Florida Drupal Camp 2020 talk on Decoupled Drupal with Flutter.

Wrapping Up

I hope this post was helpful to provide insights into how easy it can be to extend your existing Drupal website with a companion native application with Flutter. This will, in turn, increase your audience reach with the help of App Stores. For more ways to make the most of Drupal in your marketing strategy, check out our Drupal 8 for Marketer’s ebook.

Third & Grove: Integrating Drupal + Softrip

Main Drupal Feed - Tue, 03/10/2020 - 12:16

Softrip is a boutique software company that makes some of the back office plumbing companies in the travel business need to support their unique use cases. The company operates in a niche market, but its platform is absolutely crucial for this sector.
 
Because Drupal is a powerful platform that shines when it comes to integrations, we coupled it with Softrip to build compelling digital experiences for prospective travel customers. Here are our tips on how to make the integration shine.
 

DrupalEasy: Introducing the Drupal Career Online Spring 2020 Class

Main Drupal Feed - Tue, 03/10/2020 - 12:07

The Spring 2020 class of our Drupal Career Online course is off to a great start with a (sold out!) group of ten amazing students from across the United States. During the 12 weeks, we'll be diving deep into Git, Composer, information architecture, site-building, module and theme development, development workflows, and so, so, so much more!

This semester's class includes students with a wide range of technical backgrounds and experiences. Some quick stats:

  • Includes students from all four U.S. time zones.
  • Includes Windows, Mac OS, and Linux users.
  • Some students with Drupal 7 experience and some who are new to Drupal. 
  • Varying levels of command line and PHP experience.
  • All students are using Docker-based local development environments (Lando and DDEV).
  • One student is returning for their second DCO (they previously took the Drupal 7 version of the course).
  • Three students are associated with the same company.
  • One student is the child of a long-time active Drupal community member. 

Each of our students has different goals and expectations for the course; over the duration of the course, we will be working to personalize their experience via office hours, community mentors, and the high-level of student/teacher interaction that the DCO has come to be known for. 

In addition to the 7 hours of class time each week, students have access to 4 hours of open "office hours" each week with DrupalEasy instructors where they can ask about anything Drupal- (or Drupal-adjacent) related. Half of the office hours coincide with DrupalEasy's perpetual office hours for all DCO alumni - this serves as a way to help introduce new students to our ongoing DrupalEasy learning community. 

In the next week or so, we'll be looking for community mentors for each of our current students. If you're interested in getting involved, please let us know- this is a great opportunity to give back to the community while growing your own Drupal network. We always try to match up mentors and mentees based on similar Drupal interests and/or technical backgrounds. 

If you, or someone you know, is interested in learning more about the DCO, the next semester begins August 31 - learn more by attending one of our free, 1-hour Taste of Drupal information seminars.

Palantir: Federated Search - Release Plan Q1 2020

Main Drupal Feed - Tue, 03/10/2020 - 12:00

What’s coming in version 3.0

Learn more about Federated Search and how it's being used by large enterprises to deliver a unified search experience in our upcoming Acquia webinar.

Register Now

As an application, Federated Search needs to keep pace with changes in React and Drupal. On 1 January 2020, the Search API Solr module deprecated its 1.x branch in favor of 3.x, which supports Solr 7. Similarly, Acquia will be discontinuing Solr 4 in favor of Solr 7 throughout 2020.

In order to best support sites using the Federated Search application, we have created a 3.x version of the application that is compatible with the latest changes in Drupal, React, and Solr. Moving forward, there will be two versions of the application:

  • 3.x - The current feature release. Future work, including Drupal 9 compatibility, will be done on this branch.
  • 2.x - The legacy stable release. No further development work will be done on this release.

Our intention is to allow sites to continue using the 2.x version of the application as long as it suits their needs. We also need to be prepared for upgrading sites to Solr 7 and Drupal 9.

The 3.x version does not add any new features at this time. See the section on Major Changes for information about upgrading your installation.

Requirements

The following software elements are required for each release:

  • 3.x Requirements
    • Solr 6.4 or higher
    • Federated Search React 3.0.0
      • This application is automatically added by the module.
    • Drupal 7.69 or higher
      • Search API Solr 7.x-1.15
      • Search API Federated Solr 7.x-3.0 or higher
    • Drupal 8.8.2 or higher
      • Search API Solr 8.x-3.9 or higher
      • Search API Federated Solr 8.x-3.0 or higher
      • Search API Field Map 8.x-3.0 or higher
  • 2.x Requirements
    • Solr 4.5 - Solr 6.3
    • Federated Search React 2.1.4
      • This application is automatically added by the module.
    • Drupal 7.69 or higher
      • Search API Solr 7.x-1.15
      • Search API Federated Solr 7.x-2.6
    • Drupal 8.8.2 or higher
      • Search API Solr 8.x-1.4
      • Search API Federated Solr 8.x-2.9
      • Search API Field Map 8.x-1.5 (for Drupal 8 only)
Major Changes

When you migrate to a new version of Solr, your schema will need to change. There are detailed instructions for these changes in the README files shipped with the module.

In addition to upgraded support for Solr 7 and 8, the 3.x branch of the application features  improved CSS that has better namespacing to avoid collisions with existing site code.

Upgrade Steps
  • Update the modules and their dependencies.
  • Configure search indexes for Solr 7.
  • Re-index your site content.
  • Rename any custom CSS to use the new ‘fs-’ namespace prefix. 
Maintenance Plan

Moving forward, the next release will address Drupal 9 compatibility. We are then looking at adding additional features to the application.

365-211 by Canned Muffins licensed under CC BY 2.0.

Community Development Drupal Open Source

Specbee: Top 8 Drupal 8 Themes for Media and Publishing Websites

Main Drupal Feed - Tue, 03/10/2020 - 11:48
Top 8 Drupal 8 Themes for Media and Publishing Websites Shefali Shetty 10 Mar, 2020 Top 10 best practices for designing a perfect UX for your mobile app

Do you think first impressions last? Will Rogers once said – “You never get a second chance to make a first impression”. Drupal 8 offers some fantastic themes to help every business create a lasting impression. Let’s delve into some of the top Drupal themes that are most suited (but not exclusively) for Media and publishing websites.

According to a research, it takes 50 milliseconds for your website to make a good first impression. Which means that you have 50 milliseconds to visually appeal to your website users. And 94% of the impressions are related to the design of a website. Sure, Content is King; but “Queen Design” steals the show. At its core, Drupal is a framework that is excellent at managing content. However, the Drupal community has built and designed large number of themes to fit every business.

Drupal Themes consist of HTML markup and CSS files that helps in defining the visual appeal of your website. Drupal 8 core comes packed with several basic but impressionable themes like the Claro theme (administrative theme), Bartik theme, Seven theme, Classy theme and more. Don’t forget to watch out for Drupal 9’s (coming soon) new sleek and intuitive default theme - Olivero, which is still work-in-progress, but the style looks amazing already!

 

What should media and publishing websites look for in a Drupal Theme

If none of the default Drupal 8 themes fit your media and publishing business, you can choose from a wide variety of third-party themes. Third-party themes can be categorized into Free Drupal themes, Paid Drupal themes and Custom Drupal themes. Custom themes are opted for when none of the other 3rd party Drupal themes fit a business requirement or when certain CSS styles need to be tweaked. What makes a good Drupal theme?

  • Mobile Responsive – We all know how important it is to have a responsive website today. Not only does it make a great impression, considering the increase in the number of mobile users; it also appeals to Google which in-turn can boost the SEO ranking of a website.

  • Improved content readability - with well-marked layouts and clean HTML 5 markup

  • Friendly Editorial experience design – especially important for media and publishing websites

  • Choice of Layouts to fit your needs – 2 column or 3 column layouts to fit content and ads especially for media websites.

  • Customization options – should be easy to customize while offering customization options

  • Lightweight – Helps in faster page loading

Top Drupal 8 Themes for Media and publishing websites (actively maintained)
  1. Bootstrap

    The very popular and widely used Bootstrap framework is a front-end component library that is ideal for any type of website. The Bootstrap Drupal theme is responsive and acts as a link between Drupal and the Bootstrap framework. Many themes have been based on the Bootstrap framework – some of which we are going to talk about next. It offers slick styles and super-fast page load times with the help of jsDeliver CDN.

  2. Barrio

    This Bootstrap 4 based theme offers flexible layouts that are particularly useful for media and publishing websites. The free Barrio Drupal 8 theme offers 1, 2 and 3 column layouts that are easily configurable. It acts as a base theme on which you can add styles. To completely leverage the power of Bootstrap 4, it is recommended to use the Bootstrap 4 Barrio SASS subtheme. It brings along a variety of styles for every type of element including Color management, dropdown menus, predefined Google fonts and more.

  3. Showcase Lite

    The Showcase Lite Drupal 8 theme is free Drupal theme based on Bootstrap 3 offering a mobile-first layout. It comes with 34 configurable block regions and 1, 2 and 3 column layouts to choose from. With a Superfish menu it offers intuitive navigation with mobile-friendly, touch-enabled and keyboard-accessible drop-down menus. They also offer a Premium version of this Drupal 8 theme.

Image Source – https://www.drupal.org/project/showcase_lite

 

  1. Creative Responsive Theme

    This is a minimalistic yet stunning Drupal 8 theme that does not depend on any core theme. It is responsive, lightweight and comes with clean HTML5 markup and CSS code. It offers 1 and 2 column layout options, more than 16 block regions and multi-level dropdown menus. It offers a Nivo slider that helps showcase featured content in the banner, allowing administrator to add slides to the slideshow as and when they please.

Image source - https://www.drupal.org/project/creative_responsive_theme

 

  1. Newsplus Lite

    The Newsplus Lite Drupal 8 theme is a free Bootstrap 3 based theme and as its name suggests, a very lightweight theme. It is great for styling media websites like News sites and magazine sites. Offering 3 column layouts, it is a responsive theme that is simple yet great looking. It comes with clean HTML5 and CSS3 codebase, a rich footer and plenty of other modern features. They also offer a premium version of this theme.

Image source - https://www.drupal.org/project/newsplus_lite

 

  1. Magazine Lite


As the name suggests, this Drupal 8 theme is lightweight and best suited for magazine websites. It is based on Bootstrap 3 offering mobile-first layouts. It offers a clean 1, 2 and 3 column layouts and Superfish menu for a sleek and stylish news or magazine website.

Image source - https://www.drupal.org/project/magazine_lite

 

  1. Photographer theme

    The Photographer theme is a free Drupal 8 one page portfolio theme that is chic and classy at the same time. It offers a fully responsive layout that is best suited to showcase creative and colorful portfolios. Comes with jQuery dropdown menus for modern and easy navigation. It lets you add more than 10 social network profiles and is integrated with Font Awesome.

Image source - https://www.drupal.org/project/photographer

 

    8. Pixel Theme
 

This is a classic, modern and lightweight Drupal 8 theme that is great for media and publishing websites as well as corporate websites. It is fully responsive and offers 3 column layouts to showcase your work. You can configure up to 20 block regions and comes with a responsive Superfish menu.

Image source - https://www.drupal.org/project/pixels

 

Drupal 8 offers plenty of third-party themes to choose from for every industry sector. Themes can be customized to suit every organization’s unique requirements. Need help in building personalized themes to create fantastic user experiences? Learn more about how our Drupal experts can help you with that and more.

Drupal Planet Shefali ShettyApr 05, 2017 Subscribe For Our Newsletter And Stay Updated Subscribe

Leave us a Comment

  Shefali ShettyApr 05, 2017 Recent Posts Image Top 8 Drupal 8 Themes for Media and Publishing Websites Image Drupal 8 Web Accessibility – Why we love it and Why you should care too Image Drupal 7 to 8 Migration - A How-to guide that addresses migration Challenges (with recommendations) Looking to customize stunning themes for your Drupal 8 website? TALK TO US Featured Success Stories

Know more about our technology driven approach to recreate the content management workflow for [24]7.ai

link

Find out how we transformed the digital image of world’s largest healthcare provider, an attribute that defined their global presence in the medical world.

link

Discover how a Drupal powered internal portal encouraged the sellers at Flipkart to obtain the latest insights with respect to a particular domain.

link

ARREA-Systems: Drupal Landing Page - part 1

Main Drupal Feed - Tue, 03/10/2020 - 09:37
Drupal Landing Page - part 1 Arrea Systems Tue, 03/10/2020 - 17:37 There is no easy way to build a simple landing page in Drupal. This is how we built ours. In this article we look at the first step: create a (very) basic theme.

Centarro: Expanding JSON:API support in Drupal Commerce

Main Drupal Feed - Mon, 03/09/2020 - 22:38

Our vision is to power eCommerce innovation through every stage of growth. Most of our users start out running Drupal full-stack, responsible for both the front-end and the back-end. Many reach a point where growth demands decoupling the front-end to improve performance, create unique customer experiences, or both. If not that, most will need to expose Centarro Commerce data to the other business systems they implement to run their companies.

To facilitate these use cases, we’ve focused hard on designing and developing a JSON:API based Commerce API module, making it a core concern in our product roadmap. This module builds on our previous efforts, such as the Cart Flyout module that progressively decoupled the shopping cart.

When deciding on what we wanted an HTTP API to accomplish, we considered every aspect of our data model and how front-end applications need to interact with it, including:

Read more

Centarro: Expanding JSON:API support in Drupal Commerce

Main Drupal Feed - Mon, 03/09/2020 - 22:38

Our vision is to power eCommerce innovation through every stage of growth. Most of our users start out running Drupal full-stack, responsible for both the front-end and the back-end. Many reach a point where growth demands decoupling the front-end to improve performance, create unique customer experiences, or both. If not that, most will need to expose Centarro Commerce data to the other business systems they implement to run their companies.

To facilitate these use cases, we’ve focused hard on designing and developing a JSON:API based Commerce API module, making it a core concern in our product roadmap. This module builds on our previous efforts, such as the Cart Flyout module that progressively decoupled the shopping cart.

When deciding on what we wanted an HTTP API to accomplish, we considered every aspect of our data model and how front-end applications need to interact with it, including:

Read more

Centarro: Expanding JSON:API support in Drupal Commerce

Main Drupal Feed - Mon, 03/09/2020 - 22:38

Our vision is to power eCommerce innovation through every stage of growth. Most of our users start out running Drupal full-stack, responsible for both the front-end and the back-end. Many reach a point where growth demands decoupling the front-end to improve performance, create unique customer experiences, or both. If not that, most will need to expose Centarro Commerce data to the other business systems they implement to run their companies.

To facilitate these use cases, we’ve focused hard on designing and developing a JSON:API based Commerce API module, making it a core concern in our product roadmap. This module builds on our previous efforts, such as the Cart Flyout module that progressively decoupled the shopping cart.

When deciding on what we wanted an HTTP API to accomplish, we considered every aspect of our data model and how front-end applications need to interact with it, including:

Read more

Evolving Web: How to Set Up BLT and Gitlab CI to Work with Pantheon Hosting (Part 2)

Main Drupal Feed - Mon, 03/09/2020 - 20:02

This is Part 2 of our article on how to tweak BLT so that it can work with Pantheon. If you want more information about BLT, Pantheon, and our setup, go to How to Set Up BLT and Gitlab CI to Work with Pantheon Hosting (Part 1). In this part of the article, we'll go into the details of setting up the CI/CD system in a Drupal project with BLT and Gitlab CI.  

Part 2: Use BLT with Pantheon

We'll set up a development workflow with:

  • BLT: a suite of tools that wraps around your Drupal project
  • Gitlab CI: the pipeline to validate and build artifacts
  • Pantheon: hosts the Drupal site

In this tutorial, we'll set up a Drupal website with the name drupal-books-api.

The Setup  0. Create the project on Pantheon 

Create the Drupal project on Pantheon, then switch into Git and collect the Git URL. 

1. Create project with BLT 

On your computer, create the project by running

composer create-project --no-interaction acquia/blt-project drupal-books-api

Open the file blt/blt.yml and update git.remotes with the Git URL

git: default_branch: master remotes: - ssh://codeserver.dev.xxxxxxxxxxxxxxxxxxxx@codeserver.dev.xxxxxxxxxxxxxxxx.drush.in:2222/~/repository.git2. Add Gitlab CI 

Gitlab CI, by its name, is a service from Gitlab that integrates CI/CD pipelines to help build, test and deploy applications. 

We'll start by adding the file name .gitlab-ci.yml into the project's root. 

## 1. use docker image composer image: composer ## 2. define custom variables variables: BLT: ./vendor/bin/blt ## 3. cache, reused packages fetched from previous job cache: paths: - $HOME/.npm - $HOME/.nvm - vendor - docroot/core - docroot/modules/contrib - docroot/themes/contrib - docroot/profiles/contrib - docroot/libraries ## 4. additional setup, prior to running the main tasks before_script: # Setup SSH key to push artifact to deploy to server - mkdir -p ~/.ssh - eval $(ssh-agent -s) - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - echo "$DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa && chmod 0600 ~/.ssh/id_rsa - ssh-add ~/.ssh/id_rsa # Install rsync as needed by BLT - apk add rsync --no-cache ## 5. define stages stages: - validate - build_deploy ## 6. stage validate validate: stage: validate script: # Install required dependencies using composer - composer install --ignore-platform-reqs # Validate composer, phpcs ... - $BLT validate ## 7. state build and deploy build_deploy: stage: build_deploy only: - master script: - $BLT artifact:deploy --commit-msg "$CI_COMMIT_TITLE" --branch "master" --ignore-dirty --ignore-platform-reqs --no-interaction --verboseExplanations: 

1. Use Docker image composer: This defines the Docker image that the executor will run to perform CI tasks. This setup uses the composer image. If your CI/CD pipeline has specific requirements, e.g. a specific PHP version, you can always find another prebuilt Docker image from DockerHub. Or if none suits your purpose, you can create and push a custom Docker image for your team. 

2. Define custom variables: These variables will later be used during the run of CI tasks. In this example, we defined a variable named BLT which equals to ./vendor/bin/blt. Then in step 6, $BLT validate simply means running script ./vendor/bin/blt validate.

3. Cache: Cache the downloaded dependencies so that in the next stage, it doesn't have to download them again from the Internet. This helps speed up the running time of the jobs. 

4. Before script: the additional tasks to run prior to the main tasks. At the end of the build process, we want Gitlab CI to push the latest version to Pantheon. As in the first step, we defined Pantheon to accept Git push via SSH protocol, so we need the container where Gitlab CI is running our tasks to be able to identify itself with Pantheon. In this step, we simply create a SSH key ~/.ssh/id_rsa with content from $DEPLOY_PRIVATE_KEY. $DEPLOY_PRIVATE_KEY is a predefined environment variable that we set up in our Gitlab project by going to Gitlab > Your Project > Settings > CI/CD > Variables. 

The value of DEPLOY_PRIVATE_KEY is the private key, which can be retrieved by 

pbcopy < ~/.ssh/id_rsa // Then paste it into CI/CD variables

Or if you don't have pbcopy, simply copy the contents of ~/.ssh/id_rsa

Note 1: Make sure that the SSH key id_rsa.pub is added to your Pantheon account, otherwise the Pantheon server has no idea who is pushing code. 

Note 2: It's a good practice to set up a separate SSH key for deployment for each team. 

5. Define stages: Define how many stages you should have in your pipeline. In our simple project, we have two stages: validate code and build the artifact, then deploy it. 

Steps 6 and 7 include tasks to run in each of the stages. 

6. Install dependencies and perform validation: Although BLT will run composer install during the process of creating an artifact, this step is required to make sure BLT and its dependencies are present and up-to-date before running any BLT commands afterward. $BLT validate runs a group of commands below: 

blt tests:composer:validate blt tests:php:lint blt tests:phpcs:sniff:all blt tests:yaml:lint:all blt tests:twig:lint:all

7. Build the artifact and deploy to Pantheon's server: If all is good, Gitlab CI jumps to the second stage by running the command 

blt artifact:deploy --commit-msg "$CI_COMMIT_TITLE" --branch "master" --ignore-dirty --ignore-platform-reqs --no-interaction --verbose

This will create an artifact, then push it to the branch master of the remotes defined in file blt.yml mentioned in step 1. At the end of the process, you'll see the commit passed through to Pantheon's dashboard.

Notice that in step 7, there is a declaration of only which accepts master. This means the step build_deploy triggers only when an action is made on the branch master. 

Let's say your team follows Gitflow workflow. When a developer pushes the feature branch (feature/00000-change-header-color), Gitlab CI should run the validate stage to verify and sniff code, but should not deploy it right away to Pantheon. Instead, the developer would create a Merge Request against master. Once approved, trigger CI to validate again, then build and deploy to Pantheon. 

So, with the addition of the file .gitlab-ci.yml, we are able to orchestrate a Gitlab CI instance to validate code and push it to Pantheon when things are right. 

3. Update settings.php 

At this point, we have the CI set up and configured, but that's not enough for our small project to run on Pantheon. We need the database connection.

Drupal projects created by Pantheon come with a modified version of settings.php and an additional file settings.pantheon.php. These files allow your project, when run on Pantheon, to be able to read the database connection from a JSON file located at $_SERVER['PRESSFLOW_SETTINGS'], and use it to connect your Drupal site to the correct database. 

A project created with BLT doesn't come with this setup by default, so we need to update settings.php and settings.pantheon.php from the Pantheon repo. 

Note: Make sure to have hash_salt in your settings.php 

$settings['hash_salt'] = '41kFdvIe95v0tbqQWoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-JJwoEW4iQeHer-wkMB3rgAXkVFQ';4. Add the pantheon.yml file 

While Acquia prefers to put Drupal code in the docroot directory, Pantheon nests docroot in a directory called web. So we need to add the final tweak—add the file pantheon.yml to the project root: 

# Put overrides to your pantheon.upstream.yml file here. # For more information, see: https://pantheon.io/docs/pantheon-yml/ api_version: 1 # PHP Version: # https://pantheon.io/docs/pantheon-yml#php-version # Set site's PHP version to 7.2 php_version: 7.2 # Nested Docroot # https://pantheon.io/docs/pantheon-yml#nested-docroot web_docroot: true

If your project doesn't have this file, Pantheon will create one. Since we want to specify web_docroot: true, creating a pantheon.yml tells Pantheon not to overwrite our custom setup. 

And lastly, we need a symlink 

ln -s docroot/ web

Now, commit the changes to Gitlab and wait for the green check marks in Gitlab CI/CD > Pipelines. 

Where to Go From Here 

Now that everything is in place, development workflows in teams are simpler and more manageable: 

  • Developers can just worry about their code and dependencies, not the deployment. With BLT and Gitlab CI, only SASS files make their way to the Git repo, so there's no more resolving of CSS conflicts, no more commits of type "Recompile CSS" 
  • Vendor/, core/, modules/contrib/, libraries/ can be excluded from the Git repo 
  • Deployment is more consistent as the build process runs through the same list of predefined tasks 

A more complex setup can include: 

  • Custom Docker image to run Gitlab CI tasks 
  • More code validating 
  • Automated testing 
  • Complex approval process 
  • Post deployment notifications

This is one way to make BLT work with Pantheon. Let us know if you have comments or questions!

+ more awesome articles by Evolving Web

MidCamp - Midwest Drupal Camp: MidCamp 2020 is Going Digital

Main Drupal Feed - Mon, 03/09/2020 - 19:28
MidCamp 2020 is Going Digital

Due to the worldwide Coronavirus/COVID-19 response and in consideration of the health of our community, we have reconsidered the implications of moving forward with business as usual for MidCamp. While there are currently no travel or gathering warnings for Chicago, we need to consider that historically, >40% of our attendees travel to the event. Additionally, current advice and historical evidence suggest that proactive steps are essential in containing the network effects of the virus.

Fortunately, we have the tools and ability to share our information in a remote manner, and as such we’re moving MidCamp to a 100% remote format this year. There’re many details to work out, but our aim is to deliver the same quality content on the same schedule as we would have done in person.

What does this mean for attendees?

  • All social events will be cancelled.

  • All Wednesday trainings will be cancelled.

  • All tickets will be refunded.

    • We are still accepting individual sponsorship donations. Donations will go toward deferring cancellation costs, toward costs of the virtual event, and towards our 2021 event.

  • If you’ve booked accommodations with the Midcamp 2020 group at Hotel Versey, call (773) 525-7010 to cancel. 

    • Cancel 24 Hours prior to 4pm day of arrival to avoid 1 Night charge plus tax.

Our goal is to maintain the high-quality content you've come to expect from MidCamp without adding any risk to the community we care so deeply about. We appreciate your patience and flexibility with this change of format. If you have any questions at all, feel free to contact us at info@midcamp.org, or hop into our Slack https://mid.camp/slack.

Thanks again for your support!

MidCamp - Midwest Drupal Camp: MidCamp 2020 is Going Digital

Main Drupal Feed - Mon, 03/09/2020 - 19:28
MidCamp 2020 is Going Digital

Due to the worldwide Coronavirus/COVID-19 response and in consideration of the health of our community, we have reconsidered the implications of moving forward with business as usual for MidCamp. While there are currently no travel or gathering warnings for Chicago, we need to consider that historically, >40% of our attendees travel to the event. Additionally, current advice and historical evidence suggest that proactive steps are essential in containing the network effects of the virus.

Fortunately, we have the tools and ability to share our information in a remote manner, and as such we’re moving MidCamp to a 100% remote format this year. There’re many details to work out, but our aim is to deliver the same quality content on the same schedule as we would have done in person.

What does this mean for attendees?

  • All social events will be cancelled.

  • All Wednesday trainings will be cancelled.

  • All tickets will be refunded.

    • We are still accepting individual sponsorship donations. Donations will go toward deferring cancellation costs, toward costs of the virtual event, and towards our 2021 event.

  • If you’ve booked accommodations with the Midcamp 2020 group at Hotel Versey, call (773) 525-7010 to cancel. 

    • Cancel 24 Hours prior to 4pm day of arrival to avoid 1 Night charge plus tax.

Our goal is to maintain the high-quality content you've come to expect from MidCamp without adding any risk to the community we care so deeply about. We appreciate your patience and flexibility with this change of format. If you have any questions at all, feel free to contact us at info@midcamp.org, or hop into our Slack https://mid.camp/slack.

Thanks again for your support!

MidCamp - Midwest Drupal Camp: MidCamp 2020 is Going Digital

Main Drupal Feed - Mon, 03/09/2020 - 19:28
MidCamp 2020 is Going Digital

Due to the worldwide Coronavirus/COVID-19 response and in consideration of the health of our community, we have reconsidered the implications of moving forward with business as usual for MidCamp. While there are currently no travel or gathering warnings for Chicago, we need to consider that historically, >40% of our attendees travel to the event. Additionally, current advice and historical evidence suggest that proactive steps are essential in containing the network effects of the virus.

Fortunately, we have the tools and ability to share our information in a remote manner, and as such we’re moving MidCamp to a 100% remote format this year. There’re many details to work out, but our aim is to deliver the same quality content on the same schedule as we would have done in person.

What does this mean for attendees?

  • All social events will be cancelled.

  • All Wednesday trainings will be cancelled.

  • All tickets will be refunded.

    • We are still accepting individual sponsorship donations. Donations will go toward deferring cancellation costs, toward costs of the virtual event, and towards our 2021 event.

  • If you’ve booked accommodations with the Midcamp 2020 group at Hotel Versey, call (773) 525-7010 to cancel. 

    • Cancel 24 Hours prior to 4pm day of arrival to avoid 1 Night charge plus tax.

Our goal is to maintain the high-quality content you've come to expect from MidCamp without adding any risk to the community we care so deeply about. We appreciate your patience and flexibility with this change of format. If you have any questions at all, feel free to contact us at info@midcamp.org, or hop into our Slack https://mid.camp/slack.

Thanks again for your support!

Evolving Web: How to Set Up BLT and Gitlab CI to Work with Pantheon Hosting (Part 1)

Main Drupal Feed - Mon, 03/09/2020 - 16:06

As developers, we all want to maximize the use of the tools we've become familiar with. For me, this is BLT by Acquia. Since BLT fits with Acquia's workflows and Acquia Cloud, it's not designed to work with Pantheon, which has a different setup and development workflow.

This article will help you make tweaks so that BLT can work with Pantheon. The setup in this article is deliberately simple in order to explain the approach and concept. The real world setup is usually much more complex and depends on the needs of each project.

Also in this article, we will implement a simple CI/CD pipeline to conduct a seamless flow of continuous integration from the developer's code to the phase where code is delivered to the deployment server.

To be as thorough as possible, we will break the article into two parts:

  • Part 1: We'll explain what parts make up the system and why they're important.
  • Part 2: We'll show you how to implement the setup.

TL;DR: if you're already familiar with BLT and Pantheon, go to How to Set Up BLT and Gitlab CI to Work with Pantheon Hosting (Part 2). Otherwise, read on.

Part 1: What and Why The CI/CD Pipelines

A typical Drupal project includes a Drupal code base, version control software (Git), dependencies management tools (Composer, NPM, Bower), and development and production environments.

The pipelines connect all parts of the projects together and orchestrate them to do their jobs at the right moment, thus creating a flow of updates from developers to the deployment server.

In our setup, the workflow looks like this:

  1. Developers push code to Gitlab.
  2. Gitlab CI gets triggered and spins up a Gitlab runner, which is a build instance. Gitlab runners run each and every task as defined in the .gitlab-ci.yml. Tasks are: 
    • Code sniffing 
    • Installing composer dependencies 
    • Run npm or gulp tasks to build front-end assets 
    • Run tests if needed 
    • Sanitize and build artifacts
  3. Push the artifact above to Pantheon.

Pipelines done right can increase product quality thanks to the layers of validation. It can also increase the speed of deployment, which means that new features and bug fixes will reach deployment faster.

Pantheon

Pantheon is one of the biggest names in Drupal hosting. Pantheon's main workflow includes the three main environments Dev-Test-Live and Multidev, which creates extra development environments that development teams can use to test feature branches before merging back to Dev.

Acquia BLT

In some big Drupal projects where many developers are involved, automation is required and managing configurations across many Dev-Stage-Preprod-Prod environments becomes complicated. Things can easily become chaotic due to the different ways each member of the team approaches problems.

Acquia BLT is a suite of tools that wraps around your Drupal project, which helps you manage team projects in a more standardized way. It also adds an automation layer on top of Drupal, making the implementation of continuous integration and deployment easier.

Some notable features of BLT:

  • Local Git hooks: Sniffing coding standard on each commit, or even setting a standard pattern on git commits. This is very useful, for example, when we have the git commit pattern set to 00000 - description of commit, which helps track down the commit and the task in PM tools such as Jira or Redmine.
  • Automation tasks: Tasks such as compiling front-end assets and composer install.
  • Artifact generation: Creating production-only artifacts. Generating a safe artifact to deploy to another git repo involves a lot of steps. During the process of generating artifacts, BLT goes into directory ${project.root}/deploy, checks out the main code base, installs dependencies, builds front-end assets, sanitizes the code base, and creates an artifact ready to deploy. This process is complex given the amount of tasks to run and the amount of files to include or exclude from the artifact. BLT is built on a set of best practices in Drupal development and does the heavy lifting in sanitizing and preparing the code.
  • CI/CD: Works with Acquia Cloud pipelines and Travis CI or Gitlab CI.
An Example

In some projects, we had to integrate Drupal with Okta authentication using module simplesamlphp_auth. Okta configuration needed to be declared in vendor/simplesamlphp/simplesamlphp/config/config.php, and this could be erased when running composer install. Then we needed to add the extra commands post-install-cmd or post-update-cmd to remember to patch the SimpleSAMLphp package with our configuration.

It's manageable, but when a new developer comes onboard, you'll need to explain all these details again and again.

With BLT, it's simple to set up simplesamlphp_auth: add a SimpleSAMLphp to blt/blt.yml, then BLT will remember to include your config from ${project.root}/simplesamlphp/config during the deployment.

This is a simple use case that we like from BLT. Even if you're experienced and can handle all DevOps and automation tasks by writing your script, it's still hard to synchronize your brain with your colleagues'. This setup allows you to automatically include your config during deployment so you don't have to go through all the steps again.

Implementation of the Setup

In How to Set Up BLT and Gitlab CI to Work with Pantheon Hosting (Part 2), we'll go into the details of the setup and show you how to run a Drupal site wrapped by BLT on a Pantheon server.

+ more awesome articles by Evolving Web

wishdesk.com: Drupal 8 website migration plan & SEO: key things to consider

Main Drupal Feed - Mon, 03/09/2020 - 15:27
Migration involves plenty of aspects. Today, we will review a very important, but often overlooked one — SEO. Discover the best SEO practices in planning a Drupal site migration to the 8th version. 

Pages