I've got a macro that lists MediaPicker items associated with a Member Type (listed below). I need to output the Node Name of any media. The the moment <h3>imageItem.name</h3> just outputs the text imageitem.name not the media item title - any ideas what I need to change this too to display the media item name?
Thanks
Darren
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using System.Web.Mvc.Html
@using ClientDependency.Core.Mvc
@using Umbraco.Web
@using Umbraco.Web.Controllers
@{
var profileModel = Members.GetCurrentMemberProfileModel();
Html.EnableClientValidation();
Html.EnableUnobtrusiveJavaScript();
Html.RequiresJs("/umbraco_client/ui/jquery.js");
Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js");
Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js");
var success = TempData["ProfileUpdateSuccess"] != null;
}
@Html.RenderJsHere()
@if (Members.IsLoggedIn() && profileModel != null)
{
using (Html.BeginUmbracoForm<UmbProfileController>("HandleUpdateProfile", null, new { id = "updateProfileForm" }))
{
var member = Members.GetByUsername(profileModel.UserName);
if (member.HasValue("documentsMember"))
{
var imagesList = member.GetPropertyValue<string>("documentsMember").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse);
var imagesCollection = Umbraco.TypedMedia(imagesList).Where(x => x != null);
foreach (var imageItem in imagesCollection)
{
<div class="file-customer">
**<h3>imageItem.name</h3>**
</div>
<div class="file-icon"><a href="@imageItem.Url" target="_blank"><img src="../media/1025/untitled-1.png"></a></div>
}
}
}
}
Listing Media Picker Items names from MemberTypes
Hi Folks,
I've got a macro that lists MediaPicker items associated with a Member Type (listed below). I need to output the Node Name of any media. The the moment
<h3>imageItem.name</h3>
just outputs the text imageitem.name not the media item title - any ideas what I need to change this too to display the media item name?Thanks
Darren
Hi Darren,
You need to add @ in front of it to tell that you want the Razor engine to pass it.
So try
Hope this helps,
/Dennis
Cheer Dennis, the answer was staring me in the face ha ha.
Darren
is working on a reply...