Copied to clipboard

Flag this post as spam?

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


  • Damien Holley 81 posts 269 karma points
    1 week ago
    Damien Holley
    0

    Display background-image in Block preview

    Hi, I do not wish to override the in-built controller for blocks, but I am having trouble displaying an image in the background of the block.

    I can get the umb://media/ data from block.data.background, but there seems to be no reference anywhere as to what resources are included by default.

    So I need to know how to get the img url using the umb: path, from within the blocks controller.

    like I said above, I do not want to mess-up the in-built controller for blocks by including extra controllers as I can get the simple data inbuilt and do not want to re-invent the wheel or end up with spaghetti-code that is painful to maintain and may break with an update.

    Example:

    <button type="button" ng-click="block.edit()" ng-style="{'background-image':'url('{{block.data.background}}')'">
    <img ng-src="{{block.data.background}}" />
    <div style="width: 100%; display: block; height: 200px; width: 200px">
        <h3 ng-bind="block.data.title"></h3>
        <a ng-bind="block.data.pageLink"></a>
    </div>
    

    pagelink is a content item picked by the content picker.

  • Damien Holley 81 posts 269 karma points
    1 week ago
    Damien Holley
    0

    any response on this?

  • Tito 276 posts 467 karma points
    1 week ago
    Tito
    0

    I am having the same issue, and looking forward an indepth blog post about the subject. On the release blog post they said will be a blog post about block editor in about 1 week after the release, so it must be near...

  • Damien Holley 81 posts 269 karma points
    4 days ago
    Damien Holley
    0

    unfortunately they seem to say there will be something covering this all the time then never do. I guess we'll have to wait and see.

Please Sign in or register to post replies

Write your reply to:

Draft