Skip to Main Content
Drupal 8 Module Development - Second Edition
book

Drupal 8 Module Development - Second Edition

by Daniel Sipos
March 2019
Intermediate to advanced content levelIntermediate to advanced
580 pages
15h 3m
English
Packt Publishing
Content preview from Drupal 8 Module Development - Second Edition

The Importer plugin

Alright, since all of our setup is in place, we can now go ahead and create our first importer plugin. As we defined it in the manager, these need to go in the Plugin/Importer namespace of modules. So, let's start with a simple JsonImporter which will use a remote URL resource to import products. This is an example JSON file that will be processed by this plugin, just for testing purposes:

{   "products" : [     {       "id" : 1,       "name": "TV",       "number": 341     },     {       "id" : 2,       "name": "VCR",       "number": 123     },     {       "id" : 3,       "name": "Stereo",       "number": 234     }   ] }

I know, VCR right? We have an ID, a name, and a product number. This is all totally made-up information about products just to illustrate the process. So, let's create our JsonImporter ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Drupal 8 Module Development

Drupal 8 Module Development

Daniel Sipos
Learning Drupal 8

Learning Drupal 8

Rain Michaels
Mastering Drupal 8

Mastering Drupal 8

Chaz Chumley, William Hurley

Publisher Resources

ISBN: 9781789612363Supplemental Content