=), at least you also see that like me...and indeed it works with everything else I tried, I could filter for example all resources that are published (there the resources in containers [see explanation below code] are shown!!) or searchable or have a specific pagetitle or even use the :LIKE filter, so my where conditions looked like:
// published -> works
$where = array('published' => 1);
// searchable -> works
$where = array('searchable' => 1);
// pagetitle -> works
$where = array('pagetitle:LIKE' => 'What');
// LIKE filtering -> works
$where = array('alias:LIKE' => 'w%');
// and I can even do -> works...
$where = array('alias' => 'what');
I somehow narrowed it down:
It is not specific to WHAT kind of criteria you're filtering (also 'id' => 22, which would be that document, doesn't work) but where that document is in the document tree...
that sitemap resource lies in a continer "outsites" like so (around the rest of the structure, more simple is almost not possible, the names are the aliases of the resources):
what // (container) -> can be accessed with where
links // (container) -> CANNOT BE ACCESSED with where
we // (normal resource) -> can be accessed with where
do //(normal resource) -> can be accessed with where
outsites // (hidden from menu, container) -> can be accessed with where
sitemap //(normal resource, xml content type, but doesn't matter if html, xml or whatever) -> CANNOT BE ACCESSED with where
nothing special, but somehow I cannot get ANY resources with the where filter inside a container, also not other sites that are children of another resource. If I move that "sitemap" resource up one level (siteroot/contextroot) then the where filter gets it without problems...so this seems really something buggy that the core devs should have a look at I think or then I miss something completely^^ (I also tried to set the &maxDepth param explicitly to 0, but that's default...and didn't help) =), any ideas?
EDIT: Something really even more strange -> When I do array('published' => 1); as where condition then it show all the resources, also the ones in containers (ie the ones with alias = sitemap too), so they don't seem to be really hidden from the snippet^^ but as soon as I add something else like array('published' => 1, 'id' => 22); then everything breaks and I don't get anything back. I also played around with different events, from OnInitCulture to OnWebPageComplete. I also "outsourced" the plugin in a snippet "sitemapIndex" and called it in a resource, also didn't help...
what I tried is also to track down if something is not passed anywhere, for this I added added to googlesitemap.class.php:
/* where filtering */
if (!empty($this->config['where'])) {
$where = is_array($this->config['where']) ? $this->config['where'] : $this->modx->fromJSON($this->config['where']);
$c->where($where);
$this->modx->log(modX::LOG_LEVEL_ERROR, 'where query: ' . $this->config['where'] . ' becomes ' . print_r($where, true)); // added
}
// which gives me
[2012-12-14 11:32:40] (ERROR @ /path/to/index.php) where query: {"alias":"sitemap"} becomes Array
(
[alias] => sitemap
)
in my opinion that looks fine =)
[ed. note: exside last edited this post 13 years, 9 months ago.]