Created
March 2, 2015 20:46
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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