i’ve been using contexts as a way to separate resources for my client for a site i’m building on revolution.
i’ve been searching around, but since i’m not using a subdomain for the separate contexts, the guide on that hasn’t helped me.
basically i list a set of resources in one context that my client has access to, and he’ll edit/add/remove resources from there to his heart’s content.
i have the main site in the "web" context and for the most part i’m getting resources from the other context using snippets and it works fine, with one exception, when i generate a link to a document in that context, the link is generated as if the document and it’s parent were in the "web" context, but clicking on the link sends me to the "document not found" page rather than listing the resource.
am i doing something wrong? i’ve added anonymous with load permission and a level of 9999 to this context, copying what i saw for the web context, but that hasn’t helped. what am i missing here? or is it not possible to link cross-context like i am doing?
example, my site is like this:
web/
web/search
web/search/search-results.html
on that page i get a list of items from
documents (this is my 2nd context)
documents/category1/
documents/category1/document1.html
documents/category2/
documents/category2/document2.html
etc...
so the link that gets generated by modx from
web/search/search-results.html
is:
web/category2/document2.html
does that link not work since category2 is in a different context?
-
MODX Staff
- 10,725 Posts
How are you building the links?
-
MODX Staff
- 10,725 Posts
Do you have a base_url set differently in the document context from the web context? It’s not totally clear what you are describing here, but web/ would never be a valid URL in the documents context if I understand correctly. The URL structure in the document context should follow the parent Resources in that context, plain and simple if you are not changing any settings per context.
/web/ and /document/ aren’t in the URL, i just used them to show where the resources are that i’m trying to access/access from
i want to link from a resource in /web/ to a resource in /document/
when i create a link in a resource in /web/ to a resource in /document/, it creates links the same as if the resource was in /web/, relative to the root of my site.
i’m not using contexts to divide up sites across domains/subdomains
i was using it to sort my content, but i guess the contexts aren’t made for that.
if i were to have a sub-folder called "documents" in this case, and then link to documents in there, how would i go about directing modx to use this folder?