Amazee Labs has been contributing to Drupal since the very early days of the project. Our contributions range from writing patches and maintaining modules, through to contributing to new releases and we’re proud to be one of the most experienced Drupal agencies in the world. In recent years, we have moulded our technology stack from several key components, some of which go beyond Drupal.
Third and Grove was recognized in the 2020 Acquia Engage Award program, winning an award for Leader of the Pack – Technology, for work with CloudHealth by VMware.
Third and Grove was recognized in the 2020 Acquia Engage Award program, receiving an award for Leader of the Pack – Financial Services, for work with The Carlyle Group.
This is good news. Keeping your platform up-to-date with the next version is no longer an “all hands on deck” situation.
PayPal Credit has been around for some time, but Credit Messaging is now available for merchants in the United States who wish to promote the availability of special financing offers throughout the entire shopping experience.
What does it look like?
We have created a Drupal block you can use anywhere to display the Credit Messaging. It is also fully customizable; you can choose to have Lightweight Text Based Messages, or Flexible Display Banners:
20 Oct, 2020
The need for convenience and effectiveness brought about many innovative ways to access the internet. Native mobile apps and Web apps are two such technologies that have made internet browsing easy and convenient. In this article, we will be talking about Progressive Web Apps and how you can implement it with Drupal using the Drupal Progressive Web App module. But before we dive into all of that, let’s look at the features of native and web apps and how progressive web apps actually fill the gap between the two.
Features of Native Mobile Apps
- They are platform-specific apps. Which also means that they need to be rebuilt for every new platform (iOS, Android).
- Need to be downloaded.
- Usually super-fast.
- Rich in features and functionalities.
- Can blend seamlessly into any device and feel like a part of it.
- Can work offline.
- They can access device data, device hardware and local file system easily.
- More expensive to develop, maintain and upgrade.
- Are pre-approved for security and can be downloaded at App stores.
- Hard for search-engines to crawl.
Features of Web Apps
- Works independent of platform. All you need is a browser to access them. Supports most modern browsers. Does not need to be downloaded.
- No need to upgrade. Lesser development and maintenance costs.
- Although it needs authentication, security is an issue because it can be vulnerable for unauthorized access.
- They don’t work offline and can be slower than native mobile apps.
- They aren’t listed on App stores so discovering them may be harder.
What are Progressive Web Apps and how do they fill the gap?
So, in short, native web apps are highly capable but lack in terms of its reach. Whereas web apps have a wider reach but lack in capabilities. And that is where Progressive Web Apps come in to bridge the gaps.
Progressive Web Apps is an ideal combination of the benefits of native apps and web apps. Using modern web capabilities, Progressive web apps (PWA) can deliver app-like experiences to users. It combines features offered by most modern browsers with the benefits of mobile experiences. You can build native-app-like, extremely complex and installable apps. With Web Assembly being supported by most browsers now, PWAs can be built in languages of the developer’s choice, thus widely increasing the scope and flexibility of the functionalities it can offer.
Features of Progressive Web Apps
- They are platform and device independent. Works beautifully on any browser.
- They load fast and are extremely reliable (even with a low internet speed). Scrolling is very smooth and fluid.
- Can work offline too.
- Native app-like push notifications can be enabled.
- Can access device hardware and data like native apps.
- Shortcuts can be added on the user’s home screen (instead of downloading them)
- No need for complex installations. Can share the URLs easily.
- Responsive across all devices.
- They are easier and faster to develop. Maintenance is easy as well.
Before talking about the PWA module in Drupal, let’s look at the minimum requirements to build a PWA –
- Should be run over HTTPS.
- Should have a Web App Manifest – which is a JSON file containing metadata with information about the web app like the name, description, author and more. This is also useful for search engine optimization.
The PWA Drupal Module – How to make Progressive Web Apps with Drupal 9 (and 8)
The Drupal PWA module is easy to install comes with the Service Worker (for caching and other offline app-like capabilities) and Manifest.js that you can configure. You will however need to make sure you have SSL installed before you begin with the PWA installing process. If your requirement is extremely specific with tons of customizations, you can develop the PWA by using front end frameworks like Angular or React and customize your own Service worker.
Installing the PWA Drupal 9 Module
With Drupal 7, installing the Progressive Web App Drupal module was as easy as downloading and enabling the module. You could generate the manifest.js file via a config form and validate it. However, in Drupal 9, we cannot integrate this functionality directly just by enabling the PWA module. The reason being it does not provide you an option to configure the manfest.js file.
- Install the module by downloading and enabling the PWA Drupal module.
- For Drupal 9, apply this patch
- Once done, navigate to configuration -> PROGRESSIVE WEB APP -> PWA settings and add the required information.
URLs to cache – This is where you can specify the pages that you need to be made available even when offline. The URLs mentioned here will be cached -make sure you flush the cache whenever you make any updates here.
URLs to exclude – If you have pages that absolutely need to work only with the internet, mention them here.
Offline page – Display a personalized page to your users when they get offline and the page isn’t cached.
The Drupal manifest.json file is what allows users to add the PWA to their home screen. It contains configurations that you can modify to change how your PWA will behave – like the name, display name, background color, orientation and more.
The file will be added to the head tag of your index page.
The below image shows the “Add to the home screen” option and an icon will be created on the home screen.
- Outside of work (web development) I look after six Drupal 7 and WordPress sites on shared hosting
- My local development is done on a MacBook using apache (with some dabbling in Lando/Docker). I’ve done some wildcarding with dnsmasq and vhosts to streamline local dev site configuration. CMS code is in git repos.
- My Ansible work is a personal project and I’m the only stakeholder
- I learned Ansible doing this work
I’m using Ansible to:
- backup hosted sites to a local, external hard drive
- automate sync’ing my local dev site from the production site
- automate deploying Drupal 7 and WordPress updates using git as the deploy tool
- automate parts of my WordPress update workflow
Impressions / Observations / Thoughts
In no particular order.
- I love using the Ansible inventory for host data
Having a single source for host data is nice. I didn’t realize how big an issue/pain point this was until it was solved.
- Agentless is wonderful
- Ansible has some unique terminology
It was initially hard remembering Ansible roles are not a security thing.
- Maintaining a consistent set of host variables was more work than I thought
As I iterated writing playbooks and adding or changing host variables, consistently maintaining the variables across hosts became a challenge. I eventually wrote a verification playbook to ensure the required variables existed and had correct values.
- Documenting really helped
Writing the verification playbook in turn inspired me to document the host variables. It was more useful than I expected. This inspired me to document other project conventions. Not only did it help consistency, it helped me maintain a high-level view of what I was doing.
- Single stakeholder is good while learning
I’ve done a lot of refactoring as I’ve learned. I’m happy I started Ansible on a personal project with the luxury to make drastic changes.
- The console output can be awful
In many situations the Ansible console output is hard to read or confusing. And there is no easy method to output custom strings to help create understandable output.
- Thinking about a playbook “wrapper”
Ansible runs the playbook task list on each specified host and reports by host. For some playbooks it would be nice having a customizable playbook wrapper for better host specifiation and summary reporting. In the greater Ansible world there are web based interfaces with the AWX project and RedHat’s Ansible Tower product. Both are overkill for my situation. A shell script will likely be my solution.
- Not for Drupal 8/9
Composer and CI/CD tools provide a lot of automation options that don’t require learning a new language (a colleague is doing some cool stuff with Robo). So far I don’t see Ansible being a better solution, though it could augment a CI/CD workflow in some situations.