tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/20671-stop-base-assets-from-showing-up-in-the-query-api-queriesCascade CMS: Discussion 2015-12-22T20:21:23Ztag:help-archives.hannonhill.com,2010-02-09:Comment/386604842015-12-09T15:27:43Z2015-12-09T15:28:31ZStop base assets from showing up in the Query API queries<div><p>I am having a reoccurring issue of having to manually remove
base assets used for factories from queries that use
<code>$_.query.byContentType("MyType")</code></p>
<p>Does anyone know a way to make base assets not show up when
using the Query API?</p></div>kendjonetag:help-archives.hannonhill.com,2010-02-09:Comment/386604842015-12-09T16:48:21Z2015-12-09T16:48:21ZStop base assets from showing up in the Query API queries<div><p>The only way I know of is to somehow filter them out while
processing the loop. For instance, if the path contains your base
asset folder.</p>
<pre>
<code>#if(! $page.path.contains('-defaults') )
<div>do something</div>
#end</code>
</pre>
<p>You might also be able to get around by keeping your base assets
in a separate site and limiting the query to just one site.</p></div>Eric L. Eppstag:help-archives.hannonhill.com,2010-02-09:Comment/386604842015-12-09T16:57:20Z2015-12-09T16:57:20ZStop base assets from showing up in the Query API queries<div><p>After looking at my code to refresh my memory, the separate site
solution is what I'm using and it works.</p></div>Eric L. Eppstag:help-archives.hannonhill.com,2010-02-09:Comment/386604842015-12-10T18:33:09Z2015-12-10T18:33:09ZStop base assets from showing up in the Query API queries<div><p>Hi,</p>
<p>Eric's solutions are definitely the way to go at this point.</p>
<p>Just wanted to plug there is a <a href="http://ideas.hannonhill.com/forums/52559-cascade-cms-ideas/suggestions/6470659-improved-filtering-for-query-api">
related suggestion</a> on our Idea Exchange to add additional
filtering capabilities to the Query API. A possible addition to
this suggestion could be to filter on the asset name using a
wildcard-like syntax.</p>
<p>If you have not already, I highly recommend voting for this
suggestion if you would like to see it implemented in a future
release.</p>
<p>Thanks!</p></div>Ryan Griffith