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
Hi,
I find this solution if you need to access to a product collection. From an Umbraco page:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @using Archetype.Models; @using Archetype.Extensions; @using Merchello.Core.Models @using Merchello.FastTrack.Ui @using Merchello.Web @{ Layout = "Layout.cshtml"; var storeRoot = ExampleUiHelper.Content.GetStoreRoot(); var mHelper = new MerchelloHelper(); var inevidenza = mHelper.TypedProductContentFromCollection(Guid.Parse("a6d13a30-2e2b-4d30-83b7-1dfaacc1997f")).ToList(); }
Then you can list products:
@foreach (var item in inevidenza) { <div class="nf-col-padding"> <div class="item-box"> <div class="shop-item"> <div class="item-img"> @if (item.HasValue("image")) { var mediaId = item.GetPropertyValue<string>("image"); var image = Umbraco.TypedMedia(mediaId); <img class="img-responsive" src="@image.GetCropUrl(200, 200)" alt="@item.Name"> } </div> </div> <div class="shop-item-info"> <a href="@item.Url"> <h6 class="shop-item-name">@item.Name</h6> </a> </div> </div> </div> }
Bye
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Solution if you need to access to a Merchello collection from a page.
Hi,
I find this solution if you need to access to a product collection. From an Umbraco page:
Then you can list products:
Bye
is working on a reply...