-
Notifications
You must be signed in to change notification settings - Fork 0
Content Sync
The taxonomy vocabularies included in the site can be shared with other sites so that the other sites will always have the latest version changes to the terms.
All of the published terms in each vocabulary for the site are exported by a view. The "White Label Admin" theme has custom settings to allow you to import a the terms for a vocabulary from another site.
There is a custom view that will export every vocabulary on the site via the RestAPI module. The url for each vocabulary will be in the form:
/export/taxonomy/[vocabulary id]?_format=json
E.g.
/export/taxonomy/region?_format=json
This will export all of the fields for each of the terms in this vocabulary that are published.
To import the taxonomy terms from another site, the import settings are set in the "White Label Admin" theme configuration page.
The first setting is the "Sync mappings". This contains a list of all the vocabularies that should be imported from another site. The format is a list of lines where each line contains the fields:
id|site_name|target_bundle|source_url|source_user|source_pass
The fields are:
- id - A unique id for the vocabulary on this site
- site_name - The name of the site the vocabulary is imported from
- target_bundle - The destination vocabulary for the content import. This should start with "taxonomy_term--" and end with the vocabulary name (see example below)
- source_url - The URL where the vocabulary is exported
- source_user - If the source site is protected by HTTP Basic authentication (e.g. shield), this is the username (can be empty)
- source_pass - If the source site is protected by HTTP Basic authentication, this is the password (can be empty)
An example line for the "Sync mappings" is:
region|Site source|taxonomy_term--region|http://<hostname>/export/taxonomy/region?_format=json|username|password
Each mapping will configure the site to download all the terms for a vocabulary, and then create/update each term so that all the fields from the source site are set to the same values on the destination site.
The second setting is the "Time to live". This is the number of seconds to wait between checking if the vocabulary has been updated on the source site. This should be set reasonably high to reduce the load on the website from importing content. For example 604800 would import updates once per week.
There is a button available on the settings page for the "White Label Admin" theme to immediately check for any updates to imported content. This is good to test that the sync is working and will display the number of terms created/updated.
The cron task to import updated content is implemented as part of the White Label Admin theme. It will run while rendering the page for an authenticated user if the "Time to live" has expired for the imported content.
- Home
- Themes
- Block types
- Content types
- Media
- Taxonomies
- Components (Paragraphs)
-
Fields
- Node
- About
- Article Type
- Associated With
- Author
- Attachments
- Audiences
- Citation
- Components
- Consultation
- Consultations
- Copyright
- CTA
- Description
- Display Location
- Document ID
- Event Date
- Event Location
- External link
- Financial year approved
- Funding
- Impact Statement
- ISBN
- Lead Organisation
- Legislation
- Menu settings
- Meta Tags
- Parties
- Programs
- Project dates
- Project ID
- Published date
- Regions
- Report Content Type
- Report settings
- Resource Type
- Search Exclude
- Sidebar Components
- Status
- Sticky at top of lists
- Submission ID
- Submitted by
- Summary
- Superseded-by
- System information
- Tags
- Temporal range
- Themes
- Thumbnail
- Title
- Updated date
- URL alias
- Component
- Accordion Body
- Accordion Speed
- Accordion Orientation
- Accordions
- Blurb
- Body
- Caption
- Colour Scheme
- CTA
- Date
- Details
- Geo json URL
- Geo json Input
- Heading
- Image
- Item Image
- Item Info
- Item Summary
- Item Url
- Label
- Links
- Map bounds
- Nodes
- Read More
- Show Close All
- Show Open All
- Show Toggle All
- State
- Title
- Title Override
- Webform
- Media
- Taxonomy
- Block
- Node
- View modes
- Other