I`ve tried to use it in child resource as (I need to find all the "sister" resources):
It's better to use getResources for something like that, or Wayfinder. getRelated is to automatically get resources that are related in terms of content, not in terms of their location in the tree structure.
Either of the both snippet calls would work to get all siblings, see their respective docs for more info on other properties to use.
Received error message
Would be helpful to see your snippet call and know what error message you got to help with that
BTW maybe it`s better to use Parent ID instead of Parent title?
Not sure what you're talking about here. If you mean the &parents parameter, that accepts parent IDs only.
When I use:
I receive equal results which mean this doesn`t work.
No, you misunderstood/misread the fieldSortDir property.
Let me quote the docs
to explain that:
fieldSortDir Sort direction for the fieldSort property desc
Okay, so it tells it's for the fieldSort property. Let's see what that is..
fieldSort Resource field to sort by, used in conjunction with the fieldSample property createdon
Aha, so the fieldSort property is used with fieldSample. Let's see..
fieldSample Number of resources to use in comparing based on resource fields. Can have a huge impact on performance so if you\'re experiencing long load times, try decreasing this number. 125
Aha! So now we know that fieldSample is used to control the number of resources that are used in the comparison. That defaults to 125 resources that are already somewhat related based on words used in the fields specified, and using fieldSort and fieldSortDir we can influence where we get the sample from.
The default behavior is to get 125 related resources for comparison, sorted based on the createdon field, latest first. In order words, the 125 most recent resources that are somewhat related. Those 125 resources are then processed with an algorithm which results in a ranking for every one of those resources, which is then being output sorted on the rank.
To sum up:
fieldSortDir influences the sample only, not the output.
As this is a snippet to generated a list of related pages, it makes no sense to add a sort property to change the sort to anything but the rank it was assigned.
The only time you *may* see any effect with the fieldSortDir property is when you have an insane amount of resources where the total related resources based on words used exceed the maximum sample size and other results are discarded.
Uncached call makes a lot of trouble.
There is absolutely no reason to call this uncached. A lot of processing is done, and the result of that will never change before a resource is changed and the cache cleared. That said - if there are serious issues other than performance which is obvious, please come forward with more details.
Idea is nice but lack of examples and bugs are crucial...
I've had a more in-depth explanation of how it works (explaining the sample & processing done more) planned, but the minimum call is really all 99% of the users need. I'll just open up the docs and see if there's anything more is missing that really needs to be there, but if there's things that are really missing in your opinion please let me know.
Also, I still have to see a bug report and I think you misunderstood the idea behind this addon
I've done quite extensive testing on various sites and it looks quite solid to me (tho I am biased, of course).
Anyhow - thanks for taking the time to try it out and reporting back. While I may have torn apart pretty much all you said, I really appreciate you taking the time to get back to this topic to share your thoughts.