We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44665
    • 60 Posts
    sebastian-marinescu Reply #1, 8 years, 3 months ago
    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 Media Sources via API and include it in a Transport-Package?

    Thanks in advance for any answer.

    With kind regards,
    Sebastian

    This question has been answered by sebastian-marinescu. See the first response.

    • Have you considered using Teleport or Vapor to package your prepared starter site? Or looked at BobRay's MyComponent?

      https://github.com/modxcms/teleport/blob/master/README.md
      http://bobsguides.com/mycomponent-tutorial.html
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
      • discuss.answer
        • 44665
        • 60 Posts
        sebastian-marinescu Reply #3, 8 years, 3 months ago
        Quote from: sottwell at Dec 03, 2015, 05:39 PM
        Have you considered using Teleport or Vapor to package your prepared starter site?

        Yes, I have seen these and thought about it, but haven't tried them.
        My goal is to have a package or more provided to a server via an service-provider (which is a whole new issue by itself).

        With Teleport or Vapor I haven't seen the possibility of creating a real MODx-Package.
        That's why I decided that using the classic approach with a simple building process would probably fit best.

        Quote from: sottwell at Dec 03, 2015, 05:39 PM
        Or looked at BobRay's MyComponent?

        I've looked at many examples, including BobRay's MC, but none obviously show it.

        So I searched around and came to the glorious idea of looking up the core.
        In transport.core.media_sources.php the default media-source is created.

        My code will probably now go something like this:

        $sources[$i]= $modx->newObject('sources.modMediaSource');
        $sources[$i]->fromArray(array (
          'id' => 1,
          'name' => 'Filesystem',
          'description' => '',
          'class_key' => 'sources.modFileMediaSource',
          'properties' => array(),
        ), '', true, true);
        


        Thanks for your support and the love tap smiley [ed. note: sebastian-marinescu last edited this post 8 years, 3 months ago.]
          • 3749
          • 24,544 Posts
          MyComponent doesn't do Media Sources yet. It does do dashboard widgets, but I can't remember if it does Dashboards themselves.

          MyComponent does, however, allow you to modify the build files to add whatever you want to the packages it creates.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting