I have done a bit of searching and found a few similar posts but no helpful results. I am contemplating a way to setup a website to solve a need.
I want to manage multiple websites using different contexts in MODx. I also have the need to share some resources between the contexts. These are not shopping sites but function a little like one. I want to aggregate the resources using TV filters and display the products as if they were part of the the individual site.
Site 1 - Context
[normal pages]
[resource aggregate of products]
- [view product using template from site 1]
Site 2 - Context
[normal pages]
[resource aggregate of products]
- [view product using template from site 2]
Site 3 - Context
[normal pages]
[resource aggregate of products]
- [view product using template from site 3]
Products - Context
[All products each in a resource]
Presumably I could create each product as a chunk but I would need to filter the products. Any advice is much appreciated.
-
☆ A M B ☆
- 24,524 Posts
How about SymLinks? They act like regular resources, except the content (and other fields according to system settings) gets pulled from the specified resource.
I hadn't thought of symlinks, but I wonder if that would do what I need. The "products" displayed on each of the sites/contexts would differ and the ability to filter is necessary. There would be multiple product group pages displaying aggregated products that visitors may click on and the product would display "within" the context context/website without sending users to another site.
For instance on one context I would want display the products meeting x y z criteria of which there will be a few hundred. I want to pull in the content of those resources and display it on the template used in this context.
Another context will only display x criteria products and so one. I hope this makes sense.
What I hope to do is create multiple shopping sites (without a checkout) where each product is a resource. There are different groups and types of products so filtering etc is necessary.
Is there a way with symlinks this can be achieved?
Susan;
Thank you for your reply. I mistakenly thought of weblinks not symlinks. Today I played with symlinks on one of my sites and noted their capability. I could very easily create a context of products then call them using getResources and filtering. Is there a preferred method for setting up the filters?
What plugin or snippet would be used to aggregate the resources as symlinks rather than "links"?
-
MODX Staff
- 2,502 Posts
jisaac,
symlinks are a type of resource—a pointer to another resource's content with an independent template. As such, you could use getResources to list your symlinks as you would any other resource.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
Jay;
Forgive my ignorance...
I have used getResources to output a list of resources from within my site. Clicking on one of those brings the visitor to the resource. If I point the call to the context holding my "products" would the link not bring visitors to that resource? Or am I missing something?
Please see my initial post for clarification.
-
☆ A M B ☆
- 1,780 Posts
If you use a symlink and a different template, just tell getResources to get it's data from the context you want to show the symlinks from. The results will be the symlink resources, not the resources from the products context, however the symlink resource will grab the contents of the products resources and display them using the "other" template that you assign to the symlink resource.
Clear as mud?
I have toyed with this a bit and am still unable to produce the desired result. What I am getting are links to the other context, not a symlink result.