We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21946
    • 283 Posts
    can you give me a link explaining how i can do that ? i created a snippet yesterday, but i did not find how to put the chunk in a file rather than creating it in database via UI. How tell to modx where he can find the chunk ?
    And how to you proceed concerning templates when developping ? include snippet ?

    edit : i have no choice between file or database if i am overriding a tpl of GetRessources for example : i can’t do this with a file, i need to create a chunk in the database via UI (am i wrong ?)
      [url=http://www.savepoint.fr/index.php?id=38] -petits tuyaux pour les d
      • 25663 MODX Staff
      • 12,272 Posts
      Quote from: nyl at Sep 26, 2010, 05:58 AM

      I read this sentence from the page you just gave me :

      "MODx, however, stores its data in the database. This has many benefits generally,"

      what benefits ? That’s the point, i can’t see the benefits of putting html and php in database. But i would like to hear from modx ninjas the benefits of that approach.

      There are some benefits in that once a site is installed, you don’t need access to an FTP program or SSH connection to update your site. You could be in a library without your development machine or on an iPad for that matter and make changes. Then there’s the argument for clients editing or creating chunks to be used in their sites. You either teach them FTP or an error-prone process (go to the File Browser, navigate to this location, create a file, remember it’s name, etc.) vs "press the new Chunk button" and "drag and drop the Chunk into the content area".

      It’s not ideal in all situations, but it’s not without merit. With teams accustomed to IDEs and SCM-based workflows, it definitely will leave much to be desired. MODx excels at easily templating HTML/CSS designs and getting them into a place where you can easily create new pages, fast. That being said, we’re always working on improvements and you’ll see it getting better with each release.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 25663 MODX Staff
        • 12,272 Posts
        Quote from: nyl at Sep 26, 2010, 08:31 AM

        i have no choice between file or database if i am overriding a tpl of GetRessources for example : i can’t do this with a file, i need to create a chunk in the database via UI (am i wrong ?)

        Every Snippet developer can choose to implement how they handle output templates (through chunks in the database, chunks on the file systme, config files, property sets, hybrid approaches, etc.). Some use the filesystem and can be overridden without breaking upgrades, some can’t. It’s up to each individual developer, and there’s really been no standardization on this front, or really a solid "best practices" recommendation. That being said, hopefully a couple of devs will chime in and explain specifically how they handle creating output templates and how those would work with upgrades when overridden chunks stored on the filesystem are used (if it’s possible at all for those specific Snippets).

        With more complex Snippets like Quip, this really does matter. I think it makes sense to talk about the pros and cons with the various approaches, and come up with output templating recommendation for both simple and complex Snippets.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 21946
          • 283 Posts
          Wow, thanks for all those answers smiley

          With more complex Snippets like Quip, this really does matter. I think it makes sense to talk about the pros and cons with the various approaches, and come up with output templating recommendation for both simple and complex Snippets.

          my two cents : Sounds more logical to me not to be allowed to edit default files as they are ... default files. I prefer having an override in my template folder or in the manager, rather than having to go in "/core/components/quip/elements/chunks/chunkname.tpl" to find a part of my template.
            [url=http://www.savepoint.fr/index.php?id=38] -petits tuyaux pour les d