Copied to clipboard

Flag this post as spam?

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


  • Lennart Stoop 304 posts 842 karma points
    Dec 23, 2013 @ 16:33
    Lennart Stoop
    0

    Can property editor prevalues have a default value?

    Hi guys,

    I have added some prevalues to a property editor via the package.manifest as documented here:

    http://umbraco.github.io/Belle/#/tutorials/Adding-Configuration-To-Property-Editor

    Is there any way to add a default value which is then shown in the data type configuration by default ?

     

    Grtz

    L

  • David Zweben 268 posts 754 karma points
    Jan 02, 2014 @ 19:03
    David Zweben
    100

    I have only anecdotal experience to refer to here, but when I was testing my own property editor package recently, I noticed that when you include a Data Type in the package, any options you had entered in that Data Type will carry over when a user installs the package. This isn't a true default, because it will only carry over to that specific instance of the property editor, not every time a user creates a data type with that property editor, but it's better than nothing.

    Hope this helps,
    David Zweben

  • Lennart Stoop 304 posts 842 karma points
    Jan 03, 2014 @ 15:28
    Lennart Stoop
    0

    Hi David,

    From what I have read earlier (I think it was on Tim's blog) default values will be configurable in a future release.

    I haven't tried deploying the package just yet, so that's definitely good to know as in my experience one instance of the data type suffices in most cases :-)

     

    Thanks for that!

    Lennart

  • LP 5 posts 75 karma points
    Apr 06, 2016 @ 12:39
    LP
    0

    Any news in that topic since last time? I want my boolean prevalued to be populated with true. Already tried the following:

    "prevalues": {
        "fields": [
            {
                "label": "...",
                "key": "some-key",
                "view": "boolean",
                "value":  1
            }
        ]
    }
    
    "prevalues": {
        "fields": [
            {
                "label": "...",
                "key": "some-key",
                "view": "boolean",
                "value":  "1"
            }
        ]
    }
    
    "prevalues": {
        "fields": [
            {
                "label": "...",
                "key": "some-key",
                "view": "boolean",
                "value":  true
            }
        ]
    }
    

    Of course none worked. That wasn't surprising for the last one, since boolean has true/false mapped to 1/0

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Nov 02, 2016 @ 12:44
    Lee Kelleher
    0

    Hey LP, did you ever figure out how to get this to work? Curious about it myself.

    Thanks,
    - Lee

  • Bo Jacobsen 606 posts 2404 karma points
    Dec 06, 2017 @ 23:14
    Bo Jacobsen
    4

    In case anyone still wondering.

    "prevalues": {
        "fields": [
            {
                "label": "...",
                "key": "some-key",
                "view": "boolean"
            },
            {
                "label": "...",
                "key": "some-otherKey",
                "view": "textstring"
            }
        ]
    },
    "defaultConfig": {
        "some-key": "1",
        "some-otherKey": "Have fun"
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft