I am thinking of the next problem to solve.
If we take this tutorial as a basis,
http://rtfm.modx.com/display/revolution20/Creating+a+multi-select+box+for+related+pages+in+your+template
and have the following site structure:
+ Products
--- Category 1
------- product 1
------- ...
------- product N
--- Category 2
....
--- Category N
+ Accessories
--- Category 1
------- accessory product 1
------- ...
------- accessory product N
--- Category 2
....
--- Category N
Each product may have a related accessories. So we might link them with the multiselect box.
However the interesting part is to reverse link the product when browsing an accessory product (that had been linked to the product). This will produce always correct "replicated links".
i.e. If I have "accessory X" in "Product Y", when viewing accessories page "accessory X" I would like to dynamically link the relevant accessory to the "product X". If a site has a lot of products it will be a nightmare to manage and link all pages separately.
I think the algorithm may be:
when browsing accessories - checking each product TV.value of the multiselect (being an array) for wildcard match of the ID of the accessory. Then store each product ID in an array. Finaly we get resources of these products in the array.
I am not a PHP programmer and mastered modx API (only fair knowledge).
It goes even further - that should work with Multilanguage site set up with Babel.
I think this snippet
could be used to link the IDs
https://forums.modx.com/thread/51038/babel-a-plugin-for-multilingual-sites-with-revolution
Any help will be appreciated.
Nick
[ed. note: nickyz last edited this post 14 years ago.]