Another popular method of creating an API from a Drupal site is using the RESTful module.
In this exploration of the module we will:
- Walk through the documentation
- Use the example code to expose basic entity information
- Write custom code to expose more complex data
By the end of this lesson we'll have built the final API we're going to use to build a demo application.
Self-check question: Without looking at the repository, can you write the code necessary to expose Drupal menus using the RESTful module?
Additional resources
In this tutorial we'll begin building our simple Javascript blog application. Starting with Bootstrap templates, we'll use a Javascript implementation of the Twig template language to make our blog dynamic. In the course of doing so, we'll learn about Cross Origin Resource Sharing (or CORS). We will also begin to identify some common implementation patterns in our Javascript, and start to refactor our code to improve its organization.
Self-check challenge: Create another sidebar block in our blog that pulls data from Open Weather Map to display the current temperature in your city.
Additional resources
Building a traditionally "coupled" Drupal site provides us with a lot of functionality we've so far taken for granted when building our simple blog.
This lesson attempts to remedy some of that by: building a functional pager and a post archive.
We'll also make our blog into an actual Single Page Application (or SPA) by using the client-side router provided by Backbone.js
Self-check challenge: Add a form with select list elements that filter posts (instead of relying on the sidebar links).
Additional resources
One of the historic complaints—and drawbacks—of client-side Javascript applications is that they aren't SEO-friendly. While Google's crawler, in particular, is starting to execute Javascript on pages it indexes, in this tutorial, we'll take a look at a couple other of methods of mitigating this issue.
In particular we'll learn about:
- Prerender.io
- What is Isomorphic Javascript?
- Writing a server with Express.js
Self-check question: In addition to SEO, what are some other benefits of isomorphic javascript?
Additional resources
Prerender.io
Express.js
What is an isomorphic application? — by Juampy NR on Lullabot.com
Development Environments
TopicDevelopment environments provide a sandbox where you can work on your application without affecting the live site.
Back up Your Drupal Site
TopicA reliable backup will allow you to restore your site if something goes wrong.
Drupal Coding Standards
TopicCoding standards provide a set of rules for how your code should be formatted, and best practice guidelines for naming conventions and the location of files.
Content Types
TopicA content type is a subtype of the [content entity](link to Entity topic). When a content creator goes to add new content to the site, they are presented with a list of content types to choose from to get the appropriate form to fill out.
Drupal's content moderation and workflow tools allow you to configure and support a flexible multistep publication process.
An overview of some of our favorite Drupal documentation resources.
Drush
TopicDrush is a command line interface that enables you to interact with your Drupal site without clicking around the graphical user interface (GUI).
Fields and the Field API
TopicFields are the building blocks of Drupal's powerful content modeling system. The Field API allows for the development of custom field types to suit almost any data display and collection needs.
JavaScript in Drupal
TopicJavaScript files are included by a module or a theme by creating an asset library. Using this asset library system you can selectively choose which files to load, overwrite existing files, or customize them to suit your needs.
PhpStorm
TopicThe PhpStorm integrated development environment (IDE) contains dozens of useful features that make working with a Drupal codebase easier.
Many sites require the ability to upload, manage, and display various assets like files, images, videos, and audio.
Menus
TopicA site’s main navigation elements, whether they be in the header, footer, or sidebar, are composed of links built using Drupal's menu system. Drupal allows site administrators to build menus while also allowing module developers to add and alter menus in code.
Search engine optimization (SEO) is the process of optimizing your online content, so that your content will rank higher in organic (non-paid) search engine results.
Views Module in Drupal
TopicLearn to use data from your Drupal site to create customized lists in various forms, such as bulleted lists, grids, calendars, or sliders.
Learn about Drupal’s configuration system and how to manage configuration with both the administrative user interface and command-line tools.
Blocks
TopicA block is a reusable widget that is placed inside regions (layout containers) of your theme. Blocks can be used by site administrators on the Block layout admin page or provided by a module using the Plugin API.