Moving right along demonstrating the new Drupal 8 Object Oriented Programming structure, this next part of my blog series is going to focus on creating a custom field formatter.
This is part 2 of this blog series. Part 1 covers setting up Grunt and Browsersync, this part will focus on expanding what we created in part 1. It will focus on adding image compression to our Grunt setup. The methods used for image compression aren’t super important but setting up a watcher and using the newer Grunt plugin can be useful for many other things.
A recent internal Commercial Progression project allowed us the opportunity to set up a Drupal 8 site and get REST working on it. In the process, and by merit of the stack being new with the documentation catching up, I learned a few tricks that might be useful for enterprising developers out there.
1. POST-ing entities is to a different path than the REST UI says
If you install the REST UI module and enable an endpoint, you'll see a screen like:
In part 2 of my Object Oriented Programming (OOP) for Drupal 8 series, we are going to create an administration form. If you missed part 1, I talked about how to make a simple custom block in D8, which is something we do here at Commercial Progression to brand our sites. I chose a custom block to show that the new changes in D8 aren’t so scary, and to introduce object oriented concepts and definitions with a real-world example.
About a year ago, Chris pointed the dev team toward a cool new module called Paragraphs. Since then, we've played with it on test sites, rolled it for use on sites for clients (including some big ones!), and tried combinations of bundles and fields that push the limits.
Here are some of the cool things we've done with Paragraphs:
Object Oriented Programming (or OOP for short) organizes code into objects with properties and behaviors. Drupal developers are comfortable with the paradigm of procedural programming, which uses functions to pass in data, manipulate it, and return something. In the following post, I will help explain to tech-savvy developers how OOP will look and feel in Drupal 8.