Sunday 20 March 2011 1:56:29 pm
"
Thank you for your answer. One more question: I want to fetch all the new pages from a specific node, excepting the ones from a specific subbranch. How to I do that? How do I exclude from fetching one specific branch?
"
As far as I know, there's not a mechanism in the fetch function to exclude a subtree. There is a parameter "exclude_object_ids", but you have to specify the object ids of ALL the object you want to exclude, and not only their parents. But one sollution would be to fetch only the pages from the specific nodes. Something like this... Let's say you have this content structure: - News (node_id: 10)
- Economy (node_id: 11)
- Politics (node_id: 12)
- Sport (node_id: 13)
- Old news (node_id: 14)
and that you want to fetch all the articles from "News" except the ones from "Old news". To get that you would do a fetch that gets all the articles from "Economy", "Politics" and "Sport" like this:
{def $news_items=fetch(content, tree, hash(
parent_node_id, array(11, 12, 13),
class_filter_type=include,
class_filter_array=array(article)
))
} Hope it helps.
--
Nothing is impossible. Not if you can imagine it!
Hubert Farnsworth
|