Copied to clipboard

Flag this post as spam?

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


  • Roshan 6 posts 86 karma points
    Feb 22, 2023 @ 05:46
    Roshan
    0

    Accessing Block grid content block setting model value in custom view

    I'm working on an Umbraco 10.4 Block grid.

    I have replaced dropdown with content picker in the setting model.

    I'm having issue accessing the setting model value in the custom view

    {{block.settingsData.pickerAlias}} returns udi (umb://document/ad2cafd7aa884e52b3b0cd0ad7137182)

    Any possibilities to access node Name or Node Property alias value? I tried {{block.settingsData.pickerAlias.Name}} or {{block.settingsData.pickerAlias.titleAlias}} but It's not working. I can't find any documentation.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Feb 24, 2023 @ 19:23
    Huw Reddick
    0

    have you tried block.settingsData.pickerAlias[0].Name

  • Roshan 6 posts 86 karma points
    Feb 25, 2023 @ 04:09
    Roshan
    0

    Yes I tried but It's not working

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Feb 25, 2023 @ 10:15
    Huw Reddick
    0

    Hi Roshan,

    You need to inject contentResource into your angular controller and then you can do the following

            contentResource.getById($scope.block.settingsData.pickerAlias)
                .then(function(data) {
                    $scope.myPicker = data;
    
                });
    
  • Roshan 6 posts 86 karma points
    Feb 25, 2023 @ 17:15
    Roshan
    0

    Where to put this code? Could you please provide more details?

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Feb 27, 2023 @ 08:18
    Huw Reddick
    0

    do you have an angular controller to go with your custom view?

  • Roshan 6 posts 86 karma points
    Mar 01, 2023 @ 15:04
    Roshan
    0

    How to add controller to custom view?

    enter image description here

  • Marc Goodson 2155 posts 14406 karma points MVP 9x c-trib
    Mar 01, 2023 @ 17:54
    Marc Goodson
    100

    Hi Roshan,

    This explanation on this older issue might help point the way...

    https://our.umbraco.com/forum/using-umbraco-and-getting-started/103560-image-in-custom-block-editor-view

    Regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft