We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26642
    • 1 Posts
    Hi,

    I’m interested in learning about Modx for a project that has been offered to me; the project has already been "sold" on it being done with Modx; so I need to know a bit more about Modx before I can commit to it.

    I am a symfony developer and I’m basically trying to find Modx equivalents and just sort of understand it in a Symfony sort of way.

    There are a few things that I’d really like some clarification on.

    1. Object CRUD

    I’m glad to see that Modx has an ORM which looks similar enough to Doctrine which I am used to; Symfony has an admin generator which basically makes CRUD on any objects defined in the schema very easy; it auto generates the entire system and then allows overriding which ever parts are required.

    This allows you to get a listing of all the records in a table, click an edit link for one of them, be presented with an auto generated form for the structure of that object, containing the values of that row. You can then edit those values and press save, which updates that row.

    Is there any way to get a comparable CRUD interface in the manager on an object I have defined in the foo.schema.xml?


    I would also just like to ask a question for official clarification:

    From what I’m seeing; templates are stored in the database, not on the file system (Except as tpls; ready to be copy and pasted into the manager). I manage my projects with SVN or Git so that I can easily track changes between templates etc. This is obviously not possible if the template is stored in the database.

    Is there any way to make Modx read templates straight from a file/s? Editing in an IDE and then copy and pasting into the manager each time (as well as keeping another copy in a file for versioning) strikes me as a roundabout way of doing it. It would be great to have the option of doing one or the other.

    thanks for your help!
      • 5689
      • 289 Posts
      I’ve never used Symphony and can’t help in that respect, but this is important:

      Judging by "I’m glad to see that Modx has an ORM", you’re talking about MODx Revolution. A while ago, MODx split into two branches, Evolution (the original code, versions 1.x.x) and Revolution (the rewrite, currently version 2.0 RC3). Revolution is still in development and is currently in its third release candidate. I believe it’s pretty near a production release, but as of right now the team is not recommending using it for production sites (although many people have anyway, so it’s certainly possible). So, you should double check with those in charge of the project to see if they have Evolution or Revolution in mind. Revolution is far more powerful and is probably what you want, but keep in mind the fact that it’s not quite released yet. smiley
        I'm learning more about MODx all the time and loving it.
        • 27708 MODX Staff
        • 2,502 Posts
        Quote from: seniorsandwich at Jul 18, 2010, 08:56 AM

        Is there any way to make Modx read templates straight from a file/s? Editing in an IDE and then copy and pasting into the manager each time (as well as keeping another copy in a file for versioning) strikes me as a roundabout way of doing it. It would be great to have the option of doing one or the other.

        You can use templates on the filesystem if you want but simply creating a template record and placing an include snippet call in the template content area. See this article on Managing Resources and Elements in Version Control: http://svn.modxcms.com/docs/display/revolution/Managing+Resources+and+Elements+via+SVN
          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: seniorsandwich at Jul 18, 2010, 08:56 AM

          I am a symfony developer and I’m basically trying to find Modx equivalents and just sort of understand it in a Symfony sort of way.

          There are a few things that I’d really like some clarification on.

          1. Object CRUD

          I’m glad to see that Modx has an ORM which looks similar enough to Doctrine which I am used to; Symfony has an admin generator which basically makes CRUD on any objects defined in the schema very easy; it auto generates the entire system and then allows overriding which ever parts are required.

          This allows you to get a listing of all the records in a table, click an edit link for one of them, be presented with an auto generated form for the structure of that object, containing the values of that row. You can then edit those values and press save, which updates that row.

          Is there any way to get a comparable CRUD interface in the manager on an object I have defined in the foo.schema.xml?
          We do not have automatic admin interface generation (yet) in MODx Revolution, but it is fairly easy to build a powerful management interface for your data.

          Quote from: seniorsandwich at Jul 18, 2010, 08:56 AM

          I would also just like to ask a question for official clarification:

          From what I’m seeing; templates are stored in the database, not on the file system (Except as tpls; ready to be copy and pasted into the manager). I manage my projects with SVN or Git so that I can easily track changes between templates etc. This is obviously not possible if the template is stored in the database.

          Is there any way to make Modx read templates straight from a file/s? Editing in an IDE and then copy and pasting into the manager each time (as well as keeping another copy in a file for versioning) strikes me as a roundabout way of doing it. It would be great to have the option of doing one or the other.
          Generally, MODx is designed to separate the designer and developer roles and help separate presentation and logic as a result, so it is expected that designers would be modifying markup in the templates, chunks, template variables, etc. in many cases while developers provide configurable components that provide a way for the designers to completely define the markup the components produce separately. That said, you can absolutely use a Snippet (in MODx this is where executable PHP goes) to include content as a template, and many people do that. This would allow you to put your content under version control. Be aware though that you still won’t have the metadata for the site structure, etc. in your source control system and you can potentially lose some of the benefits of the default partial page caching system when you do this (depends on your environment and how you approach caching in the site implementation tbh).

          For component development ideas (this is what we do keep in source control systems FWIW), see the tutorials at http://svn.modxcms.com/docs/display/revolution/Tutorials. In particular you can review http://svn.modxcms.com/docs/display/revolution/Managing+Resources+and+Elements+via+SVN. http://svn.modxcms.com/docs/display/revolution/Getting+Started+Developing and http://svn.modxcms.com/docs/display/revolution/Creating+a+3rd+Party+Component+Build+Script may also be helpful to start understanding the philosophy and implementation of things in MODx Revolution.