Right now you can't achieve that result with Exhibit's native support.
You need to do some scripting. First when you include exhibit-api.js,
add the autoCreate=false parameter to it:
<script src=".... /exhibit-api.js?autoCreate=false"></script>
This is so that you can do the initialization yourself. Then add an
onload handler to <body>
<body onload="onLoad();">
And add this Javascript code:
<script>
function onLoad() {
window.database = Exhibit.Database.create();
window.database.loadDataLinks(onDataLoaded);
}
function onDataLoaded() {
window.exhibit = Exhibit.create();
createCollections();
window.exhibit.configureFromDOM();
};
function createCollections() {
var c1 = Exhibit.Collection.create2(
"typeA-things",
{ itemTypes: [ "TypeA" ] },
window.exhibit.getUIContext();
};
window.exhibit.setCollection("typeA-things", c1);
var c2 = Exhibit.Collection.create2(
"typeB-things",
{ itemTypes: [ "TypeB" ] },
window.exhibit.getUIContext();
};
window.exhibit.setCollection("typeB-things", c2);
var c3 = new Exhibit.Collection("all-things", database);
c3._update = function() {
this._items = new Exhibit.Set(c1.getRestrictedItems());
this._items.addSet(c2.getRestrictedItems());
this._onRootItemsChanged();
};
c3._listener = { onItemsChanged: function() { c3._update(); } };
c1.addListener(c3._listener);
c2.addListener(c3._listener);
c3._update();
window.exhibit.setCollection("all-things", c3);
};
</script>
Remove all <div ex:role="collection"> from your HTML since you're
already creating collections through Javascript.
David