We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1453
    • 17 Posts
    I come from the enterprise content management world. I am having some trouble understanding how do I define custom content types in Modx.

    Or, is it that there is no need to defining custom content types in Modx?

    Thanks.
      • 21246
      • 55 Posts
      Tools -> Configuration -> Site tab.

      Custom content types:

      Add custom content types for Resources. To add a new entry, enter the content type in the text box then click the ’Add’ button.


      The question is what are you trying to accomplish. That would help us frame the response.
        • 1453
        • 17 Posts
        I meant custom content types like:


        • Newsletter
          Product
          Article
          Event
          Organization

        I am confused about how Modx helps define content types. Or, is there no need to define content types in Modx?


        Here is the situation that I am trying to solve:

        I have a website that provides a searchable directory of churches, schools, organizations. All this data is nicely populated in our database. Now, we need to provided a system that allows users to attach documents, images, articles, reviews, and events -- to each one of these churches, schools, etc.

        Basically, each school needs to manage its own content. We will allow school staff to have admin accounts to manage their own content.

        The list of churches/schools/organizations is over 3000 records in our database. I am wondering whether I need to convert that into Content Types in Modx. I would rather not do that. I would rather keep this data in our database and provide some kind of hooks to related content (images, documents, articles, reviews) using some sort of tags or lookup IDs. Is that possible?

        I highly appreciate your advice/recommendations.
          • 1453
          • 17 Posts
          Could someone please help answer my question.
          Thank you very much.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Usually this sort of thing is done in one (or more!) of two ways; the tree structure itself organizes the documents into a structure, and the menus generated will reflect that structure; the top-level documents would be named according to your types, with the corresponding documents as their children.

            The other way is to have a TV, probably a select drop-down, and the TV is used to give the document its desired type.

            There are a number of ways of filtering on the TV when listing documents by type.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 24935
              • 160 Posts
              A newsletter may have a different page layout/different blocks of information that a product. So in MODx you can create a template for each "page type." Each template can have a different set of fields (custom fields), so it is similar to a "content type" in other systems. Just name your templates Newsletter, Product, etc. When you create a new page, you can select the template.

              It would be easy to pull your data from the database with a custom snippet--just a little bit of PHP coding.

              With the number of documents you will be creating, you should build the site in MODx Revolution. Certain parts of MODx Evolution get somewhat slow on a site with more than about 5000 documents.
                • 1453
                • 17 Posts
                Quote from: sottwell at Aug 26, 2009, 01:39 AM

                Usually this sort of thing is done in one (or more!) of two ways; the tree structure itself organizes the documents into a structure, and the menus generated will reflect that structure; the top-level documents would be named according to your types, with the corresponding documents as their children.

                The other way is to have a TV, probably a select drop-down, and the TV is used to give the document its desired type.

                There are a number of ways of filtering on the TV when listing documents by type.


                Wonderful... Let me look into Template Variables (TVs).
                Thank you very much for your response.
                  • 1453
                  • 17 Posts
                  Quote from: rfoster at Aug 26, 2009, 09:55 AM

                  A newsletter may have a different page layout/different blocks of information that a product. So in MODx you can create a template for each "page type." Each template can have a different set of fields (custom fields), so it is similar to a "content type" in other systems. Just name your templates Newsletter, Product, etc. When you create a new page, you can select the template.

                  It would be easy to pull your data from the database with a custom snippet--just a little bit of PHP coding.

                  With the number of documents you will be creating, you should build the site in MODx Revolution. Certain parts of MODx Evolution get somewhat slow on a site with more than about 5000 documents.



                  This explains things a little better to me. Thank you very much.

                  Where do I define/declare the custom fields... Are the custom fields defined in the template or do I need to define them everytime I create a new page?

                  Thanks for recommending Revolution... Currently, I have about 3000 pages. The site is growing...

                  I am not planning to have all those 3000 pages show in any navigation menu. Do I still need to have all those pages entered as documents in Modx?

                  Here is are current design thoughts:
                  I would have a search page that would be a non-Modx document -- basically a simple PHP script. That results of the search would list the matched schools and then provide a link to see the school details page. Could I have one generic template for a school. Then, I could pass the school ID to be fetched from the database and show the page using the template. Then, I would want to have documents, images, comments associated to this school. I would like Modx to manage and associated the documents, images and comments for each school. (where the school itself is not a Modx document.)

                  Is this a possible approach?
                  (I seem to be heading to a plain Smarty template approach. But, I really want to use Modx because it offers many other features.)

                  Thanks.
                    • 4172
                    • 5,888 Posts
                    I have a website that provides a searchable directory of churches, schools, organizations. All this data is nicely populated in our database. Now, we need to provided a system that allows users to attach documents, images, articles, reviews, and events -- to each one of these churches, schools, etc.

                    I think I would store all these datas in own database-tables. Organization with Organization-Datas, and the tables for documents, images, articles, events and so on with foreign-keys to the organization-table.

                    Then ,I think ,I would create only one modx-page for each type Organization-Data, documents, image-galleries, articles, events and so on.

                    ON each of these pages on the top or an js-popup one snippet for your searching and filtering. Store the filtering in a session-var.
                    then in the content on each of these pages you can place a snippet which lists all needed datas for the filtered school/church. Perhaps, if one admin of the actual filtered school is logged in, can edit and add datas directly on these pages.

                    I used allways my snippet xett for these sort of things. At my last project I was using the next generation of xett. It is still in development and is named blox in combination with our ajax-frontend-editor xedit, but works allready very well on my last project. (Complete Organization of an rowing-regatta).
                    It can list each type of data which can be stored in nested arrays. you can create different projects with different tasks for each project. Each task can have its own templates (chunks) and so on.
                    Perhaps it is worth to try it and develop it further for your project.

                    cheers
                    Bruno

                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!