Copied to clipboard

Flag this post as spam?

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

  • Patrick van Kemenade 97 posts 325 karma points
    Jan 07, 2021 @ 14:04
    Patrick van Kemenade

    I'm creating a custompropertyeditor called buttonLink which I can use in a grid in Umbraco 8.9.1.

    So far I'm able to create one which looks good in the backend, meaning I can pick a content item, but when saving (or previewing) I see the selected vlaue is not stored/retainded. The other value "Button text" is stored.

    What do I need to change ?

    <div ng-controller="Positioner.LinkButtonController">
                Button text
            <br />
            <input type="text" rows="1"
                   class="umb-property-editor umb-textstring textstring"
                   umb-auto-focusclass="textstring input-block-level" ng-model="control.value.buttonText" placeholder="Button text" /><br /><br />
        <div class="linkbutton-row">
            <label>internal link: </label>
                <umb-property-editor model="contentPicker" ng-model="control.value.buttonLink"></umb-property-editor>
        .controller("Positioner.LinkButtonController", function ($scope) {
            $scope.contentPicker = {
                view: 'contentPicker',
                config: {
                    minNumber: 0,
                    maxNumber: 1
                value: $scope.model.value.InternalLink
    \linkButton.cshtml (I just want to see what is stored here ...)
    @inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
    @using Umbraco.Web.Templates
  • Marc Goodson 1775 posts 11810 karma points MVP 7x c-trib
    Jan 11, 2021 @ 21:09
    Marc Goodson

    Hi Patrick

    When you press save in the backoffice, then whatever the value of $scope.model.value is for your custom property editor, is the value that gets persisted to the database.

    So I'm not sure from the parts of the files that you have posted need to be updated, there is a gist here of using a Content Picker in a custom property editor:

    that might give you a bit of a steer...



  • Patrick van Kemenade 97 posts 325 karma points
    Jan 12, 2021 @ 21:18
    Patrick van Kemenade

    Thanks for your feedback and the example, tried it in Umbraco 8 but not much happening (can't even pick content) I'm afraid this is developed for Umbraco 7 and things changed a bit.

Please Sign in or register to post replies

Write your reply to: