Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kerri Mallinson 113 posts 497 karma points
    Mar 03, 2016 @ 17:40
    Kerri Mallinson
    0

    Rendering Extended Content in View

    Hi all,

    I'm new to Merchello, I was hoping someone could tell me (or point me to some documentation) that explains how to render the extended product information in views?

    I can get the base information like this:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @using Merchello.Web
    @{
    Layout = "Master.cshtml";
    var product = CurrentPage.Product; 
    }
          <p>@product.Sku</p>
          <p>@product.Price</p>
    

    But not the Extended Content

    Thanks :)

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Mar 09, 2016 @ 17:35
    Rusty Swayne
    0

    Hey sorry Kerri - getting caught up after uWestFest.

    When using dynamics, you should be able to use just the property name.

    So

     @product.myProperty
    

    Alternatively, you could change your inherits to

     @inherits UmbracoViewPage<IProductContent>
    
      var product = Model.Content;
    
      var someProp = product.GetPropertyValue<string>("someProp");
      var description = product.GetPropertyValue<IHtmlString>("description");
    
     // if you are using the Umbraco Core Property Value Converters 
    //// https://our.umbraco.org/projects/developer-tools/umbraco-core-property-value-converters/
     var image = product.GetPropertyValue<IPublishedContent>("image");  
    
Please Sign in or register to post replies

Write your reply to:

Draft