I've been away from coding Razor and have forgotton a few things like how to refrence all the images within a folder. The images are stored in a node with doctype "CareerServicesPartnerFolder" and all the images are uploaded via the media picker and have the doctype "CareerServicesPartner". I have what I thought would work, if someone could look it over and help me out, that would be great!
Thanks Moran. I ended up making it harder than it needed to be. All I had to do was use this code (notice the image. "logo" is an alias attached to the images):
<div id="slider">
<ul class="bxslider">
@{
var root = Model.AncestorOrSelf("CareerServicesHome");
foreach(var partner in root.Descendants("CareerServicesPartner")) {
<li><a class="partner-box" target="_blank" href="@partner.partnerURL" title="@partner.linkTitle" >
@* for source of images using an uploader only need to use @yourCurrentNode.parameterAlias *@
<img src="@partner.logo" width="180px" title="@partner.linkTitle" alt="@partner.Name" />
</a></li>
};
}
</ul>
</div>
Load images from a node
I've been away from coding Razor and have forgotton a few things like how to refrence all the images within a folder. The images are stored in a node with doctype "CareerServicesPartnerFolder" and all the images are uploaded via the media picker and have the doctype "CareerServicesPartner". I have what I thought would work, if someone could look it over and help me out, that would be great!
I've got it to load the @partner.Name, but not the images using this:
I use this solution: I get the media Id and create a DynamicMedia object.
Thanks Moran. I ended up making it harder than it needed to be. All I had to do was use this code (notice the image. "logo" is an alias attached to the images):
is working on a reply...