We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1251 ☆ A M B ☆
    • 45 Posts
    When I create chunk I know that it is my custom chunk, but if I installed package, chunks created automaticaly. I didn't found the needed fields in schema of database.

    I have one idea or even workflow. My custom snippets I want have as static elements, I want save it to filesystem, make git repository and develop my site. But elements from packages I don't want save to filesystem because it will look up as trash.

    And needed some ideas how check elements which created by system in time of installing package.

    Anybody know?
      Alroniks experts
      MODX Ambassador | MODX Professional

      alroniks.com | [email protected] | +375 33 638 10 92 (Belarus)
      Facebook | Twitter | VK.com
      • 37242 ☆ A M B ☆
      • 339 Posts
      My guess is you could look into the installer script of each package (/core/packages/...) and search for the creation of chunks. Store them into an array, compare to the chunks database table.. cant remember what the name was - it didnt have "chunk" in it.

      I hope I understood you right smiley
        • 1251 ☆ A M B ☆
        • 45 Posts
        It is look as solution. Thanks!

        But field in database would be more useful for this.
          Alroniks experts
          MODX Ambassador | MODX Professional

          alroniks.com | [email protected] | +375 33 638 10 92 (Belarus)
          Facebook | Twitter | VK.com
          • 37242 ☆ A M B ☆
          • 339 Posts
          ok, i'll go and check... smiley
            • 37242 ☆ A M B ☆
            • 339 Posts
            _site_htmlsnippets or modx_site_htmlsnippets if you didnt edit the prefix in the setup.

            I hope this will help you.
              • 18373 ☆ A M B ☆
              • 3,141 Posts
              There's no relation to the package specified from elements. In the build script that makes the package zip, the addon dev can specify how the objects are recognized as being part of the package.. usually by name, but theoretically any other field could be used for that. Even a combination of fields iirc.

              When uninstalling it can remove those objects (again that's something the build script specifies if it does it or not), based on the conditions it specified in the build.



              I'm not sure if I understand what you are trying to do exactly tho.
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                • 1251 ☆ A M B ☆
                • 45 Posts
                So... Examples.

                I created site via MODx. I downloaded some extras (getResources, getPage and others). It is extras, that I needed and that help build the site. But for my specific task I created some snippets (custom snippets) and I want save it to file (static elements). I want see only my elements, without elements from installed packages (getPage, etc.).

                Well... I see it as a filter, that allow select only my custom (created by me) elements. I don't want save elements to files, that I not will change.

                I write the Static Element Manager and this filter needed for better control of elements.
                  Alroniks experts
                  MODX Ambassador | MODX Professional

                  alroniks.com | [email protected] | +375 33 638 10 92 (Belarus)
                  Facebook | Twitter | VK.com
                  • 18373 ☆ A M B ☆
                  • 3,141 Posts
                  Well there's no specific relation right now, so while it's a feature request you can file in the tracker, that wont help you now tongue

                  For now, perhaps there's something you can do with categories, or the static value for elements which indicates it's a static element or not..
                    Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                    Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                    • 3749
                    • 24,544 Posts
                    Maybe I'm misunderstanding you, but normally, you'd have a name (namespace) for your extra (let's call it mycomponent) and put the objects in a category with the same name so they will be easy to find and store the files something like this:

                    core/components/mycomponent/elements/snippets/mysnippet.snippet.php
                    core/components/mycomponent/elements/chunks/myhunk.chunk.html

                    For files that need to be accessed via URL (e.g., CSS and JS), you'd do this:

                    assets/components/mycomponent/css/mycomponent.css
                    assets/components/mycomponent/js/mycomponent.js


                    Almost all MODX extras do it this way.


                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html
                      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
                      • 1251 ☆ A M B ☆
                      • 45 Posts
                      Thanks for reply!

                      Relation to package need for me for check all elements in system. Namespace is allow only for extras and files in this extras, but elements (chunks, snippets) not have relation to package.

                      Currently rigths @gallenkamp. MODx save zip-archive and folder with code to /core/packages and if package assembled correctly then I can read list of elements from _build/data/transport.chunks.php for example. I think it it right way currently. It would be nice if the elements could refer to the parent packages.
                        Alroniks experts
                        MODX Ambassador | MODX Professional

                        alroniks.com | [email protected] | +375 33 638 10 92 (Belarus)
                        Facebook | Twitter | VK.com