We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17930
    • 81 Posts
    I created a new Content Type and I want that to be the default for new documents, so I don’t have to remember everytime to go to Page Settings and change it.

    Is there a system setting in Modx Revo that I can change to modify the default Content Type?

    I tried looking, but couldn’t find anything. Maybe I just missed it.
      • 22757
      • 41 Posts
      I don’t think there is.

      But maybe another idea:

      Go to form customization and a rule there. I could image core - document/create, field: content-type, value: yourcontenttype would work.
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        I would probably be lazy and just modify the text/html one, lol.

        If there’s no option for this (and I can’t remember any though I didn’t check) this could be worth a feature request.

        Could you file that at bugs.modx.com?
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 17930
          • 81 Posts
          Suggested and filed.

          However, it did work to change the HTML content type to /. But I would have never thought of doing that. Plus, if I want several docs I’m working on to be one content type and then several others I create later to be another, that wouldn’t work.

          I am having a hard time understanding the form customization. I can’t figure out how to make fields required. (Plus, I’m not even sure I understand what you typed.)
          core - document/create, field: content-type, value: yourcontenttype
            • 22757
            • 41 Posts
            Sorry for the late answer. I don’t think you can make fields required with that form customization feature.

            To my answer: With the form customization you can define some rules to be executed on certain events. I posted a rule that should work in your case (in a short version though). So your rule will be:

            Action: document/create (when a new document is created)
            Group: - (should apply to all)
            Description: whatever you want. just for your own understanding.
            -----
            Name: name your rule here.
            Containing-Panel: The name of the containing panel that the Field is in.
            Rule: Field-Defaultvalue
            Value: MyContent/Type

            Leave the constraints empty and check the active checkbox.
              • 17930
              • 81 Posts
              I think I understand that now. (We’ll see though, when I actually try to do something.)

              So then is there a way to make fields required?
                • 6437
                • 157 Posts
                Interesting solution to setting a default content type patman, thanks.

                Any ideas how you could use this per context? I’m probably missing something but is there a way to assign specific set of form customisation rules to a individual contexts?

                DM
                  • 17930
                  • 81 Posts
                  @DangerMouse1981
                  Yes there is. As well as what I was trying to do earlier, is workable through the Form Customization.

                  For per Context:
                  - Create or modify a Form Customization Profile and then a Set
                  - I think this would be best on 'Create Resource'
                  - After you get to the specific Set that you want to add or modify, put the following in the proper field

                  Constraint Field: context_key
                  Constraint: the_name_of_the_context

                  Mine looked like this-
                  Constraint Field: context_key
                  Constraint: mobile



                  Then for what I was trying to do with a default content_type for that specific Context, scroll down and put your default value in. You can use the content_type written out, such as I did HTML - (blank), or you can go into your database and find the content_type id and use that. Now save.

                  (You can use this same idea for making each Template have a different default content_type.) [ed. note: mafokken last edited this post 14 years, 9 months ago.]