Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • rasb 162 posts 218 karma points
    Jan 19, 2010 @ 16:09
    rasb
    0

    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

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jan 19, 2010 @ 16:14
    Thomas Höhler
    0

    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

  • Paul Blair 466 posts 731 karma points
    Jan 19, 2010 @ 19:43
    Paul Blair
    1

    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...

  • rasb 162 posts 218 karma points
    Jan 19, 2010 @ 22:05
    rasb
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft