Hi, what's the fix for the below scenario?
For example, if we duplicate resource ID#5 and its children (6-10), the new resource tree has resource #11 with children #12-16. But if #5 contained a hard-coded link to #6, #11 will contain the same hard-coded link to #6, when we really want it to link to #12.
Hope to see the answers for it. TIA.
Can you tell more about your scenario. For which reason do you duplicate resource-trees?
Can't you make this hardcoded links dynamic-links, somehow?
Kind of, like Babel it does?
Here are the details about my scenario:
Duplicating the folder and it's children. So the hardcoded page links (eg:[[~1234]]) in the content of old folder are mapping respectively to old folder. So when the content is copied over to new folder, the hardcoded links in the new children should map appropriately to new folder. How that mapping works in MODX?
hmmm, still, I don't understand why you have hardcoded Links and how MODX should translate them after duplicating this resources.
Is there some kind of rule, for example do the duplicates have the same alias?
Excuse me for not being more clear. we have parent folder containing different versions(eg: 1.1, 1.2, 1.3, etc., as children and sub folders as actual pages) under each user guide. So creating a new version by copying/duplicate the old version at children folder level (which takes care of copying the sub folders/the actual pages).
Actual problem is: "content" has some hard coded links to pages of old version as shown below in a "Document".
<ul>
<li><a href="[[~6]]">Page Title 1</a></li>
<li><a href="[[~7]]">Page Title 2</a></li>
</ul>
we want to automatically update the links to point to the similar pages in the new version.
Is there way to do this?
while this might be possible with a custom-coded plugin, that runs at OnResourceDuplicate, I would try to avoid hardcoded links at all, in a setup like that.
Thanks for the quick replies Bruno. I'm going for the custom coding at this point.
You could use Wayfinder to display links to the children.