-
- 60 Posts
Hi MODx-Community,
I'm making my first transport-package. It's an "MODx-Website"-Package where I try to integrate everything a MODx-Website needs into the package.
So far I'm packing in: Chunks, Snippets, Templates, TVs, User-Groups, User-Roles and the Package-Attributes (license/readme/changelog).
MODx allows almost anything to be done via the API, so I'm left with the question:
Is it possible to create a Dashboard via API and include it in a Transport-Package?
Thanks in advance for any answer.
With kind regards,
Sebastian
-
- 24,544 Posts
You may want to set the PRESERVE_KEYS attribute to false in your build.transport.php file in case the user already has another dashboard installed. You may also want to set the hide_trees field to true or false.
-
- 24,544 Posts
If the user already has a dashboard with the ID of 2, your dashboard won't be installed.
A better method is to set PRESERVE_KEYS to false, then in a resolver that runs late in your package (after the dashboard is installed), find the dashboard by name and set the user-group's dashboard to its ID.
Of course your method is fine if you're certain that there are no other dashboards installed.