Documentation: ContentSync plugin
How it works
One direction
ContentSync copies articles from a source site to a target site. Never the other way. The source site is the original, and the target site follows it.
The plugin runs on the target site. It asks the source site for its articles through the Joomla Web Services API, the same API that Joomla itself offers to apps and other systems. The source site does not know or care that ContentSync exists.
What a run does
Every time the task runs, it goes through these steps:
- It asks the source for its articles, a batch at a time. Filters decide which articles the source hands over.
- For every article it checks whether it has seen that article before.
- A new article is created. A known article that has changed is updated. A known article that has not changed is skipped.
- Images in the article are downloaded if they are not on the target site yet.
- At the end, the result is written to the log.
How it knows what changed
ContentSync keeps a small list of its own: which article on the source belongs to which article on the target, and when that source article was last modified.
On the next run it compares the modification date of the source article with the date it remembered. Only when the source is newer, the article is processed again. That is why a run on a site where nothing changed takes very little time.
Do you want every article processed again, for instance after you changed a setting? Switch on Force Resync for one run. The switch turns itself off afterwards.
What is copied
- The title, the alias and the text
- The publication state, the publish dates and the featured flag
- The language
- The meta description and keywords
- The intro image and the full article image, and the images in the text
- The links A, B and C of the article
The PRO edition adds tags, custom fields, documents and media, and Schema.org data.
What is not the same on both sites
Some things in an article are only a number: the category, the author and the access level. Those numbers mean something else on every site. Category 8 on the source may be News, and category 8 on the target may be Products.
So ContentSync does not copy those numbers blindly. Every article goes into the category you choose. In the PRO edition you can map categories, authors, tags and access levels one by one. Categories, tags, authors and access levels explains how.
Changes on the target site
A copied article is a normal Joomla article. You can open and edit it. But the next time that article changes on the source, the copy is overwritten with the source version.
The rule of thumb: edit on the source. Treat the target as a mirror.
What ContentSync leaves alone
- Articles on the target site that it did not create itself. It never touches them.
- Categories, menus, modules and users. It copies articles, not the site around them.
- The source site. It only reads there.
More than one source
A task has one source site. Add the task again for every extra source, or for every category that should go somewhere else. Each task has its own settings and its own schedule.