Error executing template "Designs/exhibition_site/eCom/Product/MCH365-exhibitor.cshtml" System.Exception: Product is not of type Co3.MCH.Website.Frontend.Models.Frontend.MCH365.Profile. Check asset type of product id : TSP88b15ea9575788dc41c52a607b1. at Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce.ProfileProduct.Populate(ProductSettings settings) in C:\Data\Development\git\mch-master\Co3.MCH.Website.Frontend\Models\Frontend\Ecommerce\ProfileProduct.cs:line 67 at Co3.MCH.Website.Frontend.Services.Ecommerce.ProductService.GetEspressoProduct(ProductSettings settings, String key) in C:\Data\Development\git\mch-master\Co3.MCH.Website.Frontend\Services\Ecommerce\ProductService.cs:line 46 at CompiledRazorTemplates.Dynamic.RazorEngine_3bf77d86db4444a5b043bc98c70c637b.Execute() in E:\dynamicweb.net\Solutions\mch365.espresso5.dk\Files\Templates\Designs\exhibition_site\eCom\Product\MCH365-exhibitor.cshtml:line 13 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()1 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module 2 @using System.Text.RegularExpressions 3 @using Co3.Espresso.Website.Services 4 @using Co3.Espresso.Base.Extensions 5 @using Co3.Espresso.Website.Models.FrontEnd 6 @using Co3.Espresso.Website.Models.FrontEnd.Settings 7 @using Co3.MCH.Website.Frontend.Helpers 8 @using Co3.MCH.Website.Frontend.Models.Frontend 9 @using Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce 10 @using Dynamicweb.Core 11 12 @{ 13 ProfileProduct espressoProduct = Co3.MCH.Website.Frontend.Services.Ecommerce.ProductService.Instance.GetEspressoProduct( 14 new ProductSettings() 15 { 16 Id = GetString("Ecom:Product.ID"), 17 VariantId = GetString("Ecom:Product.VariantID"), 18 PrimaryVariantId = GetString("Ecom:Product.DefaultVariantComboID"), 19 EmbeddedInModelList = false 20 }, nameof(ProfileProduct) 21 ) as ProfileProduct; 22 23 // EXAMPLE 24 bool hasPresentation = espressoProduct.HasPresentation; 25 int presentationContactPersons = 0; 26 if (hasPresentation) 27 { 28 presentationContactPersons = espressoProduct.Presentation.ContactPersons.Products.Count(); 29 } 30 31 // CUSTOM COMPANY FIELDS 32 string companyDescriptionFormatted = espressoProduct.Company.DescriptionFormatted; 33 34 string companyDescriptionFormattedStrippedHtml = companyDescriptionFormatted.StripHtml(); 35 36 string companyDescriptionFormattedMetaDesc = !string.IsNullOrEmpty(companyDescriptionFormattedStrippedHtml) ? companyDescriptionFormattedStrippedHtml : espressoProduct.Company.Name; 37 38 if ( companyDescriptionFormattedStrippedHtml.Length > 160 ) 39 { 40 companyDescriptionFormattedMetaDesc = !string.IsNullOrEmpty(companyDescriptionFormattedStrippedHtml) ? companyDescriptionFormattedStrippedHtml.Substring(0, 160) : espressoProduct.Company.Name; 41 } 42 43 string companyColor = ""; 44 45 if (espressoProduct.Company.BrandColor.IsNullOrEmpty()) 46 { 47 companyColor = MCH365Context.Current.TradeShowDetails.PrimaryColor; 48 } 49 else 50 { 51 companyColor = espressoProduct.Company.BrandColor; 52 } 53 54 // CUSTOM COMPANY COLOR SCHEME 55 Regex hexcodeRegex = new Regex(@"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"); 56 companyColor = hexcodeRegex.IsMatch( companyColor ) ? companyColor : "#000000"; 57 ColorHelper.HSL brandExhibitor = ColorHelper.Instance.HexToHsl(companyColor); 58 59 // VIDEO 60 string presentationVideo = ""; 61 62 if (espressoProduct.Presentation != null && espressoProduct.Presentation.Video != null && !string.IsNullOrEmpty(espressoProduct.Presentation.Video)) 63 { 64 string presentationVideoRaw = espressoProduct.Presentation.Video; 65 66 if (presentationVideoRaw.Contains("https://vimeo.com/")) 67 { 68 presentationVideo = "https://player.vimeo.com/video/" + (presentationVideoRaw.Replace("https://vimeo.com/", "")); 69 } 70 else if (presentationVideoRaw.Contains("https://youtu")) 71 { 72 presentationVideo = ("https://www.youtube.com/embed/" + presentationVideoRaw.Replace("https://youtu.be/", "").Replace("https://www.youtube.com/embed/", "")); 73 } 74 else if (presentationVideoRaw.Contains("https://www.youtube.com/watch?v=")) 75 { 76 presentationVideo = ("https://www.youtube.com/embed/" + presentationVideoRaw.Replace("https://www.youtube.com/watch?v=", "")); 77 } 78 else 79 { 80 presentationVideo = ("https://www.youtube.com/embed/" + presentationVideoRaw); 81 } 82 } 83 } 84 85 <style> 86 :root { 87 --exhibitor-color: @brandExhibitor.ToString(); 88 --exhibitor-color-darken: @brandExhibitor.Darken(10).ToString(); 89 --exhibition-profile-exhibitor-brand-color: hsl(var(--exhibitor-color)); 90 --exhibition-profile-exhibitor-brand-color-darken: hsl(var(--exhibitor-color-darken)); 91 --exhibition-profile-exhibitor-brand-color-opaque: hsla(var(--exhibitor-color), 0.85); 92 } 93 94 .breadcrumb.nav { 95 background-color: var(--exhibition-profile-exhibitor-brand-color-darken); 96 } 97 98 </style> 99100 @RenderingService.Instance.SectionEnd() 101 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-topsection.cshtml", espressoProduct) 102 @RenderingService.Instance.SectionStart(new SectionSettings 103 { 104 Classes = new ClassList("e-section mch365-custom-product-details-wrapper") 105 }) 106 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-sidebar.cshtml", espressoProduct) 107 <div class="col-12 col-md-8 col-lg-9 p-columns mch365-custom-product-details-wrapper-main-content"> 108 <div class="row mt-2 mt-md-4"> 109 <div class="col-12"> 110 <div class="row"> 111 <div class="col-12 col-lg-8 mb-2 pr-lg-2 pr-xl-3" id="presentation"> 112113 @if (hasPresentation && !string.IsNullOrEmpty(espressoProduct.Presentation.DescriptionFormatted)) 114 { 115 <p>@espressoProduct.Presentation.DescriptionFormatted</p> 116 } 117 else { 118 if( !string.IsNullOrEmpty(companyDescriptionFormatted)) { 119 <p>@companyDescriptionFormatted</p> 120 } 121 else 122 { 123 <h4>@Translate("MCH365 - Exhibitor details descriptionNoInfoHeader - Heading", "Vi har registreret udstilleren som leverandør eller udstiller på messen.")</h4> 124 <p>@Translate("MCH365 - Exhibitor details descriptionNoInfoText - Text", "Dog har de endnu ikke oplyst yderligere beskrivelse på deres profil.")</p> 125 } 126 } 127128 @if (hasPresentation) 129 { 130 if (!string.IsNullOrEmpty(presentationVideo)) 131 { 132 <div class="video-container mt-5 mb-4"> 133 <iframe class="responsive-iframe" src="@presentationVideo" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe> 134 </div> 135 } 136 } 137 </div> 138 @if (espressoProduct.ContactPersons.Products.Any()) 139 { 140 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-contactpersons.cshtml", espressoProduct) 141 } 142 </div> 143144 @if (espressoProduct.Products.Products.Any()) 145 { 146 <div class="row"> 147 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-products.cshtml", espressoProduct) 148 </div> 149 } 150 @if (espressoProduct.Articles.Products.Any()) 151 { 152 <div class="row"> 153 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-articles.cshtml", espressoProduct) 154 </div> 155 } 156 @if (espressoProduct.Cases.Products.Any()) 157 { 158 <div class="row"> 159 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-cases.cshtml", espressoProduct) 160 </div> 161 } 162163164 @if (espressoProduct.Events.Products.Any()) 165 { 166 <div class="row"> 167 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-events.cshtml", espressoProduct) 168 </div> 169 } 170 </div> 171 </div> 172 </div> 173 @RenderingService.Instance.SectionEnd() 174 @RenderingService.Instance.SectionStart(new SectionSettings()) 175176 @SnippetStart("profileProductCompanyDescription")@companyDescriptionFormattedMetaDesc@SnippetEnd("profileProductCompanyDescription") @* Avoid using linebreaks in this snippet, as it will also add linebreaks to the content *@
Virksomhedsprofiler samt speciale- og interesseområder er udfyldt og tilføjet af udstillerne og er ikke baseret på viden eller vurdering fra Formland.