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.
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.
-
☆ 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?
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.
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?
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
@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.]