Working with Sitecopy

Before we get into all the features Sitecopy has to offer, it is important to understand how Sitecopy works. Sitecopy is about importing data from a source. You can choose from many different sources; currently, we support CSV and HTML data (scraped from a URL). In the future, we hope to support JSON and XML data, as well as file uploads. Most sources define a set of items that we import one-by-one, but this is not the only option.

Once we have a set of source items, we run them through a series of parsers that you build. These parsers look at the source item and pull data from it and store it under a given name to be used later. We provide a series of basic parsers that address many common use cases. It is also possible to write custom parsers in PHP that extract specific data that you need. This data can then be run through one or more filters to modify it in various ways.

Then, we pick an importer. This determines how the data gets saved in Drupal and, at the moment, there is only one option: entities. All our common entity types are supported and most of the fields for them are also supported. Some field types have some special behaviours and multiple ways of mapping data into them. Taxonomy reference fields can be set to create the taxonomy term if it does not exist, for instance, and can either have a term ID or a term name assigned to them.

Once we have an importer and a set of parsed data, we put these together using mappers. These are responsible for assigning data to a given exposed field or property for the entity. This data can come from the parsed values, a static component or other sources. We are also looking at supporting a series of post-import actions (both post-item and post-import).

All of these different types of handlers can be extended with your own custom versions if the default does not work. For most content that has been sufficiently classified with IDs and classes, importing is relatively trivial to setup.

Next, we’ll go through each type of item and look at what options are available to you, and how you set them up.

» Submit feedback
    Status: 
  • Accepted
    Topics: 
  • Support
    Types: 
  • User Guide
Back to top