Copied to clipboard

Flag this post as spam?

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


  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Dec 27, 2014 @ 18:59
    Biagio Paruolo
    0

    U6.2.4: error into Find attribute on image cropper datatype

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Dec 28, 2014 @ 10:47
    Biagio Paruolo
    0

    I tried other ways but I've empty string. 

    <img src="@dynamicMediaItem.GetCropUrl("umbracoFile", "320x613")" />

    I print out the crop value and I've XML value, but Find don't work.

     

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Dec 28, 2014 @ 11:11
    Biagio Paruolo
    100

    Workaround found.

    I found the problem. There is some bug into Umbraco.Media. It return a value that is not an image type.
    To solve I create a Macro in this manner and call it into partial view.

    Macro:
    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using umbraco.cms.businesslogic.media;
    @using umbraco.BusinessLogic;

        @{
                    string imageId = Convert.ToString(Model.immagineLateralePagina);
                 var dynamicMediaItem = Model.MediaById(int.Parse(imageId));
                }
                

    <img src="@dynamicMediaItem.crop.Find("@name", "320x613").url" alt="@imageId" title="@Model.Name"/>


    and then into partiel view:

    @Umbraco.RenderMacro("320x613")
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies