We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7231
    • 4,205 Posts
    I wonder if the import, export and site folders are needed in the assets? I have never used them and it seems that if I needed to use them I could create them or they could be created programmaticaly.

    I also question the templates folder? I think that this leads people to develop in one way (putting all of the files int he templates folder) which is not necessarily the ideal way to develop in modx. By insinuating that you should use the templates folder you are encouraging a bad, or at least not best, practice.

    Finally there should be a css folder in the assets. IMO this would allow for the default method to be to "develop as you would any site" which is one of modx’s strong points rather than the default method being the templates folder.

    I see that this has been restructured in Revolution, would it be a good idea to streamline this in 096x as well?
      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

      Something is happening here, but you don't know what it is.
      Do you, Mr. Jones? - [bob dylan]
      • 27708 MODX Staff
      • 2,502 Posts
      @dev_cw,

      Why do you say that putting template files into the templates folder is not a best practice? I use it because it makes the way I organize files easier to manage. If I have multiple templates for a project I don’t need to pull them out of a bunch of folders under assets, I can just grab the parent folder under assets/templates and be done with it.

      The import/export dirs can go though.

      Cheers,

      Jay
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: smashingred at Oct 18, 2008, 03:59 PM

        The import/export dirs can go though.
        They need to stay IMO for now, as we would have to set the entire assets directory writable to allow auto-generation of those folders in the import and export processes. They can go if someone wants to rewrite those processes to allow selection of the import and export locations as appropriate in each process, or otherwise refactor them to warn if they don’t exist...
          • 7231
          • 4,205 Posts
          OK. Good points.

          @Jay; I think it is acceptable to use the template folder. However I think it is a better practice to treat the modx site as you would any other site by building it from the root rather than from the templates folder. And since anyone could add any folder to assets to accomodate their needs, this would make it ’up-to-you’ to use templates rather than the default method.

          Personally, I no longer use the template folder. I just don’t like the paths going to the ’template’ directory (that is so YAPS). However at first it seemed like this was the way it needed to be since the wiki post, demo site and other documentation lead you to believe this to be true. Now I have gone back to my method from before stating with modx, which is building from the root. For me it would have made it easier to learn the concept if it was more like a standard website rather than approached as a template. Also you can put template files anywhere, they do not need to be in the templates folder.

          At least by adding a CSS folder (there is a js folder so why not a css folder) it would be more clear that you have options and that using the templates folder is just one of the choices available.

          IMO by approaching it from a standard website development approach would be more true to the freedom that modx represents and break further away from the YAPS concepts.

          The reason I bring this up is that I have been doing quite a bit of freelancing on existing modx sites and am amazed to see the mess that is made with the templates folder. This leads me to think that it is not clear how to do things and developers are guessing where to place their files and are having to do all sorts of odd things to get them to work right.

          Anyway, this is not really important at this point since Revo has a new approach. But it may be worth considering the method that will be documented (will using the templates folder be the official method?).
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 25663 MODX Staff
            • 12,272 Posts
            I agree that Evo should be more in sync with Revo’s conventions. I am with Shane on the templates directory: nuke it. I always am a fan of putting CSS files loose into the assets directory with no wrapper directory (keeps calls to images in the CSS shorter). In fact, I’d be more inclined honestly to nuke most of the folders and make them configurable on a per-client basis. This of course means that we need a new image browser, which I’m really looking forward to too. MCPuck has been good, but certainly caused it’s share of headaches. If we had a less restrictive image/file browser, I’d be a fan of a structure like the following:

            For add-ons and helper libraries that don’t need to be accessed by anyone but developers:
            inc/
                config.inc.php (make for easier "core" upgrades)
                chunks/
                manager/ (manager overrides and customization)
                    help/ (custom manager help pages)
                    login.html
                    welcome.html
                modules/
                phpthumb/
                plugins/
                snippets/
                etc.
            


            For site resources, and for setting the file browser "root" ... end-users play in this directory:
            site/ (fewer bits!) 
                site.css (css files loose in site, though I could see a "css" directory too)
                i/ (images)
                js/
                etc.
            


            In a similar fashion, I wouldn’t mind seeing the export/import stuff moved to add-ons, since they’re fairly infrequently used. For those those that need them I suspect that they wish there were some tweaks to allow them to be improved upon such as supporting friendly URL paths. It’d be easy to include instructions to create those directories and make them writable. (This one is probably not worth messing with right now...)


              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 22303 MODX Staff
              • 10,725 Posts
              I am not on board with this one; the templates folder is a perfectly valid "best practice" for creating, well, templates, and being able to easily switch between them. I am not a fan of loose CSS files, and prefer them to be organized along with the template that is using them, either in a common location or specific to a particular template.

              We do not, and will not, prescribe ways users will organize their own code though, and definitely will not promote putting everything in the root directory. We can provide suggestions and examples as we do currently, but that’s as far as we need go IMHO, and sometimes, even that’s too far without the proper disclaimers, making folks think this is the way it has to be.
                • 25663 MODX Staff
                • 12,272 Posts
                The templates directory was originally put in place when we thought it was a good idea to include multiple "demo templates" with the demo content. A goofy idea in retrospect.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 7231
                  • 4,205 Posts
                  The template concept and the template folder are cool. But they do dictate a certain method of development that are not entirely related with the modx freedom concept. I don’t think that they should be forbidden, but I question if they should be the default method?

                  Embedding the export/import folders to take them out of the standard view is interesting.
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don't know what it is.
                    Do you, Mr. Jones? - [bob dylan]
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: rthrash at Oct 20, 2008, 10:29 AM

                    The templates directory was originally put in place when we thought it was a good idea to include multiple "demo templates" with the demo content. A goofy idea in retrospect.
                    I don’t necessarily think it’s goofy; it shows a very concrete example of how one can organize something like that using MODx.

                    Quote from: dev_cw at Oct 20, 2008, 11:13 AM

                    The template concept and the template folder are cool. But they do dictate a certain method of development that are not entirely related with the modx freedom concept. I don’t think that they should be forbidden, but I question if they should be the default method?
                    Exactly; the problem with the Evo scenario is that all of the "resources" required to include the "demo content" with the install need those areas to exist. Otherwise we have additional manual steps just to show off the system. We can either create new demo content that uses a different approach or work towards removing all add-ons and content from the Evo install and make people install them manually.

                    Quote from: dev_cw at Oct 20, 2008, 11:13 AM

                    Embedding the export/import folders to take them out of the standard view is interesting.
                    Making them add-ons is what Ryan suggested; but I do not see an easy way to make those things add-ons in Evo.