I have a Document Type called Content, and then I have a Document Type called News Item. News Item has Content as a Master Document Type. It is basically a Content node with a Date appended.
The Content Document Type the property umbracoNaviHide. This property is false (unchecked) by default. This is fine for the Content Document Type, but I would like for this to default to true (checked) for the News Item Document Type.
Another option is to change the syntax of your property so the default value (false) represents the actual default value you require.
In this case you could name the property umbracoNaviShow.
This will depend on what you want to do with the rest of the document types. It would pay to keep this field consistent accross the site otherwise your XSLT mgiht get out of hand...
That looks like the way to go about it. I am going to take a closer look at that. I would like to be able to set a default value in the Umbraco admin dashboard, but if I can do it like this it is cool enough.
I would like to also be able to see inherited properties on a Document Type... and again set default values ;-)
@ Paul, I could do that if I only wanted one default behaviour. But I want one behaviour for the master document type, and another for an inherited type.
Default value of document type properties
Hi Guys,
I have a Document Type called Content, and then I have a Document Type called News Item. News Item has Content as a Master Document Type. It is basically a Content node with a Date appended.
The Content Document Type the property umbracoNaviHide. This property is false (unchecked) by default. This is fine for the Content Document Type, but I would like for this to default to true (checked) for the News Item Document Type.
Is this possible?
Thanks,
RasB
Yep, you create an own action handler that sets the value after creation. See here: http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events
hth, Thomas
Another option is to change the syntax of your property so the default value (false) represents the actual default value you require.
In this case you could name the property umbracoNaviShow.
This will depend on what you want to do with the rest of the document types. It would pay to keep this field consistent accross the site otherwise your XSLT mgiht get out of hand...
Hi Thomas,
That looks like the way to go about it. I am going to take a closer look at that. I would like to be able to set a default value in the Umbraco admin dashboard, but if I can do it like this it is cool enough.
I would like to also be able to see inherited properties on a Document Type... and again set default values ;-)
@ Paul, I could do that if I only wanted one default behaviour. But I want one behaviour for the master document type, and another for an inherited type.
Thanks for your input guys,
RasB
is working on a reply...