Copied to clipboard

Flag this post as spam?

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


  • MadsInovo 13 posts 84 karma points
    Aug 22, 2016 @ 10:40
    MadsInovo
    0

    Insert picture with Visual Studio

    Hello everybody.

    I am trying to figure out how to make the code I have to use to get an Image from Umbraco. I have made an ImagePicker. But to get that image in Visual Studio, I need some code.

    I have a banner where the picture is also in Umbraco aswell. Here I use this code to get the banner, which is working fine. But I cannot make my ImagePicker work with this code.

    Does anybody have an idea what I can do here?

    Best Regards Mads

    // Get topimage
        var topImageStyling = "";
        var hasImage = true;
        var page = pageAlias == "mylanding" ? CurrentPage.Parent : CurrentPage;
        string topImageValue = page.GetCropUrl("topImage", "topImage");
    
        if (!string.IsNullOrEmpty(topImageValue) && topImageValue.ToLower().Contains("/media/"))
        {
            topImageStyling = string.Format("style=\"background-image: url('{0}');\"", topImageValue);
        }
        else
        {
            hasImage = false;
        }
    
        // Page CSS-class
        var bodyClasses = pageAlias.ToString().ToLower();
        bodyClasses += hasImage ? "" : " no-image";
    
  • MadsInovo 13 posts 84 karma points
    Aug 22, 2016 @ 13:22
    MadsInovo
    0

    Found out that the grid called a parent class. So the solution was to change the name of the class

  • 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