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";
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
Found out that the grid called a parent class. So the solution was to change the name of the class
is working on a reply...