Node content type object in Drupal 8

When obtaining the node types on a given Drupal site in Drupal 7 we use:

$types = node_get_types();

And the content type machine name is available from:

$names = array();
foreach ($types as $type) {
  $names[] = $type->type;
}

In Drupal 8 we use the following:

use Drupal\node\Entity\NodeType;

$types = NodeType::loadMultiple();
$names = array();
foreach ($types as $type) {
  $names[] = $type->id();
}

Installing Varnish 4.x on Apache Debian 8 server (Jessie) with Drupal 8

Varnish is a very fast caching mechanism for web applications but it is not always easy to install.  In the latest version there are a number of changes pertinent to Debian servers.

The following assumes you are working as root.  If not, then you need to add sudo to the front of all commands.

Installing Varnish on the server

At the command line:

Create a Formatter Plugin to provide active trail links in Drupal 8 Views list

In this example I show how to create a formatter plugin to provide an active trail class to highlight the link of the current page in a Views list.  This behaviour is native to Drupal menus and I could have created a menu but that would not be dynamic and anyway, I wanted to see what is involved in applying active trail classes to a Views list.

Using Colorbox Inline with Views to Display image AND content in a Colorbox

For this implementation you will need to install Colorbox and Colorbox Inline module on a Drupal 8.1 site or higher.  For this exercise I wanted to create the portfolio page on this site, so that when I click on an image on the page I get a lightbox with the image, title (with link) and description of the item.  First create a block View with the image and the desired fields.  If you are displaying more than one image, as I am, using masonry, then you will need to get the ID field (hidden) to use as an identifier.  I have also obtained the image field twice.

Rensselaer Office of Intellectual Property Optimisation Kent Shelley Mon, 05/25/2020 - 21:01

The main purpose of the IPO site is to enable input of patent applications from academics from within and without Rensselaer Polytechnic Institute.  Those patents are then applied for and published.  A form was built for patent input and Solr driven search created for display.  The site also contains a lot of graphical elements.

Heart of the City Kent Shelley Mon, 05/25/2020 - 20:50

Worked as a part of a team to upgrade business site to Drupal 8 from Drupal 7.  My role involved creating a Solr powered search with multiple facets driven by Ajax and being context aware. This required a lot of custom coding and testing.

Pfizer Connect Kent Shelley Mon, 05/25/2020 - 20:38

Worked as part of a team of three backend and three frontend developers to build three sites from scratch within the Pfizer Connect family.  The sites were Connect, which enables communication between health professionals and Pfizer, Support which provides support between the same, and Orders, which enables health professionals to obtain samples of product for testing.  The sites were developed in an agile environment with a team of UX and UI developers.  The code was deployed using a sophisticated CI/CD system via github using Travis to build and test the code.

Chorus Corporate Kent Shelley Mon, 06/04/2018 - 22:02

A site in the Chorus family of companies whose purpose is to provide information to the public about the company finances, directorship and other aspects related to corporate management.  This site is chiefly information only and does not provide any dynamic elements.  The video banners involved contributing back a Video JS module

Chorus Consumer Kent Shelley Mon, 06/04/2018 - 21:53

An Enterprise level website for a major NZ Company with about 4000 unique visitors per day.  This website was developed as a team with technical lead from Passing Phase Web Development.  The site consists of a number of information pages, some online tools and various forms enabling the public to respond to matters involving the services available through the company.  The tools are made using third party code while the forms use Drupal contact form and webform module.

Chorus Service Provider Kent Shelley Mon, 06/04/2018 - 21:38

Created site from scratch.  This is a site used by wholesale customers of the client for developing retail packages for the NZ broadband market.  Key elements are