0
votes

I've a Modx site running. Now i want to get some resources like modx-generated javascript files. It is possible to put these in the web context, but than it can be seen by all users.

So i created a new context named "Resources" (key: res), gave it Load-Only permissions and created a resource in it. I've also initialize it in the index.php file:

$modx->initialize('web');
$modx->initialize('res');

But when i try to access the resource, it doesn't work.

Did i missed something?

1

1 Answers

1
votes

Calling modX::initialize() twice will not work as it checks for state.

Either remove the first call to initailise the web state or write a plugin and use modX::switchContext()