The problem, as far as I can see, is that wayfinder.php, in the getdata() method, gets the data using SQL. Deeper yet, the problem is that the menu is built according to the parent of the document which is taken from the database.
I guess that I will have to change this and take the parent from the $modx->documentMap variable. But then I run into other problems. I was then thinking of using the MODx getParent() method but I just saw that this method uses the MODx getPageInfo() method to get the parent, which takes it from the database. As far as I can see, this getParent() method does this in order to get other information like alias, title etc. I guess that I have a few options: change the getParent() method to use documentMap to retrieve the parent and db for the other info, to create another method or to try to play around with the wayfinder.php getdata() MySQL.
Right now, without any other changes beside the siteCache file, it retrieves the shared document but it doesn’t display it in the menu because it retrieves it’s original parent. I could maybe change the MySQL so that if it finds a document that in the shared table that equals one in the current document ids to change its parent right away. But what if there are multiple entries in the shared table? Then I would need all those entries, depending on the tree. There is so much to take into consideration!
But I run into bigger problems yet. If I write a new function or change the MODx getParent() method it will be a little difficult to get the right document, between the shared or the original one. This problem seems to be fixed, according to Jason, in the Revolution version due to the multiple domain feature, but when I want to share the same document in the same domain, then what? It seems to me that then I would need to figure out another way to know which value to get out of the multiple returned values...
I have tried to play with the MySQL in wayfinder.php, but this wouldn’t solve the problem for the other 3rd party software... I used the UNION in the MySQL and that seemed to do what I wanted but then the levels are thrown off and it still doesn’t give me what I want.
Sorry if I have confused anyone. If anyone out there has some ideas and thoughts let me know, I’m in need
I, by nature, want to find and use the best way even if it would take me longer to find it, so I would appreciate any help.
---- edited ---
Here is another idea that I’m not too sure how to do or if it would be useful.
what I could do is to check if any of the $ids exist in the shared table. If true, then use getParentIds() for the original doc, for the shared doc and to get the parents for the current doc id. There should be a way then to compare the trees in order to figure out if the original or one (or how many) of the shared docs (if there are multiple) should be used.