Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have this ... but the Height (@mediaItem.umbracoHeight) and Width (@mediaItem.umbracoWidth) is empty?ยด@mediaItem.umbracoFile is OK, I am using umbraco 4.7.2
@inherits umbraco.MacroEngines.DynamicNodeContext@{ @Html.Raw("<div id=\"s1\" class=\"pics\">") var parent = @Model.Up(); if (parent != null) { foreach (var item in parent.Children.Where("Visible")) { dynamic mediaItem = @item.Media("gmp_foto");
@Html.Raw("<div><img src=\"") @mediaItem.umbracoFile @Html.Raw("\" alt=\"") @item.GetProperty("gmp_title").Value @Html.Raw("\" Height=\"") @mediaItem.umbracoHeight @Html.Raw("\" Width=\"") @mediaItem.umbracoWidth @Html.Raw("\" /><center>") @item.GetProperty("gmp_title").Value @Html.Raw("</center><br>") if (item.GetProperty("gmp_galleriTekst").Value != "") { @item.GetProperty("gmp_galleriTekst").Value @Html.Raw("<br>") } @Html.Raw("</div>") } }
The wrong medie type (file) was used, and not "Image" in "media"
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to get image Height and Width
I have this ... but the Height (@mediaItem.umbracoHeight) and Width (@mediaItem.umbracoWidth) is empty?ยด
@mediaItem.umbracoFile is OK, I am using umbraco 4.7.2
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
@Html.Raw("<div id=\"s1\" class=\"pics\">")
var parent = @Model.Up();
if (parent != null) {
foreach (var item in parent.Children.Where("Visible")) {
dynamic mediaItem = @item.Media("gmp_foto");
@Html.Raw("<div><img src=\"")
@mediaItem.umbracoFile
@Html.Raw("\" alt=\"")
@item.GetProperty("gmp_title").Value
@Html.Raw("\" Height=\"")
@mediaItem.umbracoHeight
@Html.Raw("\" Width=\"")
@mediaItem.umbracoWidth
@Html.Raw("\" /><center>")
@item.GetProperty("gmp_title").Value
@Html.Raw("</center><br>")
if (item.GetProperty("gmp_galleriTekst").Value != "") {
@item.GetProperty("gmp_galleriTekst").Value
@Html.Raw("<br>")
}
@Html.Raw("</div>")
}
}
The wrong medie type (file) was used, and not "Image" in "media"
is working on a reply...