We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36562
    • 94 Posts
    I was thinking about developing something cause i feel i need it, but first i would like to hear if there is something else like this out there already. Or if anyone think it would be interesting for them as well.

    What i would need:


    • When logging in as a special user - lets say admin - the plugin starts.
    • The plugin looks in a named folder - maybe a media source.
    • It starts at level one, adding that folder name as a category in modx.
    • Any .html file in that folder it adds as a static chunk into the database. Then if there is a folder inside this folder, it adds a new subcategory and then looks inside this folder for html files. It would do the same for snippets.

    I think it would a great way of not having to add chunks manually to the database through the modx. Doing that steal alot of time from me as a developer.

    I would also like a function where i could list all chunks/snippets that are static and uncheck them. Instead of having to open each chunk/snippet and do it that way.

      --------------------------------------
      www.williamastrom.se
      • 3749
      • 24,544 Posts
      I think that would be better as a utility snippet or a Custom Manager page rather than a plugin. I don't think it would be too difficult to write, but I'm not sure how many people would use it. IMO, most people are not adding all that many new chunks.
        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
        • 36562
        • 94 Posts
        I know customers aren't. But when i am developing projects i like to have static snippets and chunks to work on.

        When setting up a website, there are always many chunks to create or overwrite. Just for a blog you need chunks for LatestPosts, Tag, ArticleRow, Archive Row, and so on. If they were already static or being created so i could more easily and fast update them with sublime or such external software. I always keep static templates, snippets and chunks cause when doing a lot of development and designing - editing these in the manager will end up cost me a LOT of time.

        So it would better from my point of view to stay out of the manager as much as possible. [ed. note: DesignByWilliam last edited this post 13 years, 6 months ago.]
          --------------------------------------
          www.williamastrom.se
          • 4172
          • 5,888 Posts
          many snippets have something like &tpl=`@FILE here/goes/your/file`
          see getResources:
          http://rtfm.modx.com/display/ADDON/getResources

          when I'm building complex pages with lots of custom-coding I use bloX, where I can have a structured way to organize all needed chunks in the file-system.

          Sorry, still not lots of documentation for bloX out there.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 36562
            • 94 Posts
            Thanks for you answer. Have never seen blox - will look it up.

            But if i do define a tv that way, there is no way to allow the end client to be able to access easily through the manager if necessary unless i create the chunk and point it to the static file.

            Will have a look at blox tonight! [ed. note: DesignByWilliam last edited this post 13 years, 6 months ago.]
              --------------------------------------
              www.williamastrom.se
              • 40045
              • 534 Posts
              Erm, see the fantastic ElementHelper Plugin here: https://github.com/roryg/ElementHelper if I don't understand you completely wrong, this is exactly what you're looking for...I really like it!

              Also see my pull requests in that repo (a bit a mess yeah) but they add Usergroup check (to not run it on any logged in usergroup) and caching (bc it really makes manager/page slow when having a lot of static files in the folders)...
                • 36562
                • 94 Posts
                The description sounds very promising! Ill check it out!
                  --------------------------------------
                  www.williamastrom.se
                  • 3749
                  • 24,544 Posts
                  FYI, ElementHelper is available via Package Manager, though you might not get the pull requests that way.
                    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
                    • 36562
                    • 94 Posts
                    Yeah, got it and it works well! Also, my statement above regarding categories are wrong. They are created!

                    Ill save some time now:) I also saw Bob had released mycomponent. Gotta have a look at that. Could save me even more time. And if it does, ill ship you some $:) Seems like a lot of work into that one!
                      --------------------------------------
                      www.williamastrom.se
                      • 3749
                      • 24,544 Posts
                      Quote from: DesignByWilliam at Apr 16, 2013, 02:53 PM
                      I also saw Bob had released mycomponent. Gotta have a look at that. Could save me even more time. Seems like a lot of work into that one!

                      Yes, a little. wink
                        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