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 506 posts 653 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 506 posts 653 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 506 posts 653 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 9 posts 99 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 506 posts 653 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 9 posts 99 karma points
    Sep 19, 2019 @ 05:54
    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 11 posts 83 karma points c-trib
    Sep 26, 2019 @ 22:11
    Russell
    1

    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)

  • andrew shearer 506 posts 653 karma points
    Oct 30, 2019 @ 19:46
    andrew shearer
    0

    has anyone discovered a method for doing this in umb8 or should i create a bug in github? thanks

  • Claude Häberli 9 posts 99 karma points
    Nov 04, 2019 @ 07:47
    Claude Häberli
    0

    No, the only way seams to be the one that Russell explained. I think thats a bug.

  • Heather Floyd 604 posts 1002 karma points MVP 5x c-trib
    Dec 11, 2019 @ 19:32
    Heather Floyd
    0

    In case anyone is interested... I added a feature request:

    Macro Parameters in V8 - Any chance we can just use DataTypes? https://github.com/umbraco/Umbraco-CMS/issues/7319

Please Sign in or register to post replies

Write your reply to:

Draft