Error executing template "Designs/randers-tegl/eCom/Product/garden.product.cshtml"
System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Convert.ToDouble(String value)
at CompiledRazorTemplates.Dynamic.RazorEngine_e3dcff45972e4ccf9895f9e907e0c034.Execute() in D:\dynamicweb.net\Solutions\Gotcha\randerstegl.cloud.dynamicweb-cms.com\files\Templates\Designs\randers-tegl\eCom\Product\garden.product.cshtml:line 551
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
2 @{
3 string productId = GetString("Ecom:Product.ID");
4 string galleryId = "gallery-" + productId;
5 int areaId = GetInteger("Ecom:Product:Area.ID");
6 string productFolder = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ", "").ToLower();
7 string productName = GetString("Ecom:Product.Name");
8 string productSeries = GetString("Ecom:Product.CategoryField.Belaegning.ProduktSerie.OptionLabel");
9 System.Web.HttpContext.Current.Items["currentProductSeries"] = productSeries;
10 string productNumber = GetString("Ecom:Product.Number");
11 System.Web.HttpContext.Current.Items["currentProductNumber"] = productNumber;
12 string productTeaser = GetString("Ecom:Product:Field.ProductTeaser");
13 string productDescription = GetString("Ecom:Product.LongDescription");
14 string productShortDescription = GetString("Ecom:Product.ShortDescription");
15 string productDisclaimer = Translate("Translate_ProductDisclaimer");
16 bool disableSample = GetBoolean("Ecom:Product:Field.DisableSample");
17
18 string stackImagePath = "";
19
20 // Stack - JPG
21 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack.jpg"))) {
22 stackImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack.jpg";
23 }
24
25 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_wide.jpg"))) {
26 stackImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_wide.jpg";
27 }
28
29 if (Pageview.Area.ID == 9 && System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_de.jpg"))) {
30 stackImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_de.jpg";
31 }
32
33 if (Pageview.Area.ID == 9 && System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_wide_de.jpg"))) {
34 stackImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_wide_de.jpg";
35 }
36
37 // If there's no JPG - look for PNG
38 if (string.IsNullOrWhiteSpace(stackImagePath)) {
39 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack.png"))) {
40 stackImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack.png";
41 }
42
43 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_wide.png"))) {
44 stackImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_wide.png";
45 }
46
47 if (Pageview.Area.ID == 9 && System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_de.png"))) {
48 stackImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_de.png";
49 }
50
51 if (Pageview.Area.ID == 9 && System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_wide_de.png"))) {
52 stackImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/stack_wide_de.png";
53 }
54 }
55
56 string stackImageXl = "/admin/public/getimage.ashx?image=" + stackImagePath + "&compression=100&width=370";
57 string stackImageMd = "/admin/public/getimage.ashx?image=" + stackImagePath + "&compression=100&width=286";
58 string stackImageSm = "/admin/public/getimage.ashx?image=" + stackImagePath + "&compression=100&width=189";
59 string stackImageDefault = "/admin/public/getimage.ashx?image=" + stackImagePath + "&compression=100&width=437";
60
61 string wallImagePath = "";
62
63 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/wall.jpg"))) {
64 wallImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/wall.jpg";
65 }
66
67 if (Pageview.Area.ID == 8 && System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/wall_se.png"))) {
68 wallImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/wall_se.png";
69 }
70
71 if (Pageview.Area.ID == 9 && System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/wall_de.png"))) {
72 wallImagePath = "/Files/Images/products-v2/" + GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "/wall_de.png";
73 }
74
75 string wallImageXl = "/admin/public/getimage.ashx?image=" + wallImagePath + "&compression=100&width=732";
76 string wallImageMd = "/admin/public/getimage.ashx?image=" + wallImagePath + "&compression=100&width=566";
77 string wallImageSm = "/admin/public/getimage.ashx?image=" + wallImagePath + "&compression=100&width=380";
78 string wallImageDefault = "/admin/public/getimage.ashx?image=" + wallImagePath + "&compression=100&width=727";
79
80 string arrowSvg = "";
81
82 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images/gallery-arrow.svg"))) {
83 arrowSvg = System.IO.File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images/gallery-arrow.svg"));
84 }
85
86 string lastAddedProductId = GetString("Ecom:LastAddedProduct.ID");
87 bool sampleIsInCart = GetLoop("ProductRelatedGroups").Where(x => x.GetLoop("Products").Where(y => y.GetString("Ecom:Product.ID") == lastAddedProductId).Any()).Any();
88
89 System.Web.HttpContext.Current.Items["CurrentSampleInCart"] = sampleIsInCart;
90 }
91 <article class="product-header module module-white"><div class="product-header__text"><span class="product-header__preline">@productSeries</span><h1 class="product-header__headline">@productNumber @productName</h1><div class="product-header__teaser">@productTeaser</div>
92 @if(!String.IsNullOrWhiteSpace(stackImagePath)) {
93 <picture class="product-header__stack-image"><source srcset="@stackImageXl" media="(min-width: 1500px)" /><source srcset="@stackImageMd" media="(min-width: 992px)" /><source srcset="@stackImageSm" media="(min-width: 768px)" /><img src="@stackImageDefault" class="product-header__stack-media" loading="lazy" alt="." /></picture>
94 }
95 <div class="rich-text">
96 @productShortDescription
97 @productDescription
98 </div><span class="product-header__disclaimer">@productDisclaimer</span>
99 @if (GetInteger("Ecom:Product:Area.ID") == 1 ) {
100 string shopBelaegningPageID = "";
101
102 if (GetInteger("Ecom:Product:Area.ID") == 1) {
103 shopBelaegningPageID = "147";
104 } else if (GetInteger("Ecom:Product:Area.ID") == 9) {
105 shopBelaegningPageID = "2346";
106 }
107
108 <div class="product-header__shop-link"><a href='@("/Default.aspx?Id=")@shopBelaegningPageID@("&ProductID=")@GetString("Ecom:Product.ID")' class="button button-simple">@Translate("RT-2.0_BelaegningShop_KoebBelaegning")</a><br /><br /></div>
109 }
110 @if (areaId != 7 && areaId != 8 && !disableSample) {
111 bool hasRelatedProduct = false;
112
113 if (areaId == 1) {
114 foreach (var relatedGroup in GetLoop("ProductRelatedGroups")) {
115 if (relatedGroup.GetString("Ecom:Product:RelatedGroup.Name").ToLower() == "prøvekasse") {
116 foreach (var relatedProduct in relatedGroup.GetLoop("RelatedProducts")) {
117 hasRelatedProduct = true;
118
119 string relatedLoopCounterName = $"ProductLoopCounter{@relatedProduct.GetString("Ecom:Product.LoopCounter")}";
120 string relatedLoopCounterValue = relatedProduct.GetString("Ecom:Product.LoopCounter");
121 string relatedIdName = $"ProductID{@relatedProduct.GetString("Ecom:Product.LoopCounter")}";
122 string relatedIdValue = relatedProduct.GetString("Ecom:Product.ID");
123 string relatedQuantityName = $"Quantity{relatedProduct.GetString("Ecom:Product.LoopCounter")}";
124
125 <form method="post" class="product-samples-form" name="@relatedIdValue" id="@relatedIdValue"><input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" /><input type="hidden" name="@relatedLoopCounterName" value="@relatedLoopCounterValue" /><input type="hidden" name="@relatedIdName" value="@relatedIdValue" /><input type="hidden" name="@relatedQuantityName" value="1" /><input type="hidden" name="VariantID" id="VariantID" value="" /><input type="hidden" name="UnitID" id="UnitID" value="" /><input type="hidden" name="wishListID" id="wishListID" value="0" /><input type="hidden" name='ProductLoopCounter{@GetString("Ecom:Product.LoopCounter")}' value='@GetString("Ecom:Product.LoopCounter")' />
126 @{
127 string mainProductCounterName = $"ProductID{GetString("Ecom:Product.LoopCounter")}";
128 string mainProductCounterValue = GetString("Ecom:Product.ID");
129 string mainProductQuantityName = $"Quantity{GetString("Ecom:Product.LoopCounter")}";
130 }
131 <input type="hidden" name="@mainProductCounterName" value="@mainProductCounterValue" /><input type="hidden" name="@mainProductQuantityName" value="0" /><div class="product-cta"><button type="submit" class="product-cta__link product-cta__link--orange"><span class="product-cta__link-text">@Translate("Translate_Order-sample-private")</span></button><a href="#tabFreeSample-content" class="product-cta__link product-cta__link--white"><span class="product-cta__link-text">@Translate("Translate_Order-sample-business")</span></a></div></form>
132 }
133 }
134 }
135 if (!hasRelatedProduct) {
136 <a href="#tabFreeSample-content" class="product-cta__link product-cta__link--white"><span class="product-cta__link-text">@Translate("Translate_Order-sample-business")</span></a>
137 }
138 } else {
139 <a href="#tabFreeSample-content" class="button button-simple">@Translate("RT-2.0_Bestil_en_gratis_proevekasse")</a>
140 }
141 }
142 </div><picture class="product-header__wall-image"><source srcset="@wallImageXl" media="(min-width: 1500px)" /><source srcset="@wallImageMd" media="(min-width: 992px)" /><source srcset="@wallImageSm" media="(min-width: 768px)" /><img src="@wallImageDefault" class="product-header__wall-media" loading="lazy" alt="." /></picture></article>
143
144
145 @{
146 string galleryMain = "";
147
148 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(productFolder + "/gallery_main.jpg"))) {
149 galleryMain = productFolder + "/gallery_main.jpg";
150 }
151
152 string searchpattern = @"gallery_\d{2}\.jpg";
153 string[] galleryImages = new string[0];
154
155 if (System.IO.Directory.Exists(System.Web.HttpContext.Current.Server.MapPath("~\\Files\\Images\\products-v2\\" + @GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "\\"))) {
156 galleryImages = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath("~\\Files\\Images\\products-v2\\" + @GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "\\")).Where(path => System.Text.RegularExpressions.Regex.Match(path, searchpattern).Success).ToArray();
157
158 if (GetInteger("Ecom:Product:Area.ID") != 1) {
159 string language = GetString("Ecom:Product:Area.Name").ToString().ToLower();
160 string languageGalleryMain = "";
161
162 if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(productFolder + "/gallery_main_" + language + ".jpg"))) {
163 languageGalleryMain = productFolder + "/gallery_main_" + language +".jpg";
164 }
165
166 string languageSearchpattern = "gallery_0*_" + language + ".jpg";
167 string[] languageGalleryImages = new string[0];
168
169 try {
170 languageGalleryImages = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath("~\\Files\\Images\\products-v2\\" + @GetString("Ecom:Product.Number").Replace(" ","").ToLower() + "\\"), languageSearchpattern);
171 } catch {
172
173 }
174
175 if (languageGalleryMain != "") {
176 galleryMain = languageGalleryMain;
177 }
178
179 if (languageGalleryImages.Length > 0) {
180 galleryImages = languageGalleryImages;
181 }
182 }
183 }
184
185 string productVideo = GetString("Ecom:Product:Field.Video");
186 string productVideoEmbed = "";
187
188 if (!string.IsNullOrWhiteSpace(productVideo)) {
189 string videoId = productVideo.Substring(productVideo.LastIndexOf("/") + 1);
190 productVideoEmbed = "https://player.vimeo.com/video/" + videoId + "?background=1&dnt=1&autoplay=0";
191 }
192
193 string productVideo2 = GetString("Ecom:Product:Field.Video2");
194 string productVideoEmbed2 = "";
195
196 if (!string.IsNullOrWhiteSpace(productVideo2)) {
197 string videoId2 = productVideo2.Substring(productVideo2.LastIndexOf("/") + 1);
198 productVideoEmbed2 = "https://player.vimeo.com/video/" + videoId2 + "?background=1&dnt=1&autoplay=0";
199 }
200
201 string productVideo3 = GetString("Ecom:Product:Field.Video3");
202 string productVideoEmbed3 = "";
203
204 if (!string.IsNullOrWhiteSpace(productVideo3)) {
205 string videoId3 = productVideo3.Substring(productVideo3.LastIndexOf("/") + 1);
206 productVideoEmbed3 = "https://player.vimeo.com/video/" + videoId3 + "?background=1&dnt=1&autoplay=0";
207 }
208
209 string productVideo4 = GetString("Ecom:Product:Field.Video4");
210 string productVideoEmbed4 = "";
211
212 if (!string.IsNullOrWhiteSpace(productVideo4)) {
213 string videoId4 = productVideo4.Substring(productVideo4.LastIndexOf("/") + 1);
214 productVideoEmbed4 = "https://player.vimeo.com/video/" + videoId4 + "?background=1&dnt=1&autoplay=0";
215 }
216
217 string productVideo5 = GetString("Ecom:Product:Field.Video5");
218 string productVideoEmbed5 = "";
219
220 if (!string.IsNullOrWhiteSpace(productVideo5)) {
221 string videoId5 = productVideo5.Substring(productVideo5.LastIndexOf("/") + 1);
222 productVideoEmbed5 = "https://player.vimeo.com/video/" + videoId5 + "?background=1&dnt=1&autoplay=0";
223 }
224 }
225 @if (
226 !string.IsNullOrWhiteSpace(productVideoEmbed) ||
227 !string.IsNullOrWhiteSpace(productVideoEmbed2) ||
228 !string.IsNullOrWhiteSpace(productVideoEmbed3) ||
229 !string.IsNullOrWhiteSpace(productVideoEmbed4) ||
230 !string.IsNullOrWhiteSpace(productVideoEmbed5) ||
231 galleryImages.Length > 0
232 ) {
233 int counter = 0;
234
235 <article class="product-gallery module module-white" id="@galleryId"><span class="product-gallery__preline">@Translate("Translate_Product-gallery_preline")</span><h2 class="product-gallery__headline">@Translate("Translate_Product-gallery_See_projects_with")
236 @productSeries, @productNumber</h2><div class="product-gallery__medias-wrap swiper-container" data-action="swiper"><ul class="product-gallery__medias swiper-wrapper">
237 @if (!string.IsNullOrWhiteSpace(productVideoEmbed)) {
238 counter++;
239
240 <li class="product-gallery__media product-gallery__media--video swiper-slide"><iframe class="product-gallery__video" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen src="@productVideoEmbed"></iframe></li>
241 }
242 @if (!string.IsNullOrWhiteSpace(productVideoEmbed2)) {
243 counter++;
244
245 <li class="product-gallery__media product-gallery__media--video swiper-slide"><iframe class="product-gallery__video" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen src="@productVideoEmbed2"></iframe></li>
246 }
247 @if (!string.IsNullOrWhiteSpace(productVideoEmbed3)) {
248 counter++;
249
250 <li class="product-gallery__media product-gallery__media--video swiper-slide"><iframe class="product-gallery__video" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen src="@productVideoEmbed3"></iframe></li>
251 }
252 @if (!string.IsNullOrWhiteSpace(productVideoEmbed4)) {
253 if (counter == 3) {
254 <text>@RenderLoadmoreButton(galleryId)</text>
255 }
256
257 counter++;
258
259 <li class="product-gallery__media product-gallery__media--video swiper-slide"><iframe class="product-gallery__video" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen src="@productVideoEmbed4"></iframe></li>
260 }
261 @if (!string.IsNullOrWhiteSpace(productVideoEmbed5)) {
262 if (counter == 3) {
263 <text>@RenderLoadmoreButton(galleryId)</text>
264 }
265
266 counter++;
267
268 <li class="product-gallery__media product-gallery__media--video swiper-slide"><iframe class="product-gallery__video" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen src="@productVideoEmbed5"></iframe></li>
269 }
270 @for (var a = 0; a < galleryImages.Length; a++) {
271 if (counter == 3) {
272 <text>@RenderLoadmoreButton(galleryId)</text>
273 }
274
275 counter++;
276
277 string path = galleryImages[a].Substring(galleryImages[a].IndexOf("\\files")).Replace("\\","/");
278 string imageXl = "/admin/public/getimage.ashx?image=" + path + "&compression=100&width=1500";
279 string imageMd = "/admin/public/getimage.ashx?image=" + path + "&compression=100&width=1175";
280 string imageSm = "/admin/public/getimage.ashx?image=" + path + "&compression=100&width=777";
281 string imageDefault = "/admin/public/getimage.ashx?image=" + path + "&compression=100&width=640&height=515&Crop=0";
282
283 <li class="product-gallery__media swiper-slide"><picture class="product-gallery__image-wrap"><source srcset="@imageXl" media="(min-width: 1500px)" /><source srcset="@imageMd" media="(min-width: 992px)" /><source srcset="@imageSm" media="(min-width: 768px)" /><img src="@imageDefault" class="product-gallery__image" loading="lazy" alt="" /></picture></li>
284 }
285 </ul><div class="product-gallery__navigation-wrap"><span class="product-gallery__pagination-fraction-wrap">@Translate("Translate_Product-gallery_Image_x_of_y") <span class="product-gallery__pagination-fraction"></span></span>
286 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images/gallery-arrow.svg"))) {
287 <span class="product-gallery__navigation product-gallery__navigation--prev">
288 @arrowSvg
289 @arrowSvg
290 </span>
291 }
292 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images/gallery-arrow.svg"))) {
293 <span class="product-gallery__navigation product-gallery__navigation--next">
294 @arrowSvg
295 @arrowSvg
296 </span>
297 }
298 </div></div></article>
299 @SnippetStart("JavascriptBottom")
300 <text>
301 @if (System.Web.HttpContext.Current.Items["swiperScriptLoaded"] != "true") {
302 System.Web.HttpContext.Current.Items["swiperScriptLoaded"] = "true";
303
304 if (
305 !string.IsNullOrWhiteSpace(productVideoEmbed) ||
306 !string.IsNullOrWhiteSpace(productVideoEmbed2) ||
307 !string.IsNullOrWhiteSpace(productVideoEmbed3) ||
308 !string.IsNullOrWhiteSpace(productVideoEmbed4) ||
309 !string.IsNullOrWhiteSpace(productVideoEmbed5)
310 ) {
311 <script src="https://player.vimeo.com/api/player.js"></script><script>
312 let activeVideo;
313
314 function stopVideo(e) {
315 const container = e.currentTarget ? e.currentTarget : e;
316 const video = container.querySelector('iframe');
317
318 if (video) {
319 const player = new Vimeo.Player(video);
320 player.pause();
321 }
322 }
323
324 function startVideo(e) {
325 const container = e.currentTarget ? e.currentTarget : e;
326 const video = container.querySelector('iframe');
327
328 if (video) {
329 if (activeVideo) {
330 activeVideo.pause();
331 }
332
333 const player = new Vimeo.Player(video);
334 player.play();
335 activeVideo = player;
336 }
337 }
338 </script>
339 }
340
341 <link rel="stylesheet" href="https://unpkg.com/swiper@8.2.2/swiper.min.css" /><script src="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js"></script><script>
342 const swipers = document.querySelectorAll('[data-action="swiper"]');
343 const loadMoreButtons = document.querySelectorAll('[data-action="load-more"]');
344
345 if (window.innerWidth > 768) {
346 const swipersWithVideos = Array.from(swipers).filter(x => x.querySelectorAll('.product-gallery__video').length > 0);
347
348 if (swipersWithVideos.length > 0) {
349 function onChange(changes, observer) {
350 changes.forEach(change => {
351 if (change.intersectionRatio > 0.2) {
352 const video = change.target.querySelector('iframe');
353 const player = new Vimeo.Player(video);
354 player.play();
355 }
356 });
357 }
358
359 const config = {
360 root: null,
361 rootMargin: '0px',
362 threshold: [0.2]
363 };
364
365 const observer = new IntersectionObserver(onChange, config);
366
367 Array.from(swipersWithVideos).forEach(swiperWithVideo => {
368 observer.observe(swiperWithVideo);
369 });
370 }
371
372 swipers.forEach(swiperContainer => {
373 const swiper = new Swiper(swiperContainer, {
374 slidesPerView: 'auto', // Slide sizes are controlled with css - not here
375 centeredSlides: false,
376 navigation: {
377 nextEl: '.product-gallery__navigation--next',
378 prevEl: '.product-gallery__navigation--prev',
379 },
380 pagination: {
381 el: '.product-gallery__pagination-fraction',
382 type: 'fraction'
383 },
384 speed: 500,
385 });
386
387 swiper.on('activeIndexChange',function(e) {
388 const previousSlide = e.slides[e.previousIndex];
389 const activeSlide = e.slides[e.activeIndex];
390 const previousIsVimeo = previousSlide.querySelector('iframe') ? true : false;
391 const activeIsVimeo = activeSlide.querySelector('iframe') ? true : false;
392
393 if (previousIsVimeo) {
394 stopVideo(previousSlide);
395 }
396
397 if (activeIsVimeo) {
398 startVideo(activeSlide);
399 }
400 });
401 });
402 } else {
403 const swipersWithVideos = Array.from(swipers).filter(x => x.querySelectorAll('.product-gallery__video').length > 0);
404
405 if (swipersWithVideos.length > 0) {
406 swipersWithVideos.forEach(swiperWithVideo => {
407 const swiperVideoElements = swiperWithVideo.querySelectorAll('.product-gallery__media--video');
408
409 swiperVideoElements.forEach(swiperVideoElement => {
410 swiperVideoElement.addEventListener('click',startVideo);
411 });
412 });
413 }
414 }
415
416 function loadMore(e) {
417 const loadMoreTarget = document.querySelector(e.currentTarget.getAttribute('data-load-more-target'));
418
419 if (loadMoreTarget) {
420 loadMoreTarget.classList.add('js-load-more');
421 }
422
423 e.currentTarget.removeEventListener('click', loadMore);
424 }
425
426 loadMoreButtons.forEach(loadMoreButton => {
427 loadMoreButton.addEventListener('click',loadMore);
428 });
429 </script>
430 }
431 </text>
432 @SnippetEnd("JavascriptBottom")
433 }
434
435
436 @{
437 bool hasDownloads = !string.IsNullOrWhiteSpace(GetString("Ecom:Product.CategoryField.Belaegning.ProduktRelevanteDownloads.Value.Clean"));
438 bool hasLinks = !string.IsNullOrWhiteSpace(GetString("Ecom:Product.CategoryField.Belaegning.ProduktOvrigtLinks.Value.Clean"));
439 }
440 <article class="product-tabs module module-grey-light"><nav class="product-tabs__navigation" role="tablist" data-action="tabs"><ul class="product-tabs__list" role="none"><li class="product-tabs__item" role="none"><a href="#tabVisualization-content" class="product-tabs__tab product-tabs__tab--active" role="tab" id="tabVisualization" aria-controls="tabVisualization-content" aria-selected="true"><span class="product-tabs__item-text">@Translate("Translate_Visualization")</span></a></li>
441 @if(Pageview.Area.ID == 1) {
442 <li class="product-tabs__item" role="none"><a href="#tabPrices-content" class="product-tabs__tab" role="tab" id="tabPrices" aria-controls="tabPrices-content" aria-selected="false"><span class="product-tabs__item-text">@Translate("RT-2.0_Priser_og_levering")</span></a></li>
443 }
444 @if (areaId != 7 && areaId != 8 && !disableSample) {
445 /* Show on all other than NO site */
446
447 <li class="product-tabs__item" role="none"><a href="#tabFreeSample-content" class="product-tabs__tab" role="tab" id="tabFreeSample" aria-controls="tabFreeSample-content" aria-selected="false"><span class="product-tabs__item-text">@Translate("Translate_Free_sample")</span></a></li>
448 }
449 <li class="product-tabs__item" role="none"><a href="#tabDatasheets-content" class="product-tabs__tab" role="tab" id="tabDatasheets" aria-controls="tabDatasheets-content" aria-selected="false"><span class="product-tabs__item-text">@Translate("Translate_Datasheets")</span></a></li>
450 @if (hasDownloads) {
451 <li class="product-tabs__item" role="none"><a href="#tabDownloads-content" class="product-tabs__tab" role="tab" id="tabDownloads" aria-controls="tabDownloads-content" aria-selected="false"><span class="product-tabs__item-text">@Translate("Translate_Downloads")</span></a></li>
452 }
453
454 @if (hasLinks && Pageview.Area.ID != 9) {
455 <li class="product-tabs__item" role="none"><a href="#tabOtherLinks-content" class="product-tabs__tab" role="tab" id="tabOtherLinks" aria-controls="tabOtherLinks-content" aria-selected="false"><span class="product-tabs__item-text">@Translate("Translate_Other_links")</span></a></li>
456 }
457 </ul></nav><div id="tabVisualization-content" class="product-tabs__tab-content product-tabs__tab-content--active" role="tabpanel" aria-hidden="false" aria-labelledby="tabVisualization"><div class="product-tabs__content">
458 @{
459 string textureHeadline = Translate("Translate_TextureTool_headline");
460 string textureImagePath = "/Files/Images/UltimaLandingpage/texture-tool.jpg";
461 string textureImageXl = "/admin/public/getimage.ashx?image=" + textureImagePath + "&compression=100&width=732";
462 string textureImageMd = "/admin/public/getimage.ashx?image=" + textureImagePath + "&compression=100&width=566";
463 string textureImageSm = "/admin/public/getimage.ashx?image=" + textureImagePath + "&compression=100&width=327";
464 string textureImageDefault = "/admin/public/getimage.ashx?image=" + textureImagePath + "&compression=100&width=727";
465 string texttureLink = "/Default.aspx?Id=" + Pageview.Area.Item["VisualiseringLink"].ToString() + "#brick=" + productNumber.Replace(" ", "") + "&viewmode=Wall";
466 }
467 <div class="rich-text"><h2 class="product-tabs__headline">@textureHeadline</h2><p>@Translate("Translate_TextureTool_body-text")</p><a href="@texttureLink" class="button button-simple">@Translate("Translate_Try-the-texture-tool")</a></div><picture class="product-tabs__image-wrap"><source srcset="@textureImageXl" media="(min-width: 1500px)" /><source srcset="@textureImageMd" media="(min-width: 992px)" /><source srcset="@textureImageSm" media="(min-width: 768px)" /><img src="@textureImageDefault" class="product-tabs__image" alt="@textureHeadline." loading="lazy" /></picture></div><div class="product-tabs__content">
468 @{
469 string visualizationHeadline = Translate("Translate_VisualizationTool_headline");
470 string visualizationImagePath = "/Files/Images/UltimaLandingpage/visualization-tool-multi.jpg";
471 string visualizationImageXl = "/admin/public/getimage.ashx?image=" + visualizationImagePath + "&compression=100&width=732";
472 string visualizationImageMd = "/admin/public/getimage.ashx?image=" + visualizationImagePath + "&compression=100&width=566";
473 string visualizationImageSm = "/admin/public/getimage.ashx?image=" + visualizationImagePath + "&compression=100&width=327";
474 string visualizationImageDefault = "/admin/public/getimage.ashx?image=" + visualizationImagePath + "&compression=100&width=727";
475 string visualizationLink = "/Default.aspx?Id=" + Pageview.Area.Item["VisualiseringLink"].ToString() + "#brick=" + productNumber.Replace(" ","") + "&viewmode=House";
476 }
477 <div class="rich-text"><h2 class="product-tabs__headline">@visualizationHeadline</h2><p>@Translate("Translate_VisualizationTool_body-text")</p><a href="@visualizationLink" class="button button-simple">@Translate("Translate_Try-the-visualization-tool")</a></div><picture class="product-tabs__image-wrap"><source srcset="@visualizationImageXl" media="(min-width: 1500px)" /><source srcset="@visualizationImageMd" media="(min-width: 992px)" /><source srcset="@visualizationImageSm" media="(min-width: 768px)" /><img src="@visualizationImageDefault" class="product-tabs__image" alt="@visualizationHeadline." loading="lazy" /></picture></div></div>
478 @if (GetInteger("Ecom:Product:Area.ID") != 7 && !disableSample) {
479 /* Show on all other than NO site */
480 <div id="tabFreeSample-content" class="product-tabs__tab-content" role="tabpanel" aria-hidden="true" aria-labelledby="tabFreeSample">
481 @RenderSnippet("ProductSampleForm")
482 </div>
483 }
484 <div id="tabDatasheets-content" class="product-tabs__tab-content" role="tabpanel" aria-hidden="true" aria-labelledby="tabDatasheets"><div class="rich-text"><h2 class="product-tabs__headline">@Translate("Translate_Datasheets")</h2><ul>
485 @{
486 try {
487 string[] files = System.IO.Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath("~\\files\\files\\varekatalog\\Belaegning\\" + productNumber.Replace(" ", "-") + "\\datablade\\" + GetString("Ecom:Product:Area.Name")));
488 int counter = 0;
489
490 if (files.Length > 0) {
491 foreach (string s in files) {
492 string filepath = s.Substring(s.IndexOf("\\files"), s.Length - s.IndexOf("\\files"));
493 string filename = filepath.Substring(filepath.IndexOf("datablade"), filepath.Length - filepath.IndexOf("datablade"));
494
495 <li><a href="@filepath" target="_blank">Hent datablad (@filename.Replace("datablade\\" + GetString("Ecom:Product:Area.Name") + "\\", "").Replace("-", " ").Replace("_", " ").Replace(".pdf", ""))</a></li>
496
497 counter++;
498 }
499 }
500 } catch {
501
502 }
503 }
504 </ul></div></div>
505 @if (hasDownloads) {
506 <div id="tabDownloads-content" class="product-tabs__tab-content" role="tabpanel" aria-hidden="true" aria-labelledby="tabDownloads"><div class="rich-text"><h2 class="product-tabs__headline">@Translate("Translate_Downloads")</h2>
507 @GetString("Ecom:Product.CategoryField.Belaegning.ProduktRelevanteDownloads.Value.Clean")
508 </div></div>
509 }
510
511 <div id="tabFindDealer-content" class="product-tabs__tab-content" role="tabpanel" aria-hidden="true" aria-labelledby="tabFindDealer"><div class="product-tabs__content">
512 @{
513 string dealerLink = Pageview.Area.Item["FindForhandlerLink"].ToString();
514
515 if (areaId != 9) {
516 /* Show on all other than DE site */
517 string findDealerHeadline = Translate("Translate_Find-dealer_headline");
518 string findDealerBodyText = Translate("Translate_Find-dealer_bodytext");
519 string formAction = "/Default.aspx?Id=" + dealerLink;
520 string inputPlaceholder = Translate("Translate_Find_dealer_city-zip");
521
522 <div class="clickdimensions-form"><div class="rich-text"><h2 class="product-tabs__headline">@findDealerHeadline</h2><p>
523 @findDealerBodyText
524 </p></div><form action="@formAction" method="post" style="display: block;"><div class="form-row"><input type="text" name="adr" id="adr" placeholder=" " /><label for="adr">@inputPlaceholder</label></div><div class="form-row"><button type="submit">@Translate("Translate_Find_dealer")</button></div></form></div>
525 } else {
526 /* Show only on DE site */
527 string verkaufHeadline = Translate("Translate_Verkauf_mauerziegel_headline");
528 string verkaufBodyText = Translate("Translate_Verkauf_mauerziegel_bodytext");
529 string verkaufLinkText = Translate("Translate_Verkauf_mauerziegel_linktext");
530 string verkaufLink = "/Default.aspx?Id=" + dealerLink;
531
532 <div class="rich-text">
533 @if (!string.IsNullOrWhiteSpace(verkaufHeadline)) {
534 <h2 class="product-tabs__headline">@verkaufHeadline</h2>
535 }
536 @if (!string.IsNullOrWhiteSpace(verkaufBodyText)) {
537 <p>@verkaufBodyText</p>
538 }
539 <a href="@verkaufLink">@verkaufLinkText</a></div>
540 }
541 }
542 </div></div>
543 @if (hasLinks && Pageview.Area.ID != 9) {
544 <div id="tabOtherLinks-content" class="product-tabs__tab-content" role="tabpanel" aria-hidden="true" aria-labelledby="tabOtherLinks"><div class="rich-text"><h2 class="product-tabs__headline">@Translate("Translate_Other_links")</h2>
545 @GetString("Ecom:Product.CategoryField.Belaegning.ProduktOvrigtLinks.Value.Clean")
546 </div></div>
547 }
548 @if(Pageview.Area.ID == 1) {
549 <div id="tabPrices-content" class="product-tabs__tab-content" role="tabpanel" aria-hidden="true" aria-labelledby="tabPrices"><div class="rich-text"><h2>@Translate("RT-2.0_Priser_og_levering")</h2>
550 @{
551 double priceprm2 = Convert.ToDouble(GetString("Ecom:Product.Price.PriceWithVAT")) * Convert.ToDouble(GetString("Ecom:Product.CategoryField.Belaegning.ProduktAntalM2.Value"));
552
553 string sPriceprm2 = priceprm2.ToString("0,0.00");
554 }
555 <div class="price-info"><span>@Translate("RT-2.0_BelaegningShop_PrisPrM2")</span>
556 @if (Pageview.Area.ID == 1) {
557 <span class="price" itemprop="price">@sPriceprm2</span>
558 } else {
559 <span class="price" itemprop="Price">@GetString("Ecom:Product.Price.PriceWithVATFormatted")</span>
560 }
561 <small>@Translate("RT-2.0_BelaegningShop_PrisErInklMomsOgEksklFragt")</small></div><div class="format-and-consumption">
562 @Translate("RT-2.0_BelaegningShop_Format") @GetString("Ecom:Product.ShortDescription").Replace("<p>","").Replace("</p>","") | @Translate("RT-2.0_BelaegningShop_ForbrugPrM2Ca") @GetString("Ecom:Product.CategoryField.Belaegning.ProduktForbrug.Value") @Translate("RT_2.0_BelaegningShop_ForbrugStk")
563 </div>
564 @if (GetInteger("Ecom:Product:Area.ID") == 1 ) {
565 string shopBelaegningPageID = "";
566
567 if (GetInteger("Ecom:Product:Area.ID") == 1) {
568 shopBelaegningPageID = "147";
569 } else if (GetInteger("Ecom:Product:Area.ID") == 9) {
570 shopBelaegningPageID = "2346";
571 }
572
573 <div class="product-header__shop-link"><a href='@("/Default.aspx?Id=")@shopBelaegningPageID@("&ProductID=")@GetString("Ecom:Product.ID")' class="button button-simple">@Translate("RT-2.0_BelaegningShop_KoebBelaegning")</a></div>
574 }
575 </div></div>
576 }
577 </article>
578 @SnippetStart("JavascriptBottom")
579 @if (System.Web.HttpContext.Current.Items["tabsScriptLoaded"] != "true") {
580 System.Web.HttpContext.Current.Items["tabsScriptLoaded"] = "true";
581
582 <script>
583 const keycode = {
584 arrowRight: 39,
585 arrowLeft: 37,
586 home: 36,
587 end: 35
588 };
589
590 function openTab(e) {
591 if (e.currentTarget) {
592 e.preventDefault();
593 }
594
595 const tab = e.currentTarget ? e.currentTarget : e;
596 const tabContent = document.getElementById(tab.getAttribute('aria-controls').replace('#', ''));
597
598 if (tabContent) {
599 const activeTab = tab.parentNode.parentNode.querySelector('.product-tabs__tab--active');
600
601 if (activeTab) {
602 activeTab.classList.remove('product-tabs__tab--active');
603 activeTab.setAttribute('aria-selected', false);
604 activeTab.setAttribute('tabindex', -1);
605
606 const activeTabContent = document.getElementById(activeTab.getAttribute('aria-controls').replace('#', ''));
607
608 if (activeTabContent) {
609 activeTabContent.classList.remove('product-tabs__tab-content--active');
610 activeTabContent.setAttribute('aria-hidden', true);
611 }
612 }
613
614 tab.classList.add('product-tabs__tab--active');
615 tab.removeAttribute('tabindex');
616 tab.setAttribute('aria-selected', true);
617 tab.focus();
618 tabContent.classList.add('product-tabs__tab-content--active');
619 tabContent.setAttribute('aria-hidden', false);
620 history.pushState({}, document.title, `#${tab.getAttribute('aria-controls')}`);
621 }
622 }
623
624 function openTabByHashId() {
625 if (window.location.hash.indexOf('tab') > -1) {
626 const tabContent = document.getElementById(window.location.hash.replace('#', ''));
627
628 if (tabContent) {
629 const tab = document.getElementById(tabContent.getAttribute('aria-labelledby'));
630 openTab(tab);
631 }
632 }
633 }
634
635 const tabsContainer = document.body.querySelectorAll('[data-action="tabs"]');
636
637 if (tabsContainer) {
638 for (let i = 0; i < tabsContainer.length; i++) {
639 const tabs = tabsContainer[i].querySelectorAll('[role="tab"]');
640
641 for (let t = 0; t < tabs.length; t++) {
642 tabs[t].addEventListener('click', openTab);
643 }
644 }
645 }
646
647 if (window.location.hash.indexOf('tab') > -1) {
648 openTabByHashId();
649 }
650
651 window.addEventListener('hashchange', openTabByHashId, false);
652
653 window.addEventListener('keydown', event => {
654 const focusedElement = document.activeElement;
655 const tabs = document.activeElement.closest('.product-tabs__navigation');
656
657 if (focusedElement && tabs) {
658 if (event.keyCode === keycode.arrowLeft) {
659 // Open prevoius tab
660 if (focusedElement.closest('li').previousElementSibling && focusedElement.closest('li').previousElementSibling.querySelector('.tab')) {
661 openTab(focusedElement.closest('li').previousElementSibling.querySelector('.product-tabs__tab'));
662 }
663 }
664 if (event.keyCode === keycode.arrowRight) {
665 // Open next tab
666 if (focusedElement.closest('li').nextElementSibling && focusedElement.closest('li').nextElementSibling.querySelector('.tab')) {
667 openTab(focusedElement.closest('li').nextElementSibling.querySelector('.product-tabs__tab'));
668 }
669 }
670 if (event.keyCode === keycode.home) {
671 // Open first tab
672 if (tabs.querySelector('li:first-child .product-tabs__tab')) {
673 event.preventDefault();
674 openTab(tabs.querySelector('li:first-child .product-tabs__tab'));
675 }
676 }
677 if (event.keyCode === keycode.end) {
678 // Open last tab
679 if (tabs.querySelector('li:last-child .product-tabs__tab')) {
680 event.preventDefault();
681 openTab(tabs.querySelector('li:last-child .product-tabs__tab'));
682 }
683 }
684 }
685 });
686 </script>
687 }
688 @SnippetEnd("JavascriptBottom")
689
690
691 <div class="product-cta">
692 @if (areaId != 7 && areaId != 8 && !disableSample) {
693 if (areaId == 1) {
694 <text>@RenderSnippet("ProductSampleCart")</text>
695 } else {
696 <a href="#tabFreeSample-content" class="product-cta__link">
697 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images/gallery-arrow.svg"))) {
698 <span class="icon icon-arrow">@arrowSvg</span>
699 }
700 <span class="product-cta__link-text">@Translate("Translate_Free-sample")</span>
701 @if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath("/Files/Templates/Designs/randers-tegl/images/gallery-arrow.svg"))) {
702 <span class="icon icon-arrow">@arrowSvg</span>
703 }
704 </a>
705 }
706 }
707 @RenderSnippet("ProductQuestionCTA")
708 </div>
709
710 @if (sampleIsInCart && System.Web.HttpContext.Current.Request.Cookies["sampleCartTeaserShown"] == null) {
711 System.Web.HttpCookie sampleCookie = new System.Web.HttpCookie("sampleCartTeaserShown");
712 sampleCookie.Value = "true";
713 sampleCookie.Expires = DateTime.Now.AddHours(1);
714 System.Web.HttpContext.Current.Response.Cookies.Add(sampleCookie);
715
716 <style>
717 .sample-cart-teaser {
718 width: 100%;
719 height: 100%;
720 position: fixed;
721 z-index: 100;
722 top: 0;
723 left: 0;
724 display: flex;
725 justify-content: center;
726 align-items: center;
727 background-color: rgba(0, 0, 0, 0.2);
728 }
729
730 .sample-cart-teaser.js-hide {
731 display: none;
732 pointer-events: none;
733 }
734
735 .sample-cart-teaser__message {
736 max-width: 800px;
737 padding: 24px;
738 background-color: #222;
739 position: relative;
740 color: #fff;
741 }
742
743 @@media (min-width: 768px) {
744 .sample-cart-teaser__message {
745 padding: 48px;
746 }
747 }
748
749 @@media (max-width: 880px) {
750
751 .sample-cart-teaser__message {
752 max-width: 80%;
753 }
754 }
755
756 @@media (max-width: 767.98px) {
757 .sample-cart-teaser__message .upper {
758 display: none;
759 }
760 }
761
762 @@media (min-width: 768px) {
763 .sample-cart-teaser__message .lower {
764 display: none;
765 }
766 }
767
768 .sample-cart-teaser__message p:last-of-type {
769 padding-bottom: 0;
770 }
771
772 .sample-cart-teaser__close {
773 position: absolute;
774 top: 24px;
775 right: 24px;
776 cursor: pointer;
777 }
778
779 @@media (min-width: 768px) {
780 .sample-cart-teaser__close {
781 top: 48px;
782 right: 48px;
783 }
784 }
785
786 .sample-cart-teaser__close svg {
787 width: 16px;
788 height: 16px;
789 }
790
791 .sample-cart-teaser__close path {
792 fill: #fff;
793 }
794 </style><div class="sample-cart-teaser"><div class="sample-cart-teaser__message"><p>Kære kunde</p><p>
795 Din prøve er lagt i kurven i <span class="upper">øverste</span><span class="lower">nederste</span> højre hjørne.
796 </p><p>
797 Vi gør opmærksom på, at der er et ekspeditions- og fragtgebyr på kr. 75,- per vareprøve.
798 <br />
799 Du kan bestille flere prøver eller tjekke ud nu ved at trykke på kurven.
800 </p><p>
801 Tak for din interesse i vores produkter!
802 </p><span id="sampleCartClose" class="sample-cart-teaser__close"><svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.996 15.996"><path d="M0 1.415L1.414 0l14.578 14.577-1.415 1.414z"></path><path d="M1.418 15.996L.004 14.582 14.58.004l1.414 1.414z"></path></svg></span></div></div><script>
803 const sampleCartCloseBtn = document.getElementById('sampleCartClose');
804
805 if (sampleCartCloseBtn) {
806 sampleCartCloseBtn.addEventListener('click', function(e) {
807 const teaser = e.currentTarget.closest('.sample-cart-teaser');
808
809 if (teaser) {
810 teaser.classList.add('js-hide');
811 }
812 });
813 }
814 </script>
815 }
816
817 @helper RenderLoadmoreButton(string galleryId) {
818 <li class="product-gallery__media product-gallery__media--load-more"><a data-action="load-more" data-load-more-target="#@galleryId" class="button button-simple">@Translate("Translate_Product_load-more-images")</a></li>
819 }
820
Belægning Uderum
i tegl
Teglbelægning er et ekstremt modstandsdygtigt naturmateriale, der fuldender stilrene uderum som terrasser, havegange og indkørsler. Belægning i tegl patinerer smukt med tiden og er stort set vedligeholdelsesfrit.
Udlev drømmen om en ny terrasse
Mursten Fuldmuret
byggeri
Den moderne villa er fuldmuret. Fuldmuret byggeri er robust og skabt til det skandinaviske klima, fordi mursten kan noget som ingen andre byggematerialer kan. Fuldmuring giver et sundt indeklima, energivenlighed og generationers holdbarhed.
Se hvorfor trivsel er noget man bygger