Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Created March 2, 2015 20:46
Show Gist options
  • Save stevewithington/07a5cf35b68b5bce3d18 to your computer and use it in GitHub Desktop.
Save stevewithington/07a5cf35b68b5bce3d18 to your computer and use it in GitHub Desktop.
Mura CMS : How to combine or commingle multiple feeds/content collections across multiple Mura CMS sites under the same installation.
<cfscript>
// Combine feeds/content collections across multiple Mura sites under same install
feed1 = $.getBean('feed').loadBy(name='Feed Name Goes Here', siteid='SomeSiteID');
feed2 = $.getBean('feed').loadBy(name='Another Feed Name Goes Here', siteid='AnotherSiteID');
// Use Query of Queries to UNION recordsets
qoq = new Query();
qoq.setAttributes(rs1=feed1.getQuery(), rs2=feed2.getQuery());
qoq.setSQL('SELECT * FROM rs1 UNION SELECT * FROM rs2 ORDER BY releasedate');
rsQoQ = qoq.execute().getResult();
// Use the combined query to seed the contentIterator
iterator = $.getBean('contentIterator').setQuery(rsQoQ);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment