-
☆ A M B ☆
- 27 Posts
Hi Jisaac,
I am not really sure, but you might have to enable/disable the setting: 'allow_forward_across_contexts'.
It's in System Settings > Core > system and server.
Jorgen, thanks for the reply.
It does not seem to make much difference as my getResources call inherently is cross contexts.
-
☆ A M B ☆
- 27 Posts
if i understand correctly, you search in different contexts for resources matching your filter? This will, of course, output the resources found in a manner your &tpl chunk dictates and only returning ID's pointing at these resources not the Symlink.
Now, i presume what want you want to achieve is an output of Symlinks, gathering their content cross context?
So maybe my first question should be:
Are you able too show your symlink resource with cross context content at all?
Still stuck on this one. I walked away and have come back to trying to find a way to produce the desired results - now against deadline.
I created a new context for my products and added a few sample products. Using a simple template showing the product name, intro text, and a link, I displayed the desired product using getResources.
The context for products I setup with a few folders to hold different groups (P1, P2, P3). I created a few products and my getResources call is working to display the matching products. For my test page located in the site root where I placed the getResources call, the link for the displayed products is the current-context-domain.com/P2/P002. However, when I click on it it gives me the 404 error page for my site because of course it is looking for the document that does not exist.
I wish to display the content from the product resource in a specified template. What needs to happen is a dynamic symlink maybe?
Really would appreciate any advice here or suggestions here.
If you know they are all symlinks, you should be able to add that criterion to the getResources &where property (class_key = 'modSymlink'). I could be wrong.
Bob, thanks for the reply.
The product resources (nothing more than a document with TV's that include criteria for grouping and classification) are standard documents. What I wanted to do is pull them up from different contexts. I need to share the "products" between sites/contexts. 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 resources from the Products Context using template from site 3] Want to use getResources or similar call to sort, filter, etc. The end result of clicking on a product would be Site-3-Context-Domain.com/Product-Directory/Product-from-Products-Context not a redirect to the Product Context.
Site 2 - Context
[resource aggregate of products]
- [view product resources from the Products Context using template from site 3] Want to use getResources or similar call to sort, filter, etc. The end result of clicking on a product would be Site-3-Context-Domain.com/Product-Directory/Product-from-Products-Context
Site 3 - Context
[resource aggregate of products]
- [view product resources from the Products Context using template from site 3] Want to use getResources or similar call to sort, filter, etc. The end result of clicking on a product would be Site-3-Context-Domain.com/Product-Directory/Product-from-Products-Context
Products - Context
[All products each in a resource]
I cannot create symlinks for this because it would require duplicate symlinks in each context. My goal was to only create the products in one context, its own context, then "pull" the products into the product group pages for display.
What I am ultimately looking for is something to act like a shopping site where I can group, filter, and sort products as desired on product group pages then allow the user to click on a product and view the product detail. In case of these sites there is not a shopping cart but a capability for users to request info about each product from a form on the product page.
Hopefully this helps clarify and someone can straighten me out.
I wonder if you'd be better off ditching the contexts and just putting the resources in different folders. I avoid contexts whenever possible for the reasons you're discovering. As a result, I don't have enough experience with them to give you much advice.
If you need to keep the contexts, you might consider a custom snippet that will pull the data in for you. You might have to use $modx->switchContext() to get the information (then switch back) -- I'm not sure.
-
☆ A M B ☆
- 24,524 Posts
pdoTools should do it for you.
Bob, unfortunately, in this case we need contexts as there are multiple websites managed by this install and each uses the product system.
Sottwell, thanks for the recommendation. I will start researching pdoTools, this is new to me. Any recommendations or suggested directions for learning/understanding?
jisaac: There are a number of ways to accomplish what you are looking for using Contexts. I have entire sites utilizing Contexts in different ways, so that I can share resources between them, if necessary. In many cases, the solution is likely to require several custom snippets depending upon your need. Some of the work may already be provided for you via Contextualize in the MODX Extras. It allows resources to be defined as cross-context resources and does so by utilizing a template. It may not solve your problem, but it has the code so that you can learn to do something similar, if that's what you need.
If you need something a little more specialized, there are a few more addons that can accentuate your needs. Unfortunately, without seeing your system directly, I couldn't tell you what those are. pdoTools is a great start, though.
[ed. note: fuzzicallogic last edited this post 12 years, 8 months ago.]