Zariz is a suite of Drupal modules and methodology, that models content (nodes) creation and editing similar to Git's branches, and allows generating static sites from the Drupal backend.
- Zariz in pics
- Drupal, only x5 faster
- Video - Modules Unraveled Podcast
- Video - jam's Drupal Camp session: Zariz - Continuous Deployment for Content
- Launch a sandbox in http://simplytest.me/project/zariz/7.x-1.x
- Navigate to
/live/user
and login (user: admin pass: admin) - Navigate to
admin/content/migrate
and migate the content - Back in the homepage, you can now branch, create and edit content, and merge
The OG (Organic groups) group type Branch
is equivalent to a Git branch.
// Create a new "master" branch. There can be only a single master on the site.
$live_node = zariz_create_branch('live');
// Branch out fom the live branch.
$dev_node = zariz_create_branch('dev', $live_node);
We can check if there are merge conflicts - meaning that there is already a newer content in the "to branch". Zariz will auto-detect the parent branch.
$conflicts = zariz_get_merge_conflicts($dev_node->nid);
If there are no conflicts, we can merge - meaning that content from the "from branch" will be cloned into the "to branch".
$snapshot = zariz_merge_branch($dev_node->nid);
Snapshots holds information about the content of a branch at a certain time. This is done by simply holding the last entity ID (e.g. node) that existed. The last entity ID can keep changing as long as the snapshot is not locked.
// Get the last snapshot from a branch.
$snapshot = zariz_get_snapshot_from_branch($live_node->nid);
// Check if a snapshot is locked.
$snpashot->isLocked()
// Lock a snpashot.
$snpashot->lock()
Zariz can alter a query to the node table, to reflect the content in a certain branch.
The altering is opt-in, by settings the zariz
query tag. For example:
$query = new EntityFieldQuery();
$result = $query
->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'article')
// Set the Zariz query tag.
->addTag('zariz')
// Set explicitly the Branch ID. If this Metadata is omitted, the
// OG-context will be used.
->addMetaData('zariz', array('branch_id' => $branch_id))
->propertyOrderBy('nid')
->execute();
The same query tag can be also used in Views. For example in /admin/structure/views/view/branch_content/edit
under Query settings
=> Query Tags
notice that the zariz
tag was added.
- Entity reference prepopualte
- Node clone
- Organic groups
- Replicate
- (optional) Commerce - dev version
"Zariz commerce" module integrates with commerce and allows smart revisioning of commerce products.
- In
admin/people/permissions
grant authenticated userBranch: Create new content
- In
admin/config/group/permissions/node/branch
grant non-member and member roles the following permissions: Merge branch
Create Article content
Edit any Article content
Enable zariz_example
module and follow its README
Here is the Drush command to download and install Zariz Example:
drush dl entityreference_prepopulate replicate node_clone
drush dl og --dev
drush en zariz_example
It is possible (and optional) to export Zariz sites in a scalable manner using generator-zariz.
Developed by Gizra