Is there a soul so charitable to explain me the mechanics of a context?
I created a context "secure" in which all documents will be reserved for members. For my tests, I have placed a resource (ID19)
My context "secure" is not sub-domain or domain, it inherits all the settings web context.
In the Web context I have a login page. I followed the instructions of the tutorial "Making Member-Only Pages", but can not access the resource (ID19) in the context "secure".
It give me a page 404 for answer.
Yet when I use the procedure "Making Member-Only Pages" without the my «secure» context, it works perfectly.
I think it’s my misunderstanding of how a "context" works which is the cause.
Can we use a "context" that is not a a sub domain or a domain, in which all parameters are inherited from the web context to create an area for members only? or do we have to create necessarily new setting for all new context?
Revolution 2.0.7
Login : 1.5.2
Login call : [[!Login? &contexts=`secure` &loginResourceId=`19` &logoutResourceId=`14` &tplType=`modChunk` &loginTpl=`loginRdaTpl`]]
ID 14 is in the Web context
ID19 is in the «secure» context
Thank for your help
I’m not sure I understand your problem, but maybe this will help. Contexts, from MODX’s point of view, have little to do with domains and subdomains. You create a new context in the Resource tree and any resources under it in the tree are in that context (just as the resources under the "web" context are in that context).
Contexts don’t inherit anything from each other, but they will use the System Settings unless you override them with Context settings, which you normally do for things like base_path and base_url.
In order for users to access the resource ID 19 in the Secure context, they will have to be logged in to that context, not the ’web’ context, though you can add &contexts=`web,secure` to the Login snippet tag and (in theory) log them into both contexts at the same time.
Another way to go would be to put the Login page in the Secure context.