Drupal

OAuth Client Login(Single Sign-On)

New Drupal Modules - 5 September 2018 - 4:45am

OAuth Client module for Drupal allows you to login into your website with Google, Facebook, Twitter or any other custom OAuth providers. miniOrange OAuth Client module works with any OAuth provider/server that conforms to the OAuth 2.0 standard.

Features Supported by the miniOrange OAuth Client module

  • miniOrange OAuth Client Module works for login with any 3rd party OAuth server or custom OAuth server.

Categories: Drupal

Migrate Hierarchical Taxonomy

New Drupal Modules - 5 September 2018 - 3:40am

Migrate Plugin to import hierarchical taxonomy from source.

Require Migrate Plus

Categories: Drupal

Term Tree Selector

New Drupal Modules - 5 September 2018 - 3:02am

Provides configurable root/leaf selector blocks for term trees with 2 or 3 levels.

Terms will only show in the selector if they are published and have content.

Installation

Once enabled, you can place one or more "Term Tree Selector" blocks with the following configuration:

Categories: Drupal

Acro Media: Live Component Guide with Drupal Paragraphs

Planet Drupal - 5 September 2018 - 2:00am
The making of Acro Media’s website content creation framework


It’s common place for brands to create guides so that there is a constant standard to follow when working with the brand’s identity. These are generally called Style Guides. We have one ourselves that we use when designing internal documents and printed layouts. This is great when it comes to branding, but how do you go about maintaining a level of consistency for something larger, such as a website? We recently underwent a fundamental shift in the way we create our website content, and with it, the Live Website Component Guide was born.

The Content Type Crux

For those familiar with Drupal, creating something called a Content Type is a common way to go about setting up a type of content - think your standard web page, blog post, frequently asked questions, rich media slider, etc. That content type can then be used to generate the pages of your website.

This works well enough if your site doesn’t need to change, but our marketing team is constantly looking to adapt to new trends, change content layouts, and A/B test. A website should ideally be dynamic and quick to change, however, changes ended up taking a lot of time because they need to first be designed and then built. The standard Drupal content type is rigid and the layout is fixed, so if you want to change the layout, the change is going to cascade to any page that uses that Content Type. Because of this, we often needed to create a whole new Content Type, template and styling. Something that should be quick ends up taking weeks because our process just wasn’t efficient. And furthermore, the more code we introduced, the more difficult the site was to maintain.

Eureka! Paragraphs

In February of 2017, we had a “eureka” moment while attending the Pacific Northwest Drupal Summit in Vancouver, BC, Canada. Here we learned about a new (to us) content creation module called Paragraphs. I know many people have been using this module for a while now, but it was new to us and we immediately saw the potential. As stated on the Paragraphs module’s Drupal.org project page:

“Paragraphs is the new way of content creation! It allows you — Site Builders — to make things cleaner so that you can give more editing power to your end-users.”

And it DOES do that! Instead of thinking in ‘pages’ we can now think in ‘components’. The graphic below illustrates this. On the left, a representation of a standard Drupal page layout using a Content Type. On the right, the same page broken out into individual Paragraphs components.

Content Type vs Paragraphs

What this module allowed us to do is to remove the rigid structure of the Content Type and instead build out a set of individual, standalone components that can then be inserted into a page wherever we want. If we want to add a new component to a page, we just select the component from a list and place it on the page. To remove one, we just click a remove button. To change the order, all we need to do is drag and drop the component where we want it. If there is a component that we need, but doesn’t yet exist, we can now create just that one component. It makes things fast!

The content creation aspect is incredible dynamic and easy to use. The best part of all is that once the components are built, the only need for a developer is to create new components later on. The actual content creation can easily be done by anyone with a very small bit of training.

From a design point of view, our designers can now piece a layout together knowing exactly what components are available to them. They know that if we’re missing a component, they can come up with something new and it’s not going to take weeks to implement. Plus, we already loosely follow the Atomic Design methodology by Brad Frost, so the whole concept was easy for them to grasp and got them excited. In fact, our Creative Director jumped on this concept and we now include a full set of content creation Paragraphs components in every new project that we build.


An example of how easily we can generate page layouts using component driven design.

Things get very easy from a code maintenance point of view too! We created each of our components to have a standalone template and styling. This means that things stay consistent throughout the site no matter how a page has been setup. If we need to make a visual change to a component, we make it once and the change cascades throughout the site. The code base is small and logical. Anyone new to the project can jump in and get up to speed quickly.

Our Live Website Component Guide

So, if you’ve read this far, I bet you want to see it in action? You’re in luck! I recorded a quick video that shows you how it works using our corporate website’s Live Website Component Guide. You can watch the video below or view the page in all its glory.

Categories: Drupal

OpenSense Labs: HowTo: Change the PHP version on Apache or Nginx

Planet Drupal - 5 September 2018 - 12:42am
HowTo: Change the PHP version on Apache or Nginx Raman Wed, 09/05/2018 - 13:12

New versions of PHP bring new features and fixes for security issues and bugs. Migrating from one version to another can often lead to incompatibilities. As of writing this article, PHP 7.2 is the latest stable release and PHP 7.3 is expected to be released in December 2018. Drupal.org currently recommends PHP 7.1+ for new projects and encourages the community to plan an upgrade for older versions.

Drupal, as we know, is a CMF written in PHP. It uses various PHP libraries and components including the Symfony framework, the Twig template engine, PHPUnit, Guzzle, etc. Hence, it is always recommended to do a compatibility check with all the components, libraries and core/contributed modules of your Drupal site before upgrading to newer versions of PHP.

Now, the process of changing the PHP version of your Drupal site may vary with your hosting provider and the access level that you have on the server. But for this tutorial, Ubuntu 16.04.4 LTS with Apache 2.4.18 and Nginx 1.10.3 was used. Few commands, configuration files, and directory paths may differ with your system and the version of web servers.

Checking the current PHP version

First and foremost, let us see what all versions of PHP are currently installed on our system.

$ update-alternatives --display php


You may also check all the installed PHP packages along with its extensions using:

$ apt list --installed | grep "php*"

By default, the one with the highest priority will be the command line version. That is, if we use the interactive shell or parse a PHP file through the terminal, this version will be used.

$ php -v


However, this selected command line version may/may not be the configured with your web server. To check the PHP version configured with the web server, you may create a phpinfo() page or echo out the PHP_VERSION_ID constant / phpversion() function.

$ cd /var/www/html/drupal8 $ drush php-eval "echo phpversion();

 

List of PHP configurations provided by phpinfo()

If you do not have the access to your server through SSH, you may also view the current PHP version using the Status Reports of your Drupal site available under /admin/reports/status.

Checking the PHP version using Drupal’s Status Report
Why Update to PHP 7?

Here are some of the reasons why you need to upgrade from PHP 5 to PHP 7:

  1. PHP 7 is twice as fast as PHP 5. The huge upward shift in performance is one of the reasons why an upgrade is important. This means your website loads in lesser time, giving your web users another reason to stay on your website. 
     
  2. PHP 7 supports simultaneous execution of asynchronous tasks. Tasks such as networks, access to the database, timers and perform events related to I/O operations can be done asynchronously by putting in place a single PHP event-loop. 
     
  3. It is mobile-first. Of course, you need to offer a better value proposition to your users. And mobile users cant be ignored here. PHP 7 offers exactly what businesses need to do to cater to the needs of mobile device users.

    It offers reduced memory usage, execution engine improvements, and native local threat storage which are specifically suited to mobile devices that have limited browsing features. 
     
  4. Uses lesser memory. PHP 7 has demonstrated that technology infrastructure can process higher computing requests without consuming proportionately higher memory. 
How to change the PHP version?

Since Apache and Nginx are the most popular web servers in the market, we will have a quick look on how to change the PHP version on them. Also, it is highly recommended to have a backup of your Drupal site before tinkering around with any of the configurations on your server.

Now, in my case, I have PHP 7.0 configured on the web server and Drupal is giving a nice recommendation to upgrade it. But I do not have the latest PHP 7.2 installed on my system, so, I will first download it along with the required PHP extensions.

These include extensions for URL, JSON, Image, Library, Mbstring, Open SSL, and XML. But, just to ensure that all the extensions get installed, let’s install them manually.

$ sudo add-apt-repository ppa:ondrej/php $ sudo apt-get update $ sudo apt-get install php7.2 php7.2-fpm php7.2-xml php7.2-mysql php7.2-gd

You may view the packages using dpkg -l php7.2* to confirm.

I. Command Line Version

To change the command line version of PHP you may use the following command. Again, changing this won’t affect the version used by the web server.

$ sudo update-alternatives --config php


Enter the choice number mentioned besides the desired PHP version

or

$ sudo update-alternatives -set php /usr/bin/php7.2


II.  Apache

For Apache web server, the a2enmod and a2dismod scripts can be used for enabling and disabling the PHP modules.
Disable all the previously enabled PHP modules

$ sudo a2dismod php5.6 $ sudo a2dismod php7.0 $ sudo a2dismod php7.1

Enable the new PHP version module

$ sudo a2enmod php7.2

Restart the web server    

$ sudo service apache2 restart

 

PHP version for a specific website can also be set through to the .htaccess file in the following way.

AddHandler application/x-httpd-php72 .php


III. Nginx

For Nginx, we simply need to update the PHP-FPM socket in its configuration file. But before that make sure that the PHP-FPM is installed for your version and is running as a service.

Take a backup of the default configuration file and then open it up in your favourite text editor.

$ cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak $ sudo vim /etc/nginx/sites-available/default


Change the FastCGI backend to use the new PHP-FPM socket, save and exit the file

location ~ \.php$ {         include snippets/fastcgi-php.conf;         fastcgi_pass unix:/run/php/php7.2-fpm.sock; }

Run the configuration test

$ nginx -t

Restart the web server

$ sudo service nginx restart

We have now successfully changed the PHP version of our Drupal site. Now, navigate to Manage → Reports → Status report to ensure that the version has been changed and there are no errors or warning from any Drupal module or PHP library.

Observe that the PHP version has been updated to 7.2.9-1

 
As expected, it did not produce any errors or warnings on a raw Drupal 8 installation. If you face any issues, make sure you installed all the required PHP extensions for your PHP version, check the log messages and refer the issue queues of the core and contrib modules.

In case of any queries or suggestions, feel free to drop down a comment.

blog banner blog image Drupal Apache Nginx Blog Type Tech Is it a good read ? On
Categories: Drupal

Feature Policy

New Drupal Modules - 4 September 2018 - 7:57pm

Configure a Feature Policy header for your site.

Categories: Drupal

Reporting

New Drupal Modules - 4 September 2018 - 7:54pm

Configure Reporting API endpoints for use by browser features such as Content Security Policy and Feature Policy.

Categories: Drupal

Compound Title

New Drupal Modules - 4 September 2018 - 2:45pm

Provides a compound title field which can be very useful if you want an entity label which is composed of two separate texts.

For generating the usual node title the module has a dependency for Automatic Entity Label. The configuration can easily be done by using the above module token patterns settings.

Categories: Drupal

Trusted redirect

New Drupal Modules - 4 September 2018 - 7:21am

Drupal by default does not allow redirect responses to be redirected to external destinations.

This module allows that.

It introduces configurable list of external hosts which are white-listed. So anytime the redirect response is served the module checks if the destination contains trusted host. If yes then the redirect is normally processed.

Categories: Drupal

Surveygizmo Drupal

New Drupal Modules - 4 September 2018 - 7:06am

This module provides simple integration of survey from SurveyGizmo. To use this module you must establish an account at surveygizmo.com. To display surveys you'll need to have one or more surveys published at surveygizmo.com

Future Development:
We will add basic administration of SurveyGizmo surveys within a Drupal site.

Restrictions:
SurveyGizmo has lot of custom field types for survey but here we are supporting only the fields supported by Drupal forms.

Categories: Drupal

Drop Guard: Drupal Europe - welcome to Darmstadt!

Planet Drupal - 4 September 2018 - 6:45am
Drupal Europe - welcome to Darmstadt! We are excited! We want to share with you:

 

  1. There will be a huge European Drupal Event next week and we will attend - what do we bring to the table?
  2. It’s in our hometown Darmstadt, right on the doorstep - where can you spend your free time? 
  3. We’ll volunteer actively for the first time - join the contribution squad!
 

 

Drupal Drupal 8 Drupal Community Drupal Planet Events
Categories: Drupal

My re-entry from vacation

Dries Buytaert - 4 September 2018 - 3:08am

Today is the first day back from my two-week vacation. We started our vacation in Maine, and we ended our vacation with a few days in Italy.  

While I did some work on vacation, it was my first two-week vacation since starting Acquia 11 years ago.

This morning when the alarm went off I thought: "Why is my alarm going off in the middle of the night?". A few moments later, reality struck. It's time to go back to work.  

Going on vacation is like going to space. Lots of work before take-off, followed by serenity and peaceful floating around in space, eventually abrupted by an insane re-entry process into the earth's atmosphere.

I got up early this morning to work on my "re-entry" and prioritize what I have to do this week. It's a lot!

Drupal Europe is only one week away and I have to make a lot of progress on my keynote presentation and prepare for other sessions and meetings. Between now and Drupal Europe, I also have two analyst meetings (Forrester and Gartner), three board meetings, and dozens of meetings to catch up with co-workers, projects, partners and customers.  Plus, I would love to write about the upcoming Drupal 8.6.0 release and publish my annual "Who sponsors Drupal development?" report. Lots to do this week, but all things I'm excited about.

If you're expecting to hear from me, know that it might take me several weeks to dig out.

Categories: Drupal

Dries Buytaert: My re-entry from vacation

Planet Drupal - 4 September 2018 - 3:08am

Today is the first day back from my two-week vacation. We started our vacation in Maine, and we ended our vacation with a few days in Italy.  

While I did some work on vacation, it was my first two-week vacation since starting Acquia 11 years ago.

This morning when the alarm went off I thought: "Why is my alarm going off in the middle of the night?". A few moments later, reality struck. It's time to go back to work.  

Going on vacation is like going to space. Lots of work before take-off, followed by serenity and peaceful floating around in space, eventually abrupted by an insane re-entry process into the earth's atmosphere.

I got up early this morning to work on my "re-entry" and prioritize what I have to do this week. It's a lot!

Drupal Europe is only one week away and I have to make a lot of progress on my keynote presentation and prepare for other sessions and meetings. Between now and Drupal Europe, I also have two analyst meetings (Forrester and Gartner), three board meetings, and dozens of meetings to catch up with co-workers, projects, partners and customers.  Plus, I would love to write about the upcoming Drupal 8.6.0 release and publish my annual "Who sponsors Drupal development?" report. Lots to do this week, but all things I'm excited about.

If you're expecting to hear from me, know that it might take me several weeks to dig out.

Categories: Drupal

Agiledrop.com Blog: AGILEDROP: How to Backup a Drupal 8 Site

Planet Drupal - 3 September 2018 - 6:57pm
There’s always a chance when it comes to software that something might go wrong or fail. There are specific steps implemented in every good piece of software to negate this possibility or at the very least recover from it. However, if nothing else works then restoring from a backup is the best possible solution. This means that making regular backups is an important step in ensuring you don’t lose your data. Drupal is no different in this regard. Apart from avoiding losing your data, making backups can also be very useful as a cautionary method, if you are trying something new on your site… READ MORE
Categories: Drupal

Colorfield: Lando configuration for Search API Solr with the Umami profile

Planet Drupal - 3 September 2018 - 12:42pm
Lando configuration for Search API Solr with the Umami profile christophe Mon, 03/09/2018 - 21:42 A walkthrough to join the dots between two posts about setting up Lando for Drupal and Solr for Drupal with Search API, and also a good opportunity to cover all the steps to spin up an evaluation or development environment for this setup. Lando comes with the great benefit for a team to share the server configuration alongside the project, so we have a predictable environment to deploy in production and do not add configuration maintenance overhead on the team, especially in the case of more advanced setup like Solr, Varnish, decoupled setup, ...
Categories: Drupal

OpenSense Labs: Integrating Internet of Things and Drupal

Planet Drupal - 3 September 2018 - 10:16am
Integrating Internet of Things and Drupal Shankar Mon, 09/03/2018 - 22:46

You may have left for an outstation trip leaving the house door open. Or your city's waste management department may need to know if the trash cans in a locality are full to the brim. Also, carbon dioxide emissions from factories may have to be monitored remotely. All such situations call for Internet of things that gives you the power of connectivity to control and monitor seamlessly. Integration of IoT with Drupal’s robust content management framework can be highly effectual in facilitating the business workflow of your organisation.


It’s great to witness the changes from the pre-internet era to this world of connected people through all sorts of technological advances. Websites are an ultimate medium of offering a great digital business experiences to the users. 
Drupal is one notch higher than the rest and its flexibility has made it possible to incorporate benefits of a futuristic technology like IoT into your websites.

Evolution of Internet of Things

It is interesting to see such an innovative piece of technology steadily taking centre stage. But how did something like IoT came into being? First ever IOT device burst into the scene when a  toaster was created for the INTEROP Conference in 1989 that could be controlled over the internet. 1991 saw the first ever website going live.

In 1993, a Trojan Room Coffee Pot, created by University of Cambridge, could monitor the pot levels and send the data to the server. It wasn’t until 1993 when the term ‘Internet of Things’ was first coined.

A discernible evidence of the growth of IoT, which was being seen as a force to reckon with, was seen during 2006 to 2008 when the European Union realised the potential that IoT had to offer to the world. A European IoT conference was held to discuss the enormous possibilities of enabling IoT.

Thus, around 2008-2009, IoT took a new avatar as this was seen as the birth of a new era with more things connected to the internet than the people as was stated in a report by Cisco. In 2011, Internet of Things made it to the list of Gartner Hype Cycle for the emerging technologies.

Source: Gartner

In 2017, Gartner mentioned IoT platform in its list of Hype Cycle for Emerging Technologies. We will see how Drupal can be efficacious in building an IoT platform later in the blog.

Source: Gartner

Although both the IoT and the website saw the emergence almost at the same time, websites have seen a massive growth. Drupal can lay the perfect foundation for an IoT platform.

The Architecture of the Internet of Things

Gartner defines IoT as the network of physical objects that contain embedded technology to communicate and sense or interact with their internal states or the external environment.

Prime characteristics of the Internet of Things can be described as below:

Source: International Journal of Engineering Science and Computing
  • Network accessibility, compatibility, and interconnectivity: Amazing connectivity features of IoT help in providing network accessibility which basically means getting on a network. It also lends compatibility which gives the common ability to consume and produce data. Moreover, it provides interconnectivity that permits anything to be catenated with the global information and communication architecture.
     
  • Adhering to the constraints of things: It can provide things-related services by adhering to the constraints of things. For instance, privacy protection and semantic consistency between physical objects and their associated virtual things.
     
  • Heterogeneous devices: IoT devices are characterised by their heterogeneity. They can interact with other devices and service platforms through different networks.
     
  • Scalability: Devices that need to be governed and that communicate with each other will be greater than the ones connected to the internet. Handling the data generated and their interpretation for application purposes is even more pivotal in such cases.
     
  • State of devices: It is characterised by dynamic changes in the state of devices. For instance, it can either be connected or disconnected depending upon the conditions. Furthermore, the context of devices like location and speed can very different too.
     
  • Security: Safety of both the personal data and the physical things are of paramount importance. Security paradigm that scales with the deployment of endpoints, networks and the data that moves across all of it needs to be taken care of.
IoT architecture comprises of 4 key layers of technologies that form the pillar of support for the IoT. Source: International Journal of Engineering Science and Computing
  • The lowermost layer consists of smart objects incorporated with sensors. They provide the IoT devices with the characteristic feature of interconnectivity by allowing real-time data collection and processing between the physical and digital worlds. For instance, they can come in handy in measuring and recording temperature, pressure, air quality, humidity etc.
     
  • The second layer comprises gateways (microcontrollers, microprocessors etc.) and networks ( WiFi, GSM etc.). An enormous amount of data produced by sensors needs a transport medium in the form of high performing gateways and networks.
     
  • The third layer forms the management service layer which has the functionalities like the management of devices, analytics platform, process modeling and secure handling.
     
  • Finally, the uppermost layer signifies the application layer which is the amalgamation of the first, second and third layers put into practical use.
Applications of the Internet of things Industry-wise use of IoTInternet of smart environment Source: ZDNet

Keeping your environment safe and future-secure has been streamlined by IoT. Be it air pollution monitoring, forest fire detection, weather monitoring, checking water quality, controlling river floods, and protecting wildlife, IoT can be applied to a great effect. For instance, Bigbelly’s solar-powered trash can alert sanitation crews when it is full.

Internet of smart agriculture Forecasted market value of smart agriculture worldwide from 2015 to 2020 (in billion U.S. dollars) by Statista

Farmers and agriculture engineers can leverage the benefits of IoT for efficient farming. IoT smart devices allow you to monitor greenhouse gases to maximize the yield, control humidity and temperature levels in the compost, locate and identify animals grazing in the open pastures, monitor offsprings in the animal farms, etc. For instance, WaterBee is a smart irrigation system which helps in collecting information on soil content to help reduce water wastage.

Source: TelefonicaInternet of smart energy Source: Telefonica

Controlling the flow of energy from wind turbines, controlling AC-DC power supplies, and optimising the performance of solar energy plants are some of the advantages of using IoT in the smart energy consumption. GE wind turbines use sensor and grid data to reduce costs of producing clean energy and increase electricity production.

Internet of smart cities Source: Smart & Resilient Cities

It can be used in the cities for monitoring material conditions in buildings, smart fire management systems, weather-adaptive lighting in the streets, intelligently sending a warning to take diversions in case of any unexpected event on highways, and real-time monitoring of parking space availability. OnStar’s automatic crash response uses sensors to detect vehicle crash and send alerts to the concerned authorities.

Internet of smart health Source: Moschip

IoT smart devices can be highly useful in smart surveillance of patients, controlling conditions inside a freezer which store vaccines, and fall detection of independently living elderly people. Shockbox can be fit inside a helmet which uses sensors to detect any collisions.

Internet of smart lifestyle Source: PWC

Smart living is possible with IoT as it allows the appliances to be remotely switched on and off, detects window and door openings, monitors home safety through cameras and home alarm system, and monitors water supply consumption. Belkin Echo Water uses sensors to track water usage in a household.

Business importance Source: Samsung

IoT can be highly effective for your business growth with a superabundance of advantages. Some of the most important benefits include:

Better customer service

Attracting new customers, reward the new loyal and regular ones, and understand the behaviour of people in and around your premises can be really useful. Connected devices help in making that a reality. For example, Amazon Dash Button helps you in ordering your favourite products with a simple click.

Efficacy in business functioning

Efficacious functioning of business is of utmost importance. Internet-connected devices have the ability to gather and assess data and share them with other devices. Sisense enabled bulb connects to the Sisense analytics platform which can be programmed to change colour to reflect performance on certain metrics. So, if the daily sales target is met, the bulb can show a green light.

Remote business functioning

Business chiefs may have to travel places to supervise the progress of a project. IoT helps them in remotely turning an equipment on and off and monitor the activity in the office irrespective of their physical location. Rolls Royce, one of the leading automobile manufacturers, has raked in a lot of money through business insights they have generated from clients through remote monitoring.

Easily track inventory

Keeping track of business workflow can be streamlined. Your business might be dealing with a plenty of raw materials, components, and finished products which can turn out to be difficult to keep a track of. The internet-connected system of sensors enables in tracking down each stage of business workflow whether it is in the factory or a warehouse. RFID chips can help track inventory movements across a supply chain and within the garments store itself.

Saves business costs

IoT can help cut business costs through proper monitoring of usage of organisational spaces. Business organisations may lead a tough time in monitoring empty conference rooms with air-conditioners turned on. Connected devices let you control and monitor usage levels. Magnet 360, which helps businesses use the Salesforce platform realised that their system needed an upgrade. Through sensors, that could analyse air flow, they could cut down energy cost by up to 70 percent.

Consistency in production quality

Connected devices can help monitor the quality of production quality for manufacturers. In 2016, the manufacturing industry has spent $178 billion in IoT. Eaton provides on-line partial discharge sensors that perpetually monitor the insulation integrity of the medium-voltage equipment. This helps in identifying low-level capacitive discharge activity prior to insulation failure thereby optimising productivity.

Drupal and Internet of Things Incorporation

Smart wearable

DrupalCon New Orleans 2016 had a session which talked about bringing Drupal and internet of things together.


It showed a demonstration that used a barometric pressure sensing, GPS-enabled wearable armband connected to the internet. It could, then, display an icon to provide the weather forecast for the current location.

The armband, which was tethered to iPhone, used mobile data to send latitudinal and longitudinal data to a ThingSpeak channel(an API for the Internet of Things). It, in turn, sent this data over HTTP to the Drupal 8 site to track the location of a ship. When the Drupal 8 website received this authenticated POST data, it created new location nodes, updated the map and table that is built with Views, and altered a block on the sidebar to show the matching icon of weather in the current location of the ship.

A presentation at DrupalCamp Oslo 2015 had a number of demonstrations to show how Drupal can be integrated with IoT technology.


Offline Status Checker

One of the first use cases was the Offline Status Checker. It was a simple demo where ESP8266, WiFi microchip with full TCP/IP stack and microcontroller capability, and a LED light was used. If the maintenance mode on Drupal 8 site was toggled to turn it on, LED light glowed red and if the maintenance mode was turned off, then the light glowed green. Basically, front page of the Drupal 8 site was queried to verify if the site is online.

Toggle maintenance mode with a TV remote

Another demo in the same presentation was called ‘Toggle maintenance mode with a TV remote’. A microcontroller received a infrared signal which was programmed to recognise on/off buttons of a TV remote. That means, it recognised only the on/off button and when it did, maintenance mode on the Drupal site was toggled.

Monitoring temperatures using Raspberry Pi

In addition to these, Raspberry Pi was used to remotely monitor temperatures and post them as nodes. Raspberry Pi, small and affordable computer used to learn programming, had a sensor attached to it to sense temperature every 3 minutes and send it to an endpoint using an API key. This API key was valid for one user and for every valid key, Drupal site allowed the posting of the node.

Arduino board integration

Arduino board, which senses the surrounding by receiving the inputs from sensors and controls lights, motors and other actuators, was integrated to a decoupled Drupal site in another demonstration. So, addition of new node of a picture of dog was recognised by Arduino board which, in turn, toggled the maintenance mode of decoupled Drupal site.

Future of Internet of Things

Predictions 2018: IoT moves from Experimentation to Business Scale, a report by Forrester, compiled some interesting facts about the internet of things and its steadfast growth.

Voice-based services would be the key part of business plans to be rolled out in the coming future.

Also after passing GDPR, the European Commission will issue guidelines to encourage the use of this technology and facilitate their the economic growth. This is because only 45 percent of data and analytics decision-makers at US organisations say they have commercialised their data while only 35 percent of those at French organisations and 38 percent of those at German enterprises do so.

Deployment of business processes that requires local data analysis close to the connected devices to enable these processes would take momentum.
 
Those who have been building industrial IoT platforms would exit the IaaS business.
 
There will be the danger of more IoT-related cyber attacks both on endpoint devices and on the cloud backplane as hackers set out to compromise systems to extract sensitive data.
 
Maturation of IoT and blockchain tech giants would drive blockchain adoption in the coming years.

Conclusion

Internet of things can bring the world closer. Amalgamation of Drupal and IoT can lead to something unique with Drupal’s flexibility in content management and IoT’s seamless connectivity between devices.

Reach us out at hello@opensenselabs.com to get the best of the internet of things and Drupal for your enterprise.

blog banner blog image Internet of things Drupal 8 Drupal Content Management System Blog Type Articles Is it a good read ? On
Categories: Drupal

Commerce ML Starter DEMO

New Drupal Modules - 3 September 2018 - 8:27am

Демо-контент для демонстрации работы модуля https://www.drupal.org/project/cmlstarter

Categories: Drupal

Paragraphs entity embed

New Drupal Modules - 3 September 2018 - 7:51am
Categories: Drupal

Manifesto: Grow as a Drupal developer: deep dive into a bug

Planet Drupal - 3 September 2018 - 6:20am

There are moments in your life as a developer when you ask yourself if you are good and how you can improve. And then you may decide to learn a new library, or new tools, or read a tech book or a few articles. Still, you don’t know if that’s the right approach. For me. Continue reading...

The post Grow as a Drupal developer: deep dive into a bug appeared first on Manifesto.

Categories: Drupal

Kristof De Jaeger: Exclude entities which have a redirect from the search api index

Planet Drupal - 3 September 2018 - 5:27am

For a custom project, we use a taxonomy to tag nodes. Some terms have their own page, while others redirect to a node. The search on the site has one index which contains both nodes and terms, but the terms which are redirecting shouldn't show up when viewing a search results page. While it's possible to use hook_search_api_index_items_alter(), a nicer way to exclude them is by using a processor plugin so you can enable them in the UI per index. The relevant code is underneath. Adjust to your own likings - and maybe inject the service if you want to as well :)

<?php
namespace Drupal\project\Plugin\search_api\processor;

use Drupal\search_api\IndexInterface;
use Drupal\search_api\Processor\ProcessorPluginBase;

/**
 * Excludes entities which have a redirect.
 *
 * @SearchApiProcessor(
 *   id = "entity_redirect",
 *   label = @Translation("Entity redirect"),
 *   description = @Translation("Exclude entities which have a redirect from being indexed."),
 *   stages = {
 *     "alter_items" = 0,
 *   },
 * )
 */
class EntityRedirect extends ProcessorPluginBase {

  /**
   * {@inheritdoc}
   */
  public static function supportsIndex(IndexInterface $index) {
    foreach ($index->getDatasources() as $datasource) {
      $entity_type_id = $datasource->getEntityTypeId();
      if (!$entity_type_id) {
        continue;
      }
      if ($entity_type_id === 'node' || $entity_type_id == 'taxonomy_term') {
        return TRUE;
      }
    }
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function alterIndexedItems(array &$items) {
    $repository = \Drupal::service('redirect.repository');
    $pathAliasmanager = \Drupal::service('path.alias_manager');
    /** @var \Drupal\search_api\Item\ItemInterface $item */
    foreach ($items as $item_id => $item) {
      $object = $item->getOriginalObject()->getValue();
      try {
        $path = $object->toUrl()->toString();
        $path = $pathAliasmanager->getPathByAlias($path);
        $path = ltrim($path, '/');
        $redirect = $repository->findMatchingRedirect($path);
        if (!empty($redirect)) {
          unset($items[$item_id]);
        }
      }
      catch (\Exception $ignored) {}
    }
  }

}
?>
Categories: Drupal

Pages

Subscribe to As If Productions aggregator - Drupal