Label

SEETEX®

VORES MEMBRAN ER LIGEGLAD MED VEJRET.

SEETEX®

Vejret er en uundgåelig del af den gode jagt- og naturoplevelse. SEETEX® beskytter dig mod vinden og har vandtæthed og åndbarhed på 10.000/10.000. Det betyder, at membranen holder 10.000 mm vandtryk over et døgn, og samtidig lader den 10.000 gram fugt fordampe pr. kvadratmeter.

Med andre ord holder SEETEX® dig tør uanset vejret.

WINDPROOF.

WATERPROOF.

BREATHABLE.

 

Real. Raw. Rugged.

Error executing template "Designs/Seeland/Paragraph/ParagraphContainer.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_31cb8e9fdb4d4ab38c3c9f1a5884591c.Execute() in D:\Dynamicweb.net\Solutions\SeelandInt-Production\Files\Templates\Designs\Seeland\Paragraph\ParagraphContainer.cshtml:line 414
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.Collections.Generic 3 @using System 4 @using System.Text.RegularExpressions 5 6 7 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 8 @using Dynamicweb.Frontend 9 @using Dynamicweb.Ecommerce.Frontend; 10 @using System.Text.RegularExpressions; 11 12 @helper RenderContent(ItemViewModel item, bool isCarousel = false) 13 { 14 string cardClass = item.GetBoolean("ShowAsCard") ? "paragraph-card" : "cell"; 15 //cardClass = Pageview.Device.ToString() != "Tablet" ? cardClass : "cell"; 16 17 string contentPosition = item.GetList("ContentPositions").SelectedValue; 18 19 20 if (item.GetBoolean("IsProduct")) 21 { 22 <div class="@cardClass product-box"> 23 @RenderProduct(item) 24 25 </div> 26 } 27 else 28 { 29 switch (contentPosition) 30 { 31 case "title-top": 32 <div class="@cardClass"> 33 @RenderHeading(item) 34 @RenderImage(item, isCarousel) 35 @RenderSubTitle(item) 36 @RenderAnimatedContent(item) 37 @RenderText(item) 38 @RenderModule(item) 39 </div> 40 @RenderButton(item) 41 break; 42 case "image-left": 43 <div class="grid"> 44 <div class="col-3"> 45 @RenderImage(item, isCarousel) 46 </div> 47 <div class="col-9"> 48 @RenderHeading(item) 49 @RenderSubTitle(item) 50 @RenderAnimatedContent(item) 51 @RenderText(item) 52 @RenderModule(item) 53 @RenderButton(item) 54 </div> 55 </div> 56 break; 57 case "image-right": 58 <div class="grid"> 59 <div class="col-9"> 60 @RenderHeading(item) 61 @RenderSubTitle(item) 62 @RenderAnimatedContent(item) 63 @RenderText(item) 64 @RenderModule(item) 65 @RenderButton(item) 66 </div> 67 <div class="col-3"> 68 @RenderImage(item, isCarousel) 69 </div> 70 </div> 71 break; 72 case "all-centered": 73 <div class="u-ta-center @cardClass"> 74 @RenderImage(item, isCarousel) 75 @RenderHeading(item) 76 @RenderSubTitle(item) 77 @RenderAnimatedContent(item) 78 @RenderText(item) 79 @RenderModule(item) 80 </div> 81 @RenderButton(item) 82 break; 83 case "middle-center": 84 case "middle-left": 85 @*Part of styles is placed in Paragraph.cshtml & ParagraphContainer.cshtml*@ 86 <div class="@(contentPosition == "middle-center" ? "align-self-center" : "")"> 87 <div class="@cardClass"> 88 <div class="@(contentPosition == "middle-center" ? "u-ta-center" : "")"> 89 @RenderImage(item, isCarousel) 90 @RenderHeading(item) 91 @RenderSubTitle(item) 92 @RenderAnimatedContent(item) 93 @RenderText(item) 94 @RenderModule(item) 95 </div> 96 </div> 97 @RenderButton(item) 98 </div> 99 break; 100 case "title-under-text": 101 @*Part of styles is placed in Paragraph.cshtml & ParagraphContainer.cshtml*@ 102 <div class="@(contentPosition == "middle-center" ? "align-self-center" : "")"> 103 <div class="@cardClass"> 104 <div class="@(contentPosition == "middle-center" ? "u-ta-center" : "")"> 105 @RenderImage(item, isCarousel) 106 @RenderSubTitle(item) 107 @RenderAnimatedContent(item) 108 @RenderText(item) 109 @RenderHeading(item) 110 @RenderModule(item) 111 </div> 112 </div> 113 @RenderButton(item) 114 </div> 115 break; 116 default: 117 <div class="@cardClass"> 118 @RenderImage(item, isCarousel) 119 @RenderHeading(item) 120 @RenderSubTitle(item) 121 @RenderAnimatedContent(item) 122 @RenderText(item) 123 @RenderModule(item) 124 </div> 125 @RenderButton(item) 126 break; 127 } 128 } 129 } 130 131 @helper RenderHeading(ItemViewModel item) 132 { 133 if (item.GetBoolean("ShowTitle") != false && !string.IsNullOrEmpty(item.GetString("Title"))) 134 { 135 string headerMargin = item.GetString("Text") != "" && item.GetString("Image") != "" ? "u-margin-bottom" : ""; 136 headerMargin = Model.GetModuleOutput() == "" ? headerMargin : "u-margin-bottom"; 137 string url = item.GetString("Link"); 138 string titleStyle = item.GetList("TitleStyle").SelectedValue; 139 string badgeStyle = item.GetList("BadgeColor").SelectedValue; 140 141 if (!String.IsNullOrEmpty(url)) 142 { 143 <a href="@url"> 144 <h2 class="u-no-margin @headerMargin @titleStyle @badgeStyle">@item.GetString("Title")</h2> 145 </a> 146 } 147 else 148 { 149 <h2 class="u-no-margin @headerMargin @titleStyle @badgeStyle">@item.GetString("Title")</h2> 150 } 151 } 152 } 153 154 @helper RenderButton(ItemViewModel item) 155 { 156 string url = item.GetString("Link"); 157 string linkText = item.GetString("LinkText"); 158 string secondaryUrl = item.GetString("SecondaryLink"); 159 string secondaryLinkText = item.GetString("SecondaryLinkText"); 160 string footerCssClass = ""; 161 string cardFooterClass = item.GetBoolean("ShowAsCard") ? "paragraph-card-footer" : "cell-footer"; 162 cardFooterClass = Pageview.Device.ToString() != "Tablet" ? cardFooterClass : ""; 163 string alingClass = ""; 164 165 if (item.GetList("ContentPositions").SelectedValue == "all-centered" || item.GetList("ContentPositions").SelectedValue == "middle-center") 166 { 167 footerCssClass = "justify-center"; 168 alingClass = "justify-center"; 169 } 170 171 if ((!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(linkText)) || (!string.IsNullOrEmpty(secondaryUrl) && !string.IsNullOrEmpty(secondaryLinkText))) 172 { 173 <div class="cell @footerCssClass @cardFooterClass"> 174 <div class="u-margin-top--lg u-margin-bottom @alingClass"> 175 176 @if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(linkText)) 177 { 178 string buttonStyle = !String.IsNullOrEmpty(item.GetList("ButtonDesign").SelectedValue) ? item.GetList("ButtonDesign").SelectedValue : "primary"; 179 if (url.Contains("http")) 180 { 181 <a href="@url" class="btn btn--@buttonStyle btn btn--arrow dw-mod" target="_blank">@linkText</a> 182 } 183 else if (url.Contains("/")) 184 { 185 <a href="@url" class="btn btn--@buttonStyle btn btn--arrow dw-mod" download>@linkText</a> 186 } 187 else 188 { 189 <a href="@url" class="btn btn--@buttonStyle btn btn--arrow dw-mod">@linkText</a> 190 } 191 } 192 193 @if (!string.IsNullOrEmpty(secondaryUrl) && !string.IsNullOrEmpty(secondaryLinkText)) 194 { 195 string secondaryButtonStyle = !String.IsNullOrEmpty(item.GetList("SecondaryButtonDesign").SelectedValue) ? item.GetList("SecondaryButtonDesign").SelectedValue : "primary"; 196 if (secondaryUrl.Contains("http")) 197 { 198 <a href="@secondaryUrl" class="btn btn--@secondaryButtonStyle dw-mod" target="_blank">@secondaryLinkText</a> 199 } 200 else if (secondaryUrl.Contains("/")) 201 { 202 <a href="@secondaryUrl" class="btn btn--@secondaryButtonStyle dw-mod" download>@secondaryLinkText</a> 203 } 204 else 205 { 206 <a href="@secondaryUrl" class="btn btn--@secondaryButtonStyle dw-mod">@secondaryLinkText</a> 207 } 208 } 209 </div> 210 </div> 211 } 212 else 213 { 214 <div class="cell-footer @footerCssClass @cardFooterClass"></div> 215 } 216 } 217 218 @helper RenderSubTitle(ItemViewModel item) 219 { 220 if (!string.IsNullOrWhiteSpace(item.GetString("AnimatedSubtitle"))) 221 { 222 <h3 class="two-boxes__box__content__title" data-module="waypoints" data-offset="100%">@item.GetString("AnimatedSubtitle")</h3> 223 224 } 225 } 226 227 @helper RenderText(ItemViewModel item) 228 { 229 if (!string.IsNullOrWhiteSpace(item.GetString("Text"))) 230 { 231 @item.GetString("Text") 232 } 233 } 234 235 @helper RenderAnimatedContent(ItemViewModel item) 236 { 237 if (!string.IsNullOrWhiteSpace(item.GetString("AnimatedContent"))) 238 { 239 <p class="two-boxes__box__content__text" data-module="waypoints" data-offset="100%">@item.GetString("AnimatedContent")</p> 240 241 } 242 } 243 244 @helper RenderModule(ItemViewModel item) 245 { 246 @Model.GetModuleOutput(); 247 } 248 249 @helper RenderImage(ItemViewModel item, bool isCarousel) 250 { 251 if (!string.IsNullOrEmpty(item.GetString("Image")) && item.GetList("ImageStyle").SelectedValue != "background") 252 { 253 string url = item.GetString("Link"); 254 255 <div class="u-margin-bottom"> 256 @if (!String.IsNullOrEmpty(url)) 257 { 258 <a href="@url"> 259 @RenderImageElement(item, isCarousel) 260 </a> 261 } 262 else 263 { 264 @RenderImageElement(item, isCarousel) 265 } 266 </div> 267 } 268 } 269 270 @helper RenderImageElement(ItemViewModel item, bool isCarousel) 271 { 272 string image = item.GetFile("Image") != null ? item.GetFile("Image").PathUrlEncoded : ""; 273 string imageFilterColor = item.GetList("ColorForTheFilter").SelectedValue != null ? item.GetList("ColorForTheFilter").SelectedValue : "none"; 274 string imageFilterPrimary = item.GetList("ImageFilterPrimary").SelectedValue != null ? item.GetList("ImageFilterPrimary").SelectedValue : "none"; 275 string imageFilterSecondary = item.GetList("ImageFilterSecondary").SelectedValue != null ? item.GetList("ImageFilterSecondary").SelectedValue : "none"; 276 string imageFilterBall = item.GetList("ImageStyle").SelectedValue == "ball" ? "image-filter--ball" : ""; 277 string altText = item.GetString("Title"); 278 string imgCssClass = ""; 279 string imgCrop = !string.IsNullOrEmpty(item.GetList("ImageCrop").SelectedValue) ? item.GetList("ImageCrop").SelectedValue : "5"; 280 bool fillCanvas = item.GetBoolean("FillCanvas") != null ? item.GetBoolean("FillCanvas") : true; 281 string fillCanvasString = fillCanvas == true ? "&amp;FillCanvas=true" : ""; 282 string imageBoxWidth = "480"; 283 int imageWidth = Int32.Parse(item.GetList("Width").SelectedValue) < 8 ? 620 : 1240; 284 int imageHeight = Int32.Parse(item.GetList("Width").SelectedValue) < 8 ? 496 : 950; 285 string placeHolderImage = "/Files/Images/placeholder.gif"; 286 287 if (imageFilterPrimary == "colorize") 288 { 289 imageFilterPrimary = imageFilterColor; 290 } 291 292 if (item.GetList("ContentPositions").SelectedValue == "image-centered" || item.GetList("ContentPositions").SelectedValue == "all-centered" || item.GetList("ContentPositions").SelectedValue == "middle-center") 293 { 294 imgCssClass = "cell-img--centered"; 295 } 296 297 <div class="image image-filter image-filter--@imageFilterPrimary @imageFilterBall dw-mod js-main-image-filter @(item.GetList("ContentPositions").SelectedValue == "middle-center" ? "u-middle" : "")"> 298 <div class="image-filter image-filter--@imageFilterSecondary @imageFilterBall dw-mod"> 299 @if (item.GetList("ImageStyle").SelectedValue == "ball") 300 { 301 imgCssClass += " cell-img--ball"; 302 if (!isCarousel) 303 { 304 <img class="cell-img @imgCssClass lazy-img lazy-bg" src="@placeHolderImage" data-src-md="/Admin/Public/GetImage.ashx?width=@imageBoxWidth&amp;height=@imageBoxWidth&amp;crop=@imgCrop&amp;Compression=75&amp;DoNotUpscale=true&amp;FillCanvas=true&amp;image=@image" alt="@altText"> 305 } 306 else 307 { 308 <img class="cell-img @imgCssClass" src="/Admin/Public/GetImage.ashx?width=@imageBoxWidth&amp;height=@imageBoxWidth&amp;crop=@imgCrop&amp;Compression=75&amp;DoNotUpscale=true&amp;image=@image" alt="@altText"> 309 } 310 } 311 else 312 { 313 string retinaImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth * 2 + "&amp;height=" + imageHeight * 2 + "&amp;crop=" + imgCrop + "&amp;Compression=75" + fillCanvasString + "&amp;DoNotUpscale=true&amp;image=" + image; 314 string largeImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&amp;height=" + imageHeight + "&amp;crop=" + imgCrop + "&amp;Compression=75" + fillCanvasString + "&amp;DoNotUpscale=true&amp;image=" + image; 315 string smallImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&amp;height=" + imageHeight + "&amp;crop=" + imgCrop + "&amp;Compression=75" + fillCanvasString + "&amp;DoNotUpscale=true&amp;image=" + image; 316 317 if (!isCarousel) 318 { 319 320 var extension = Regex.Match(image, @".*\.svg?$"); 321 322 if (extension.Success) 323 { 324 <img src="@item.GetFile("Image")" /> 325 } 326 else 327 { 328 329 // FOCAL POINTS CONTAINER BACKGROUND IMAGE 330 var containerImage = Model.Item.GetFile("Image"); 331 var containerParameters = ""; 332 if (!string.IsNullOrEmpty(Convert.ToString(containerImage))) 333 { 334 containerParameters = containerImage.GetFocalPointParameters(); 335 } 336 337 var bigImageHeight = ""; 338 if (Model.Item.GetList("Height").SelectedValue != "screen") 339 { 340 bigImageHeight = "&height=600"; 341 } 342 343 <img class="@imgCssClass lazy-img lazy-bg" data-src-xxs="@retinaImage&width=750&height=850&crop=7&@containerParameters" data-src-xs="@retinaImage&width=980&crop=7&@containerParameters" 344 data-src-sm="@retinaImage&width=980&height=1024&crop=7&@containerParameters" data-src-md="@retinaImage&width=1280&height=1366&crop=7&@containerParameters" data-src-lg="@retinaImage&width=1280&crop=7&@containerParameters" 345 data-src-xl="@retinaImage&width=1440&crop=7&@containerParameters" data-src-xxl="@retinaImage&width=1920&crop=7&@containerParameters@bigImageHeight" data-alt="" /> 346 @*<img class="@imgCssClass dw-mod lazy-img lazy-bg" src="@placeHolderImage" data-src-md="@largeImage&width=768" data-src-xl="@retinaImage&width=1024" data-src-small="@smallImage&width=768" alt="@altText">*@ 347 348 } 349 350 } 351 else 352 { 353 <img class="@imgCssClass" src="@largeImage" alt="@altText"> 354 } 355 } 356 </div> 357 </div> 358 } 359 360 @helper RenderProduct(ItemViewModel item) 361 { 362 var products = item.GetValue("Product") as List<ProductViewModel>; 363 foreach (var product in products) 364 { 365 var productService = Dynamicweb.Ecommerce.Services.Products; 366 var productById = productService.GetProductById(product.Id, string.Empty, false); 367 368 string path = string.Empty; 369 370 if (!string.IsNullOrEmpty(productById.GetProductFieldValue("ResourceIds").ToString())) 371 { 372 try 373 { 374 string[] images = productById.GetProductFieldValue("ResourceIds").ToString().Split(','); 375 path = "/Admin/Public/GetImage.ashx?Image=/files/images/inriver/" + ((images.Any()) ? images[0] : string.Empty) + "&altFmImage_path=/Files/Images/no-image.png&width=750&height=750"; 376 } 377 catch 378 { 379 } 380 } 381 string shopId = Pageview.Area.Item["ShopId"].ToString(); 382 string url = SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?ID=" + shopId + "&ProductID=" + product.Id); 383 384 385 string productColor = productById.GetProductFieldValue("ProductColor").ToString(); 386 string currenctyCode = Dynamicweb.Frontend.PageView.Current().Area.EcomCurrencyId; 387 string countryCode = Dynamicweb.Frontend.PageView.Current().Area.EcomCountryCode; 388 389 390 <a href="@url" class="related__col product-thumbnail product-box md-6 md-offset-1 xxl-5"> 391 <div class="product-thumbnail__image lazy-img" data-src-xs="@path" data-alt="@product.Name"></div> 392 <h3 class="product-thumbnail__title">@product.Name</h3> 393 <h5 class="product-thumbnail__color">@productColor</h5> 394 <h4 class="product-thumbnail__price">@productById.GetPrice(currenctyCode, countryCode).PriceWithVATFormatted</h4> 395 <span class="btn btn--add-to-basket">@Translate("(Ribbon)Show product", "Vis produkt")</span> 396 </a> 397 } 398 399 } 400 401 402 @{ 403 string fontColor = !string.IsNullOrEmpty(Model.Item.GetList("FontColor").SelectedValue) ? "u-" + Model.Item.GetList("FontColor").SelectedValue : ""; 404 string backgroundColor = !string.IsNullOrEmpty(Model.Item.GetList("BackgroundColor").SelectedValue) ? "u-" + Model.Item.GetList("BackgroundColor").SelectedValue + "--bg " : ""; 405 406 string paragraphContainerClasses = ""; 407 string containerClasses = ""; 408 string gridClasses = "grid flex "; 409 410 string spacingSize = Model.Item.GetList("Spacing") != null && Model.Item.GetList("Spacing").SelectedValue != "" ? Model.Item.GetList("Spacing").SelectedValue : "lg"; 411 string placeHolderImage = "/Files/Images/placeholder.gif"; 412 int columnCount = 0; 413 int paragraphCount = 0; 414 int totalParagraphs = Model.Item.GetItems("Paragraph").Count; 415 int totalSlides = 1; 416 417 switch (Model.Item.GetList("Width").SelectedValue) 418 { 419 case "center": 420 containerClasses += "center-container paragraph-container "; 421 paragraphContainerClasses += " " + fontColor + " " + backgroundColor; 422 break; 423 case "full": 424 containerClasses += fontColor + " " + backgroundColor + " "; 425 paragraphContainerClasses += "paragraph-container--full-width "; 426 break; 427 case "combi": 428 paragraphContainerClasses += "paragraph-container--full-width " + fontColor + " " + backgroundColor + " "; 429 containerClasses += "center-container paragraph-container "; 430 break; 431 default: 432 paragraphContainerClasses += "center-container "; 433 break; 434 } 435 436 if (spacingSize == "none") 437 { 438 containerClasses += "paragraph-container--spacing-none "; 439 } 440 441 //background 442 string containerBackgroundImage = ""; 443 string containerBackgroundImageSmall = ""; 444 string containerBackgroundImageFilterColor = Model.Item.GetList("ColorForTheFilter").SelectedValue != null ? Model.Item.GetList("ColorForTheFilter").SelectedValue : "none"; 445 string containerBackgroundImageFilterPrimary = Model.Item.GetList("ImageFilterPrimary").SelectedValue != null ? Model.Item.GetList("ImageFilterPrimary").SelectedValue : "none"; 446 string containerBackgroundImageFilterSecondary = Model.Item.GetList("ImageFilterSecondary").SelectedValue != null ? Model.Item.GetList("ImageFilterSecondary").SelectedValue : "none"; 447 var bgImgClass = "bg-container-img"; 448 var isFixedClass = ""; 449 450 if (containerBackgroundImageFilterPrimary == "colorize") 451 { 452 containerBackgroundImageFilterPrimary = containerBackgroundImageFilterColor; 453 } 454 455 if (Model.Item.GetFile("BackgroundImage") != null) 456 { 457 var width = "1920"; 458 var height = "480"; 459 460 if (Model.Item.GetBoolean("IsFixed")) 461 { 462 isFixedClass = "fixed"; 463 } 464 465 if (Model.Item.GetBoolean("HeroPicture")) 466 { 467 width = "1920"; 468 height = "1200"; 469 bgImgClass = "front-hero"; 470 } 471 containerBackgroundImage = "/Admin/Public/GetImage.ashx?&amp;crop=0&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + Model.Item.GetFile("BackgroundImage").PathUrlEncoded; 472 containerBackgroundImageSmall = "/Admin/Public/GetImage.ashx?width=1000&amp;height=850&amp;crop=0&amp;&amp;FillCanvas=TrueCompression=85&amp;DoNotUpscale=true&amp;image=" + Model.Item.GetFile("BackgroundImage").PathUrlEncoded; 473 } 474 else if (string.IsNullOrEmpty(Model.Item.GetList("BackgroundColor").SelectedValue)) 475 { 476 backgroundColor = "u-color-light--bg"; 477 } 478 479 //separation line 480 bool haveSeparationLine = Model.Item.GetBoolean("SeperationLineAfter"); 481 if (haveSeparationLine && Model.Item.GetList("Width").SelectedValue != "center") 482 { 483 paragraphContainerClasses += "multiple-paragraphs-container--seperation-line-after "; 484 } 485 else if (haveSeparationLine) 486 { 487 containerClasses += "multiple-paragraphs-container--seperation-line-after "; 488 } 489 490 //height 491 if (!string.IsNullOrEmpty(Model.Item.GetList("Height").SelectedValue)) 492 { 493 paragraphContainerClasses += "grid--height-" + Model.Item.GetList("Height").SelectedValue + " "; 494 gridClasses += "paragraph-container--height-" + Model.Item.GetList("Height").SelectedValue + " "; 495 } 496 497 //is visible for mobiles? 498 var hideForMobile = true; 499 foreach (var paragraph in Model.Item.GetItems("Paragraph")) 500 { 501 if (paragraph.GetList("WidthMobile").SelectedValue != "hide") 502 { 503 hideForMobile = false; 504 break; 505 } 506 } 507 if (Model.Item.GetItems("Paragraph").Count == 0) 508 { 509 hideForMobile = false; 510 } 511 512 if (hideForMobile) 513 { 514 gridClasses += "u-hidden-xs u-hidden-xxs "; 515 } 516 // 517 518 if (Model.Item.GetString("MakeParagraphsCenterAligned") != null && Model.Item.GetBoolean("MakeParagraphsCenterAligned")) 519 { 520 gridClasses += "justify-center text-center "; 521 } 522 523 string MinusMargin = ""; 524 if (Model.Item.GetBoolean("MinusMargin")) 525 { 526 MinusMargin = "minus-margin"; 527 } 528 529 string containerId = "Paragraph_" + Model.ID; 530 string carouselContainerClass = ""; 531 string carouselSlideClass = ""; 532 533 //Set as carousel 534 if (Model.Item.GetBoolean("EnableCarousel")) 535 { 536 containerClasses += "carousel js-carousel-container "; 537 containerClasses.Replace(" paragraph-container ", ""); 538 539 carouselContainerClass += "carousel__container dw-mod "; 540 541 carouselSlideClass += "carousel__slide dw-mod "; 542 543 containerId = "Carousel_" + Model.ID; 544 } 545 546 //getting video ID from youtube URL 547 string videoCode = Model.Item.GetString("VideoURL"); 548 Regex regex = new Regex(@".be\/(.[^?]*)"); 549 Match match = regex.Match(videoCode); 550 string videoId = ""; 551 if (match.Success) 552 { 553 videoId = match.Groups[1].Value; 554 } 555 else 556 { 557 regex = new Regex(@"v=([^&]+)"); 558 match = regex.Match(videoCode); 559 if (match.Success) 560 { 561 videoId = match.Groups[1].Value; 562 } 563 } 564 // FOCAL POINTS CONTAINER BACKGROUND IMAGE 565 var containerImage = Model.Item.GetFile("BackgroundImage"); 566 var containerParameters = ""; 567 if (!string.IsNullOrEmpty(Convert.ToString(containerImage))) 568 { 569 containerParameters = containerImage.GetFocalPointParameters(); 570 } 571 572 var isTopClass = ""; 573 var isTopParagraphClass = ""; 574 if (Model.ContainerSort == 1) 575 { 576 isTopClass = "is-top"; 577 isTopParagraphClass = "is-top-container"; 578 } 579 string mailSubject = Pageview.Area.Item["Subject"].ToString().Replace("<p>", String.Empty).Replace("</p>", string.Empty); 580 string mailText = Pageview.Area.Item["Text"].ToString().Replace("<p>", String.Empty).Replace("</p>", string.Empty); 581 582 } 583 584 <div class="col-md-12 col-bleed"> 585 <section class="multiple-paragraphs-container @paragraphContainerClasses multiple-paragraphs-container--spacing-@spacingSize @backgroundColor dw-mod @MinusMargin"> 586 @if (Model.ContainerSort == 1) 587 { 588 <img class="seeland-label" src="/Files/Templates/Designs/Seeland/static/dist/img/label2.png" alt="Label" /> 589 <div class="top-page"> 590 <div class="grid container-fluid"> 591 <div class="row"> 592 <div class="md-18 breadcrumbs dwnavigation" data-settings="template:Breadcrumb.xslt;expandmode:all" id="breadcrum"> 593 </div> 594 <div class="md-6 share"> 595 <button class="btn btn--share btn--facebook" data-module="some-share"> 596 <svg role="img"> 597 <use xlink:href="/Files/Templates/Designs/Seeland/static/dist/svg/_bundle.svg#icons_facebook" /> 598 </svg> 599 </button> 600 <a href="" class="btn btn--share btn--mail" data-module="mail" data-subject="@mailSubject" data-text="@mailText"> 601 <svg role="img"> 602 <use xlink:href="/Files/Templates/Designs/Seeland/static/dist/svg/_bundle.svg#icons_mail" /> 603 </svg> 604 </a> 605 </div> 606 </div> 607 </div> 608 </div> 609 } 610 <div class="background-image image-filter image-filter--@containerBackgroundImageFilterPrimary @isTopClass dw-mod"> 611 <div class="background-image__wrapper image-filter image-filter--@containerBackgroundImageFilterSecondary dw-mod"> 612 @{ 613 var xlImageHeight = ""; 614 var lImageHeight = "&height=1366"; 615 if (Model.Item.GetList("Height").SelectedValue != "screen") 616 { 617 xlImageHeight = "&height=600"; 618 lImageHeight = "&height=400"; 619 620 621 } 622 } 623 <img class="@bgImgClass @isFixedClass lazy-img lazy-bg lazy-loading" data-src-xxs="@containerBackgroundImage&width=750&height=850&crop=7&@containerParameters" data-src-xs="@containerBackgroundImage&width=980&crop=7&@containerParameters" 624 data-src-sm="@containerBackgroundImage&width=980&height=1024&crop=7&@containerParameters" data-src-md="@containerBackgroundImage&width=1280&crop=7&@containerParameters@lImageHeight" data-src-lg="@containerBackgroundImage&width=1280&crop=7&@containerParameters" 625 data-src-xl="@containerBackgroundImage&width=1440&crop=7&@containerParameters" data-src-xxl="@containerBackgroundImage&width=1920&crop=7&@containerParameters@xlImageHeight" data-alt="" /> 626 @if (!string.IsNullOrEmpty(videoId)) 627 { 628 629 <div class="video-background"> 630 <div class="video-background__container"> 631 <div class="js-youtube-video" data-video="@videoId" id="ytPlayer@(Model.ID)"></div> 632 </div> 633 </div> 634 } 635 </div> 636 </div> 637 <div class="@containerClasses dw-mod @isTopParagraphClass" id="@containerId "> 638 <div class="@carouselContainerClass"> 639 <div class="@carouselSlideClass"> 640 <div class="@gridClasses dw-mod "> 641 @foreach (var paragraph in Model.Item.GetItems("Paragraph")) 642 { 643 int columnWidth = Pageview.Device.ToString() != "Mobile" ? Int32.Parse(paragraph.GetList("Width").SelectedValue) : 12; 644 645 if (columnCount < 12) 646 { 647 columnCount += columnWidth; 648 } 649 else 650 { 651 columnCount = columnWidth; 652 } 653 654 string columnCssClasses = "col-sm-" + columnWidth + " "; 655 if (paragraph.GetList("WidthMobile").SelectedValue != "hide") 656 { 657 columnCssClasses += "col-xs-" + paragraph.GetList("WidthMobile").SelectedValue + " "; 658 } 659 else 660 { 661 columnCssClasses += "u-hidden-xs u-hidden-xxs "; 662 } 663 string backgroundImage = ""; 664 string backgroundImageSmall = ""; 665 string imageStyle = paragraph.GetList("ImageStyle").SelectedValue; 666 string backgroundImageFilterColor = paragraph.GetList("ColorForTheFilter").SelectedValue != null ? paragraph.GetList("ColorForTheFilter").SelectedValue : "none"; 667 string backgroundImageFilterPrimary = paragraph.GetList("ImageFilterPrimary").SelectedValue != null ? paragraph.GetList("ImageFilterPrimary").SelectedValue : "none"; 668 string backgroundImageFilterSecondary = paragraph.GetList("ImageFilterSecondary").SelectedValue != null ? paragraph.GetList("ImageFilterSecondary").SelectedValue : "none"; 669 670 671 672 if (imageStyle == "background" && paragraph.GetFile("Image") != null) 673 { 674 // FOCAL POINTS BACKGROUND IMAGE 675 var image = paragraph.GetFile("Image"); 676 var parameters = ""; 677 if (!string.IsNullOrEmpty(Convert.ToString(image))) 678 { 679 parameters = image.GetFocalPointParameters(); 680 } 681 backgroundImage = "/Admin/Public/GetImage.ashx?crop=7&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + paragraph.GetFile("Image").PathUrlEncoded + "&" + parameters; 682 } 683 684 if (backgroundImageFilterPrimary == "colorize") 685 { 686 backgroundImageFilterPrimary = backgroundImageFilterColor; 687 } 688 689 string paragraphContainerPadding = paragraph.GetBoolean("HidePadding") ? "paragraph-container--no-padding" : ""; 690 string contentPosition = paragraph.GetList("ContentPositions").SelectedValue; 691 string contentPositionClasses = contentPosition == "middle-center" || contentPosition == "middle-left" ? "justify-center " : ""; 692 693 string contentAlignment = paragraph.GetList("ContentAlignment").SelectedValue; 694 string contentAlignmentClasses = !string.IsNullOrEmpty(contentAlignment) ? "align-" + contentAlignment : ""; 695 696 string titleStyle = paragraph.GetList("TitleStyle").SelectedValue; 697 string titleContainerStyle = ""; 698 string hasFadedBG = ""; 699 string showAsCard = ""; 700 if (paragraph.GetBoolean("HasFadedBackground")) 701 { 702 hasFadedBG = "two-boxes__box__content"; 703 } 704 if (paragraph.GetBoolean("ShowAsCard")) 705 { 706 showAsCard = "full-height"; 707 } 708 if (paragraph.GetBoolean("IsUniverseContent")) 709 { 710 hasFadedBG = "universe__content md-8 md-offset-12 xxl-6 xxl-offset-12"; 711 } 712 713 if (titleStyle == "hero" || titleStyle == "hero large") 714 { 715 titleContainerStyle = titleStyle; 716 } 717 718 if (titleStyle == "usp") 719 { 720 titleContainerStyle = "usp-container"; 721 } 722 723 <div class="@columnCssClasses paragraph-container @paragraphContainerPadding dw-mod @contentPositionClasses @contentAlignmentClasses @titleContainerStyle"> 724 @if (imageStyle == "background" && paragraph.GetFile("Image") != null) 725 { 726 <div class="background-image image-filter image-filter--@backgroundImageFilterPrimary dw-mod"> 727 <div class="background-image__wrapper image-filter image-filter--@backgroundImageFilterSecondary dw-mod"> 728 <img class="background-image__cover dw-mod lazy-img lazy-bg" data-src-xxs="@backgroundImage&width=480&height=720" data-src-xs="@backgroundImage&width=480&height=720" 729 data-src-sm="@backgroundImage&width=480&height=720" data-src-md="@backgroundImage&width=480&height=720" 730 data-src-lg="@backgroundImage&width=480&height=720" data-src-xl="@backgroundImage&width=480&height=720" data-src-xxl="@backgroundImage&width=1300&height=1000" data-alt="" /> 731 </div> 732 </div> 733 } 734 @if (titleStyle == "hero" || titleStyle == "hero large") 735 { 736 <div class="content-wrapper @titleStyle"> 737 @RenderContent(paragraph, Model.Item.GetBoolean("EnableCarousel")) 738 <a href="@paragraph.GetString("Link")" class="front-hero__boxes__link"></a> 739 </div> 740 } 741 742 else 743 { 744 745 <div class="content-wrapper @hasFadedBG @showAsCard"> 746 @RenderContent(paragraph, Model.Item.GetBoolean("EnableCarousel")) 747 </div> 748 } 749 </div> 750 751 paragraphCount++; 752 if (paragraphCount != totalParagraphs) 753 { 754 string breakMarkup = string.Empty; 755 if (columnCount == 12) 756 { 757 breakMarkup = "</div></div><div class=\"" + carouselSlideClass + "\"><div class=\"" + gridClasses + "\">"; 758 totalSlides++; 759 } 760 @breakMarkup 761 } 762 } 763 764 @*NEWSLETTER*@ 765 766 </div> 767 </div> 768 </div> 769 770 @if (Model.Item.GetBoolean("EnableCarousel") && totalSlides > 1) 771 { 772 <div class="js-carousel-data" data-carousel-slide-time="@Model.Item.GetString("SlideTime")" data-slides-in-view="1"> 773 <div class="carousel-prev-btn dw-mod" onclick="Carousel.GetPreviousSlide('@containerId', true)"></div> 774 <div class="carousel-next-btn dw-mod" onclick="Carousel.GetNextSlide('@containerId', true)"></div> 775 </div> 776 } 777 </div> 778 @{ 779 var sectionId = !string.IsNullOrEmpty(Model.Item.GetString("IdToAnchorTo")) ? Model.Item.GetString("IdToAnchorTo") : ""; 780 } 781 @if (!string.IsNullOrEmpty(Model.Item.GetString("IdToAnchorTo"))) 782 { 783 784 <a href="@Dynamicweb.Frontend.PageView.Current().SearchFriendlyUrl#@sectionId"> 785 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 129 129" enable-background="new 0 0 129 129" class="arrow-down" width="50" height=""> 786 <g> 787 <path d="m121.3,34.6c-1.6-1.6-4.2-1.6-5.8,0l-51,51.1-51.1-51.1c-1.6-1.6-4.2-1.6-5.8,0-1.6,1.6-1.6,4.2 0,5.8l53.9,53.9c0.8,0.8 1.8,1.2 2.9,1.2 1,0 2.1-0.4 2.9-1.2l53.9-53.9c1.7-1.6 1.7-4.2 0.1-5.8z" /> 788 </g> 789 </svg> 790 </a> 791 } 792 793 </section> 794 </div>