Error executing template "Designs/exhibition_site/eCom/Product/MCH365-profile.cshtml"
System.Exception: _dynamicwebProduct is not Active. Settings are: {"Product":null,"Id":"PPb71c18ca3a79e721c70ff659c37f","LanguageId":null,"VariantId":"","PrimaryVariantId":"","EmbeddedInModelList":true}
at Co3.Espresso.Website.Models.FrontEnd.Ecommerce.EspressoProduct.Populate(ProductSettings settings) in F:\TeamCity\BuildAgent 1\work\ea1444d680f7414e\Co3.Espresso.Website\Models\FrontEnd\Ecommerce\EspressoProduct.cs:line 755
at Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce.ProductProduct.Populate(ProductSettings settings) in C:\Data\Development\git\mch365mb-dev\Co3.MCH.Website.Frontend\Models\Frontend\Ecommerce\ProductProduct.cs:line 137
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 Co3.MCH.Website.Frontend.Services.MCH365.ProductService.<>c.<GetProductProducts>b__10_1(ProductContainer product) in C:\Data\Development\git\mch365mb-dev\Co3.MCH.Website.Frontend\Services\MCH365\ProductService.cs:line 199
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Co3.MCH.Website.Frontend.Services.MCH365.ProductService.GetProductProducts(Profile profile, MCH365ViewType viewType) in C:\Data\Development\git\mch365mb-dev\Co3.MCH.Website.Frontend\Services\MCH365\ProductService.cs:line 195
at Co3.MCH.Website.Frontend.Models.Frontend.Ecommerce.ProfileProduct.get_Products() in C:\Data\Development\git\mch365mb-dev\Co3.MCH.Website.Frontend\Models\Frontend\Ecommerce\ProfileProduct.cs:line 60
at CompiledRazorTemplates.Dynamic.RazorEngine_afa8425324744e2cb011c3f391944cfd.Execute() in E:\Websites\mch365.espresso5.dk\Files\Templates\Designs\exhibition_site\eCom\Product\MCH365-profile.cshtml:line 182
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.Base.Extensions
4 @using Co3.Espresso.Website.Services
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 13 @{
14 ProfileProduct espressoProduct = Co3.MCH.Website.Frontend.Services.Ecommerce.ProductService.Instance.GetEspressoProduct(
15 new ProductSettings()
16 {
17 Id = GetString("Ecom:Product.ID"),
18 VariantId = GetString("Ecom:Product.VariantID"),
19 PrimaryVariantId = GetString("Ecom:Product.DefaultVariantComboID"),
20 EmbeddedInModelList = false
21 }, nameof(ProfileProduct)
22 ) as ProfileProduct;
23 24 // EXAMPLE
25 bool hasPresentation = espressoProduct.HasPresentation;
26 int presentationContactPersons = 0;
27 if (hasPresentation)
28 {
29 presentationContactPersons = espressoProduct.Presentation.ContactPersons.Products.Count();
30 }
31 32 IEnumerable<BoothInfo> booths = espressoProduct.Booths;
33 34 // CUSTOM COMPANY FIELDS
35 string companyDescriptionFormatted = espressoProduct.Company.DescriptionFormatted;
36 37 string companyDescriptionFormattedStrippedHtml = companyDescriptionFormatted.StripHtml();
38 39 string companyDescriptionFormattedMetaDesc = !string.IsNullOrEmpty(companyDescriptionFormattedStrippedHtml) ? companyDescriptionFormattedStrippedHtml : espressoProduct.Company.Name;
40 41 if ( companyDescriptionFormattedStrippedHtml.Length > 160 )
42 {
43 companyDescriptionFormattedMetaDesc = !string.IsNullOrEmpty(companyDescriptionFormattedStrippedHtml) ? companyDescriptionFormattedStrippedHtml.Substring(0, 160) : espressoProduct.Company.Name;
44 }
45 46 string companyColor = "";
47 48 if (espressoProduct.Company.BrandColor.IsNullOrEmpty())
49 {
50 companyColor = MCH365Context.Current.TradeShowDetails.PrimaryColor;
51 }
52 else
53 {
54 companyColor = espressoProduct.Company.BrandColor;
55 }
56 57 // CUSTOM COMPANY COLOR SCHEME
58 Regex hexcodeRegex = new Regex(@"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$");
59 companyColor = hexcodeRegex.IsMatch( companyColor ) ? companyColor : "#000000";
60 ColorHelper.HSL brandExhibitor = ColorHelper.Instance.HexToHsl(companyColor);
61 62 ViewBag.TextColor = brandExhibitor.L < 60 ? "e-text-light" : "e-text-dark";
63 64 // VIDEO
65 string presentationVideo = "";
66 67 if (espressoProduct.Presentation != null && espressoProduct.Presentation.Video != null && !string.IsNullOrEmpty(espressoProduct.Presentation.Video))
68 {
69 string presentationVideoRaw = espressoProduct.Presentation.Video;
70 71 if (presentationVideoRaw.Contains("https://vimeo.com/"))
72 {
73 presentationVideo = "https://player.vimeo.com/video/" + (presentationVideoRaw.Replace("https://vimeo.com/", ""));
74 }
75 else if (presentationVideoRaw.Contains("https://youtu"))
76 {
77 presentationVideo = ("https://www.youtube.com/embed/" + presentationVideoRaw.Replace("https://youtu.be/", "").Replace("https://www.youtube.com/embed/", ""));
78 }
79 else if (presentationVideoRaw.Contains("https://www.youtube.com/watch?v="))
80 {
81 presentationVideo = ("https://www.youtube.com/embed/" + presentationVideoRaw.Replace("https://www.youtube.com/watch?v=", ""));
82 }
83 else
84 {
85 presentationVideo = ("https://www.youtube.com/embed/" + presentationVideoRaw);
86 }
87 }
88 }
89 90 <style>
91 :root {
92 --exhibitor-color: @brandExhibitor.ToString();
93 --exhibitor-color-darken: @brandExhibitor.Darken(10).ToString();
94 --exhibition-profile-exhibitor-brand-color: hsl(var(--exhibitor-color));
95 --exhibition-profile-exhibitor-brand-color-darken: hsl(var(--exhibitor-color-darken));
96 --exhibition-profile-exhibitor-brand-color-opaque: hsla(var(--exhibitor-color), 0.85);
97 }
98 99 .breadcrumb.nav {
100 background-color: var(--exhibition-profile-exhibitor-brand-color-darken);
101 }
102103 </style>
104105 @RenderingService.Instance.SectionEnd()
106 @RenderingService.Instance.PartialView("ecom/product/partials/profile-details/MCH365-topsection.cshtml", espressoProduct)
107 @RenderingService.Instance.SectionStart(new SectionSettings
108 {
109 Classes = new ClassList("e-section mch365-custom-product-details-wrapper")
110 })
111112113 @RenderingService.Instance.PartialView("ecom/product/partials/profile-details/MCH365-sidebar.cshtml", espressoProduct)
114 <div class="col-12 col-md-8 col-lg-9 p-columns mch365-custom-product-details-wrapper-main-content">
115116 <div class="row align-items-end pt-3">
117 <div class="col-12 col-md-6 col-lg-7">
118 @if ( hasPresentation )
119 {
120 <p class="lead font-weight-light mb-0">@Translate( "MCH365 - Exhibitor details topSectionFairInfoOn - Text", "på" ) @MCH365Context.Current.TradeShowDetails.Name</p>
121 }
122 <h1 class="mega my-0">@espressoProduct.Company.Name</h1>
123 </div>
124 @if (booths != null)
125 {
126 <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">
127 <p class="h4 mb-0">@Translate("Stand")</p>
128 @if (booths.Count() == 1)
129 {
130 BoothInfo booth = booths.FirstOrDefault();
131 if (booth.Hall != null && booth.Booth != null)
132 {
133 <h2 class="mb-0 font-weight-extrabold mt-0">
134 <span class="enlarge-text">@booth.Hall.Name</span> @booth.Booth.Number
135 </h2>
136 }
137 }
138 else
139 {
140 <div class="d-flex flex-wrap justify-content-md-end w-100" style="column-gap: 1em;">
141 @foreach (BoothInfo booth in booths)
142 {
143144 if (booth.Hall != null && booth.Booth != null)
145 {
146 <h2 class="small mt-0 mb-0 font-weight-extrabold flex-nowrap">
147 @booth.Hall.Name <span class="text-downsize-notched">@booth.Booth.Number</span>
148 </h2>
149 }
150 }
151 </div>
152 }
153 </div>
154 }
155 <div class="col-12 pt-1">
156 <hr/>
157 </div>
158 </div>
159160 <div class="row mt-2">
161 <div class="col-12">
162 <div class="row">
163 <div class="col-12 col-lg-8 mb-2 pr-lg-2 pr-xl-3" id="presentation">
164 @if (!string.IsNullOrEmpty(companyDescriptionFormatted))
165 {
166 <p>@companyDescriptionFormatted</p>
167 }
168 else
169 {
170 <h4>@Translate("MCH365 - Exhibitor details descriptionNoInfoHeader - Heading", "Vi har registreret udstilleren som leverandør eller udstiller på messen.")</h4>
171 <p>@Translate("MCH365 - Exhibitor details descriptionNoInfoText - Text", "Dog har de endnu ikke oplyst yderligere beskrivelse på deres profil.")</p>
172 }
173174175 </div>
176 @if (espressoProduct.ContactPersons.Products.Any())
177 {
178 @RenderingService.Instance.PartialView("ecom/product/partials/profile-details/MCH365-contactpersons.cshtml", espressoProduct)
179 }
180 </div>
181182 @if (espressoProduct.Products.Products.Any())
183 {
184 <div class="row">
185 @RenderingService.Instance.PartialView("ecom/product/partials/profile-details/MCH365-products.cshtml", espressoProduct)
186 </div>
187 }
188 @if (espressoProduct.Articles.Products.Any())
189 {
190 <div class="row">
191 @RenderingService.Instance.PartialView("ecom/product/partials/profile-details/MCH365-articles.cshtml", espressoProduct)
192 </div>
193 }
194 @if (espressoProduct.Cases.Products.Any())
195 {
196 <div class="row">
197 @RenderingService.Instance.PartialView("ecom/product/partials/profile-details/MCH365-cases.cshtml", espressoProduct)
198 </div>
199 }
200 @if (espressoProduct.Events.Products.Any())
201 {
202 <div class="row">
203 @RenderingService.Instance.PartialView("ecom/product/partials/profile-details/MCH365-events.cshtml", espressoProduct)
204 </div>
205 }
206207 </div>
208 </div>
209 </div>
210 @RenderingService.Instance.SectionEnd()
211 @RenderingService.Instance.SectionStart(new SectionSettings())
212213 @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.