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 : TSP371104ea5123cca7679107f7fc0.
at Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce.ProfileProduct.Populate(ProductSettings settings) in C:\Data\Development\git\mch365mb-dev\Co3.MCH.Website.Frontend\Models\Frontend\Ecommerce\ProfileProduct.cs:line 85
at Co3.MCH.Website.Frontend.Services.Ecommerce.ProductService.GetEspressoProduct(ProductSettings settings, String key) in C:\Data\Development\git\mch365mb-dev\Co3.MCH.Website.Frontend\Services\Ecommerce\ProductService.cs:line 59
at CompiledRazorTemplates.Dynamic.RazorEngine_eeff1dea5e1347f1981b29ffdf82e3ad.Execute() in E:\Websites\mch365.espresso5.dk\Files\Templates\Designs\exhibition_site\eCom\Product\MCH365-exhibitor.cshtml:line 15
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.Data.Models.MCH365 8 @using Co3.MCH.Website.Frontend.Helpers 9 @using Co3.MCH.Website.Frontend.Models.Frontend 10 @using Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce 11 @using Dynamicweb.Core 12 @using Dynamicweb.Frontend 13 14 @{ 15 ProfileProduct espressoProduct = Co3.MCH.Website.Frontend.Services.Ecommerce.ProductService.Instance.GetEspressoProduct( 16 new ProductSettings() 17 { 18 Id = GetString("Ecom:Product.ID"), 19 VariantId = GetString("Ecom:Product.VariantID"), 20 PrimaryVariantId = GetString("Ecom:Product.DefaultVariantComboID"), 21 EmbeddedInModelList = false 22 }, nameof(ProfileProduct) 23 ) as ProfileProduct; 24 25 // EXAMPLE 26 bool hasPresentation = espressoProduct.HasPresentation; 27 int presentationContactPersons = 0; 28 if (hasPresentation) 29 { 30 presentationContactPersons = espressoProduct.Presentation.ContactPersons.Products.Count(); 31 } 32 33 IEnumerable<BoothInfo> booths = espressoProduct.Booths; 34 35 bool hasCookiebot = PageView.Current().Area.Item[ "Cookiebot" ].ToString() == "True"; 36 37 // CUSTOM COMPANY FIELDS 38 string companyDescriptionFormatted = espressoProduct.Company.DescriptionFormatted; 39 40 string companyDescriptionFormattedStrippedHtml = companyDescriptionFormatted.StripHtml(); 41 42 string companyDescriptionFormattedMetaDesc = !string.IsNullOrEmpty(companyDescriptionFormattedStrippedHtml) ? companyDescriptionFormattedStrippedHtml : espressoProduct.Company.Name; 43 44 if ( companyDescriptionFormattedStrippedHtml.Length > 160 ) 45 { 46 companyDescriptionFormattedMetaDesc = !string.IsNullOrEmpty(companyDescriptionFormattedStrippedHtml) ? companyDescriptionFormattedStrippedHtml.Substring(0, 160) : espressoProduct.Company.Name; 47 } 48 49 string companyColor = ""; 50 51 if (espressoProduct.Company.BrandColor.IsNullOrEmpty()) 52 { 53 companyColor = MCH365Context.Current.TradeShowDetails.PrimaryColor; 54 } 55 else 56 { 57 companyColor = espressoProduct.Company.BrandColor; 58 } 59 60 // CUSTOM COMPANY COLOR SCHEME 61 Regex hexcodeRegex = new Regex(@"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"); 62 companyColor = hexcodeRegex.IsMatch( companyColor ) ? companyColor : "#000000"; 63 ColorHelper.HSL brandExhibitor = ColorHelper.Instance.HexToHsl(companyColor); 64 65 // VIDEO 66 string presentationVideo = ""; 67 68 if (espressoProduct.Presentation != null && espressoProduct.Presentation.Video != null && !string.IsNullOrEmpty(espressoProduct.Presentation.Video)) 69 { 70 string presentationVideoRaw = espressoProduct.Presentation.Video; 71 72 if (presentationVideoRaw.Contains("https://vimeo.com/")) 73 { 74 presentationVideo = "https://player.vimeo.com/video/" + (presentationVideoRaw.Replace("https://vimeo.com/", "")); 75 } 76 else if (presentationVideoRaw.Contains("https://youtu")) 77 { 78 presentationVideo = ("https://www.youtube.com/embed/" + presentationVideoRaw.Replace("https://youtu.be/", "").Replace("https://www.youtube.com/embed/", "")); 79 } 80 else if (presentationVideoRaw.Contains("https://www.youtube.com/watch?v=")) 81 { 82 presentationVideo = ("https://www.youtube.com/embed/" + presentationVideoRaw.Replace("https://www.youtube.com/watch?v=", "")); 83 } 84 else 85 { 86 presentationVideo = ("https://www.youtube.com/embed/" + presentationVideoRaw); 87 } 88 } 89 } 90 91 <style> 92 :root { 93 --exhibitor-color: @brandExhibitor.ToString(); 94 --exhibitor-color-darken: @brandExhibitor.Darken(10).ToString(); 95 --exhibition-profile-exhibitor-brand-color: hsl(var(--exhibitor-color)); 96 --exhibition-profile-exhibitor-brand-color-darken: hsl(var(--exhibitor-color-darken)); 97 --exhibition-profile-exhibitor-brand-color-opaque: hsla(var(--exhibitor-color), 0.85); 98 } 99100 .breadcrumb.nav { 101 background-color: var(--exhibition-profile-exhibitor-brand-color-darken); 102 } 103104 </style> 105106 @RenderingService.Instance.SectionEnd() 107 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-topsection.cshtml", espressoProduct) 108 @RenderingService.Instance.SectionStart(new SectionSettings 109 { 110 Classes = new ClassList("e-section mch365-custom-product-details-wrapper") 111 }) 112 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-sidebar.cshtml", espressoProduct) 113 <div class="col-12 col-md-8 col-lg-9 p-columns mch365-custom-product-details-wrapper-main-content"> 114115 <div class="row align-items-end pt-3"> 116 <div class="col-12 col-md-6 col-lg-7"> 117 @if ( hasPresentation ) 118 { 119 <p class="lead font-weight-light mb-0">@Translate( "MCH365 - Exhibitor details topSectionFairInfoOn - Text", "på" ) @MCH365Context.Current.TradeShowDetails.Name</p> 120 } 121 <h1 class="mega my-0">@espressoProduct.Company.Name</h1> 122 </div> 123 @if (booths != null) 124 { 125 <div class="col-12 col-md-6 col-lg-5 mt-3 mt-md-0 d-flex flex-column justify-content-md-end align-items-md-end"> 126 <p class="h4 mb-0">@Translate("Stand")</p> 127 @if (booths.Count() == 1) 128 { 129 BoothInfo booth = booths.FirstOrDefault(); 130 if (booth.Hall != null && booth.Booth != null) 131 { 132 <h2 class="mb-0 font-weight-extrabold mt-0"> 133 <span class="enlarge-text">@booth.Hall.Name</span> @booth.Booth.Number 134 </h2> 135 } 136 } 137 else 138 { 139 <div class="d-flex flex-wrap justify-content-md-end w-100" style="column-gap: 1em;"> 140 @foreach (BoothInfo booth in booths) 141 { 142143 if (booth.Hall != null && booth.Booth != null) 144 { 145 <h2 class="small mt-0 mb-0 font-weight-extrabold flex-nowrap"> 146 @booth.Hall.Name <span class="text-downsize-notched">@booth.Booth.Number</span> 147 </h2> 148 } 149 } 150 </div> 151 } 152 </div> 153 } 154 </div> 155156157 <div class="row mt-2"> 158 <div class="col-12"> 159 <div class="row"> 160 <div class="col-12 col-lg-8 mb-2 pr-lg-2 pr-xl-3" id="presentation"> 161 @if (hasPresentation && !string.IsNullOrEmpty(espressoProduct.Presentation.DescriptionFormatted)) 162 { 163 <p>@espressoProduct.Presentation.DescriptionFormatted</p> 164 } 165 else 166 { 167 if (!string.IsNullOrEmpty(companyDescriptionFormatted)) 168 { 169 <p>@companyDescriptionFormatted</p> 170 } 171 else 172 { 173 <h4>@Translate("MCH365 - Exhibitor details descriptionNoInfoHeader - Heading", "Vi har registreret udstilleren som leverandør eller udstiller på messen.")</h4> 174 <p>@Translate("MCH365 - Exhibitor details descriptionNoInfoText - Text", "Dog har de endnu ikke oplyst yderligere beskrivelse på deres profil.")</p> 175 } 176 } 177178 @if (hasPresentation) 179 { 180 if (!string.IsNullOrEmpty(presentationVideo)) 181 { 182 <div class="video-container mt-5 mb-4"> 183 @if (hasCookiebot) 184 { 185 <div class="cookieconsent-optout-marketing "> 186 <a href="javascript:Cookiebot.renew()" class="btn"> 187 <small>@Translate("Cookies - Accept to watch", "Accepter marketing-cookies for at se denne video.")</small> 188 <br/> 189 <i class="material-icons">play_arrow</i> 190 </a> 191 </div> 192 <iframe data-cookieconsent="marketing" class="responsive-iframe" data-src="@presentationVideo" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe> 193 } 194 else 195 { 196 <iframe class="responsive-iframe" src="@presentationVideo" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe> 197 } 198 </div> 199 } 200 } 201 </div> 202 @if (espressoProduct.ContactPersons.Products.Any()) 203 { 204 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-contactpersons.cshtml", espressoProduct) 205 } 206 </div> 207208 @if (espressoProduct.Products.Products.Any()) 209 { 210 <div class="row"> 211 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-products.cshtml", espressoProduct) 212 </div> 213 } 214 @if (espressoProduct.Articles.Products.Any()) 215 { 216 <div class="row"> 217 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-articles.cshtml", espressoProduct) 218 </div> 219 } 220 @if (espressoProduct.Cases.Products.Any()) 221 { 222 <div class="row"> 223 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-cases.cshtml", espressoProduct) 224 </div> 225 } 226227228 @if (espressoProduct.Events.Products.Any()) 229 { 230 <div class="row"> 231 @RenderingService.Instance.PartialView("ecom/product/partials/exhibitor-details/MCH365-events.cshtml", espressoProduct) 232 </div> 233 } 234 </div> 235 </div> 236 </div> 237 @RenderingService.Instance.SectionEnd() 238 @RenderingService.Instance.SectionStart(new SectionSettings()) 239240 @SnippetStart("profileProductCompanyDescription")@companyDescriptionFormattedMetaDesc@SnippetEnd("profileProductCompanyDescription") @* Avoid using linebreaks in this snippet, as it will also add linebreaks to the content *@

Ansvar for indhold på denne side

Oplysninger, billeder, produktbeskrivelser, videoer, certificeringer, bæredygtighedsudsagn og øvrigt indhold på virksomhedsprofilerne uploades og vedligeholdes af de enkelte udstillere.

Udstilleren er selv ansvarlig for indholdets korrekthed, dokumentation og lovlighed, herunder overholdelse af gældende regler om markedsføring, bæredygtighedsudsagn og immaterielle rettigheder.

MCH A/S stiller alene platformen til rådighed og verificerer som udgangspunkt ikke indholdet.