That EVAL'd code will always return the ID of the resource that the user is currently visiting. That's what $modx->resource is.
Sorry for my English and thank you for your help, BobRay!

This mean that default value of TV parameter do not store the result of snippet calculation as it was in Evo.
It stores the code of a snippet and every time you call the TV this code will be recalculated giving different results.
The TV default value is not that valuable anymore as it was in Evo. As I could just make a check whether TV is empty and make snippet calculation right inside getResources call.
And as for the general question actually I need to solve a bit more complicated task. Here is my site structure:
mainPage(id=1)
category_level_1 (myTV= ‘empty’)
-category_level_2
-doc1 (myTV=’value1’ )
category2_level_1 (myTV= ‘empty’)
-category2_level_2
-doc21 (myTV=’value2’)
I need to set the value for each level 1 category. This value should be taken from the TV value of the document within this category.
For example for category_level_1 I need to get the value of myTV from doc1 (’value1’) and for category2_level_1 from doc21 (’value2’). And I want to output the values of categories myTVs (along with other TVs and categories fields) on the mainPage of the site by using getResources.
That was an easy task in Evo. I put a simple snippet call in default TV value field for categories. It used category id as a referrer to travel down the tree to the descending document. In Evo all calculations were done right in the default TV value field and modx stored the result of calculation. So when I used ditto to output the TVs the values were not recalculated.
This method became impossible in Revo as the value is stored as a code. So when I call getResources on main page the code which I put in default value field is recalculating and the referring id is not already the category id (but id of the main page).
Hope this was not too complicated

as my English is very poor
I've attached the picture of what I need to achieve as output on main page
[ed. note: sladdals last edited this post 13 years, 4 months ago.]