Is there any way to submit variables to the controller file regarding Custom Manager Pages?
Our goal is to read in the controller file a certain TV out of a certain resource. The ID of the resource should be submitted to the controller file by clicking on the created menu object.
Does anybody know how this works?
Thanks for any hint what we have to do for this.
Letti
You are right. I am not looking for a config page, but for a possibility to transfer data from modx to new controller files and reverse.
Does anybody know how to realize this?
Letti
See if this helps:
Here is a description of the fields in the Update Action dialog:
Controller — The name of the file that will be executed (.php is appended to it).
Namespace — The namespace of the action (determines the path to the file and any lexicon topic files).
Load Headers — If checked, the file’s output will be displayed surrounded by the Manager UI.
Language Topics — Lexicon topics to load for the action.
Assets — Currently not used by MODX.
if you want to create CMPs in a very simple way (just by creating snippets) you can try this method:
http://modxcms.com/forums/index.php/topic,54729.msg315441.html#msg315441
MODX will automatically look for a disk file when a controller is called. I doubt if it can be changed to use a resource.
The index.php controller file can use xPDO to access any MODX object in the DB, so it can access TVs, chunks, resources, resource fields, etc. quite easily.
That’s because the current resource has no children.
Take out $modx-> in the second line. You want the resource you retrieved, not the current resource.
Also, you can’t echo the resource because it’s an object, not a string. You want
echo $modx->resource->get(’pagetitle’);
And, you should always test to make sure you have an object before calling one of its methods:
if($resource)
if (! empty($children))