Copied to clipboard

Flag this post as spam?

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


  • andrew shearer 380 posts 485 karma points
    Aug 11, 2019 @ 20:21
    andrew shearer
    0

    Macro Parameter Editor in umbraco 8

    Hi

    I am trying to add a Macro Parameter Editor in umbraco 8.1.1 so that I can use the Multi Url Picker in a macro

    I followed https://our.umbraco.com/documentation/Extending/Macro-Parameter-Editors/ (NB which isn’t verified for umbraco 8 yet) and the picker appears in the macro, it just doesn’t save anything? Would this be a known issue in umbraco 8?

    Also as a side question, does the umbraco 8 work mean there is now opportunity for all of the core datatypes to be available for macro parameters without the need for the above?

    Thanks

    Andrew

  • andrew shearer 380 posts 485 karma points
    Aug 11, 2019 @ 20:23
    andrew shearer
    0

    package.manifest so far:

    {
    "css": [
        "~/App_Plugins/CustomCss/custom.css"
    ],
    "propertyEditors": [
        {
            "alias": "MyCustom.Umbraco.MultiUrlPicker",
            "name": "Macro Multi Url Picker",
            "isParameterEditor": true,
            "editor": {
                "view": "~/umbraco/Views/propertyeditors/multiurlpicker/multiurlpicker.html"
            }
        }
    ]
    

    }

  • andrew shearer 380 posts 485 karma points
    Aug 13, 2019 @ 19:54
    andrew shearer
    0

    Just tried a 8.1.2 update but the macro datatype is still not saving

  • Claude Häberli 3 posts 73 karma points
    Sep 17, 2019 @ 09:41
    Claude Häberli
    0

    Currently i have the same Problem. But I am enabling MacroParameter PropertyEditors in a different way. I add a class like this

    [DataEditor(Constants.PropertyEditors.Aliases.MultiUrlPicker, EditorType.MacroParameter,
            "Multi URL Picker", "MultiUrlPicker", ValueType = ValueTypes.Json, Group = "media", Icon = Constants.Icons.MediaFile)]
    public class MultiUrlPickerPropertyEditor : DataEditor
    {
        public MultiUrlPickerPropertyEditor(ILogger logger)
            : base(logger)
        { }
    
        protected override IConfigurationEditor CreateConfigurationEditor() => new MultiUrlPickerConfigurationEditor();
    }
    

    First i thought that it was because of the wrong ValueType (was initially set to string) but still not working.

    I managed to make other PropertyEditors successfully available like RichTextEditor or MultipleMediaPicker.

    Any help would be appreciated.

  • andrew shearer 380 posts 485 karma points
    Sep 17, 2019 @ 23:19
    andrew shearer
    0

    hi Claude

    Can i ask where that class approach code sample is from, umbraco documentation?

    My approach is currently based on https://our.umbraco.com/documentation/extending/macro-parameter-editors/ however that is still not "verified for umbraco 8" so i might be doing it incorrectly. The editor appears fine in the backoffice, it just doesn't save anything.

    I'm just looking for a way to use the core property editor "Multi Url Picker" as a macro parameter :)

  • Claude Häberli 3 posts 73 karma points
    29 days ago
    Claude Häberli
    0

    Sorry, i can't tell yoi where i found it. It was maybe stackoverflow not in the docs. When i am back from holidays i try to find it again.

  • Russell 5 posts 75 karma points c-trib
    21 days ago
    Russell
    0

    I had the same issue of wanting to use MultiUrlPicker as a Macro Parameter.

    I've gone a little bit further by copying multilinkpicker.controller.js to make my own property editor.

    With a few console.log I found that $scope.$on("formSubmitting"... does not fire in the Macro context and so $scope.model.value = $scope.renderModel never happens.

    I changed my copy of multilinkpicker.controller.js to set $scope.model.value every time $scope.renderModel is set E.g.

    $scope.renderModel.push(link);
    $scope.model.value.push(link); // My code
    

    It works.

    There may be a fault in Umbraco? In any case I'm somewhat surprised that the MultiUrlPicker isn't available as a Macro property in base Umbraco (as at version 8.1.5)

Please Sign in or register to post replies

Write your reply to:

Draft