My Google skills may be failing, or perhaps this should be obvious, but I’m unable to find any information on implementing taxonomies in revolution. Ideally, it would be possible to display a list of all resources that share have a common tag (or combination of tags). Does anyone know what how this should be implemented?
I apologize if this has been answered elsewhere.
Related, (and this may be another instance of imbecility on my part) I’d like to be able to generate a list of all child resources by entering the path to a container. For example, if containername has three children, entering mysite.com/containername/ would display a list of them.
Thank you.
To answer your second question, you could do it fairly easily with just the name of the container (assuming that you have no duplicate container names):
$resource = $modx->getObect(array('pagetitle'=>'name_of_your_container'));
$children = $modx->getChildIds($resource->get('id'));
$children will be an array containing the ids of the children. If you’d like an array containing the child objects themselves, you’d use this in place of the second line:
$resource->getMany('Children');
-
MODX Staff
- 10,725 Posts
See the getResources snippet; it has TV filtering options that are infinitely more efficient at this kind of query.
Thank you, I’ll have to spend some time with that.