Copied to clipboard

Flag this post as spam?

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


  • Tony Pellegrino 2 posts 21 karma points
    Mar 24, 2015 @ 20:36
    Tony Pellegrino
    0

    Accessing Content Properties in Grid Controller

    My content has a "Featured Image" that I would like to use in a custom grid controller. So far, this is the only way I've been able to make it happen. 

    contentResource.getById(editorState.current.id)
    .then(function (content) {
        $scope.props = contentEditingHelper.getAllProps(content);
    
            var id = $scope.props[1].value;
    
            entityResource.getById(id, "Media").then(function (item) {
                $scope.control.value = item.metaData.umbracoFile.Value.src;
                });
    });

    There's got to be a simpler way, right? (preferrably one that doesn't make me hardcode an array index and drill through metadata to find an image url)

    I would like to do something like: 

    editorState.current.parentId.featuredImage.url;

    or

    $scope.parent.featuredImage.url;
Please Sign in or register to post replies

Write your reply to:

Draft