FREE shipping on orders over 500

Are you looking for the perfect bike? Be prepared, be your best , be ready for your greatest adventure with the proper equipment!

RapidoBikes explores the different needs for each individual when purchasing a product from us - We focus on comfort, design and the proper equipment for you, that fits your personality

We are selling much more than bikes. We started a lot of activities for our active community - So sign up and participate on our events 

Participate on our contest!
Win a new MOUNTAIN BIKE. All you need to do is sign up for our newsletter and we will find a winner in week 25

Participate on our contest!
Win a new MOUNTAIN BIKE. All you need to do is sign up for our newsletter and we will find a winner in week 25

 Download

We focus on comfort, design and the proper equipment for you, that fits your personality.

If you have you have any questions please contact us

Quick ordering

Error executing template "Designs/Rapido/Paragraph/ParagraphContainer.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_3bc8ef758ac9473780c58711f6c22765.Execute() in C:\server\Rapido5\Solutions\rapidofull311-20190604-files\Files\Templates\Designs\Rapido\Paragraph\ParagraphContainer.cshtml:line 310
   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 @using Dynamicweb.Core 6 7 @functions { 8 public string GenerateRgba(string color, double opacity) 9 { 10 color = color.Replace("#", ""); 11 if (color.Length == 6) { 12 return "rgba(" + Convert.ToInt32(color.Substring(0, 2), 16) + ", " + Convert.ToInt32(color.Substring(2, 2), 16) + ", " + Convert.ToInt32(color.Substring(4, 2), 16) + ", " + opacity + ");"; 13 } else { 14 return Convert.ToInt16(color).ToString(); 15 } 16 } 17 } 18 19 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 20 @using Dynamicweb.Frontend 21 22 @helper RenderContent(ItemViewModel item, bool isCarousel = false) 23 { 24 string cardClass = item.GetBoolean("ShowAsCard") ? "paragraph-card" : "grid__cell"; 25 cardClass = Pageview.Device.ToString() != "Tablet" ? cardClass : "grid__cell"; 26 27 string contentPosition = item.GetList("ContentPositions").SelectedValue; 28 string innerPadding = item.GetList("InnerPadding") != null ? "paragraph-container__body--padding-" + item.GetList("InnerPadding").SelectedValue : ""; 29 30 31 switch (contentPosition) { 32 case "title-top": 33 <div class="@cardClass @innerPadding dw-mod"> 34 @RenderHeading(item) 35 @RenderImage(item, isCarousel) 36 @RenderText(item) 37 @RenderModule(item) 38 </div> 39 @RenderButton(item) 40 break; 41 case "image-left": 42 <div class="grid"> 43 <div class="grid__col-3"> 44 @RenderImage(item, isCarousel) 45 </div> 46 <div class="grid__col-9 @innerPadding dw-mod"> 47 @RenderHeading(item) 48 @RenderText(item) 49 @RenderModule(item) 50 @RenderButton(item) 51 </div> 52 </div> 53 break; 54 case "image-right": 55 <div class="grid"> 56 <div class="grid__col-9 @innerPadding dw-mod"> 57 @RenderHeading(item) 58 @RenderText(item) 59 @RenderModule(item) 60 @RenderButton(item) 61 </div> 62 <div class="grid__col-3"> 63 @RenderImage(item, isCarousel) 64 </div> 65 </div> 66 break; 67 case "all-centered": 68 <div class="@cardClass @innerPadding dw-mod"> 69 <div class="u-ta-center"> 70 @RenderImage(item, isCarousel) 71 @RenderHeading(item) 72 @RenderText(item) 73 @RenderModule(item) 74 </div> 75 </div> 76 @RenderButton(item) 77 break; 78 case "middle-center": 79 case "middle-left": 80 @*Part of styles is placed in Paragraph.cshtml & ParagraphContainer.cshtml*@ 81 <div> 82 <div class="@cardClass @innerPadding dw-mod"> 83 <div class="@(contentPosition == "middle-center" ? "u-ta-center" : "")"> 84 @RenderImage(item, isCarousel) 85 @RenderHeading(item) 86 @RenderText(item) 87 @RenderModule(item) 88 </div> 89 </div> 90 @RenderButton(item) 91 </div> 92 break; 93 //for "image-top" and "image-centered" 94 default: 95 <div class="@cardClass"> 96 @RenderImage(item, isCarousel) 97 98 <div class="@innerPadding dw-mod"> 99 @RenderHeading(item) 100 @RenderText(item) 101 @RenderModule(item) 102 </div> 103 </div> 104 @RenderButton(item) 105 break; 106 } 107 } 108 109 @helper RenderHeading(ItemViewModel item) 110 { 111 if (item.GetBoolean("ShowTitle") != false && !string.IsNullOrEmpty(item.GetString("Title"))) 112 { 113 string headerMargin = item.GetString("Text") != "" && item.GetString("Image") != "" ? "u-margin-bottom" : ""; 114 headerMargin = Model.GetModuleOutput() == "" ? headerMargin : "u-margin-bottom"; 115 string url = item.GetString("Link"); 116 117 if (!String.IsNullOrEmpty(url)) 118 { 119 <a href="@url"> 120 <h2 class="u-no-margin @headerMargin">@item.GetString("Title")</h2> 121 </a> 122 } 123 else 124 { 125 <h2 class="u-no-margin @headerMargin">@item.GetString("Title")</h2> 126 } 127 } 128 } 129 130 @helper RenderButton(ItemViewModel item) 131 { 132 string url = item.GetString("Link"); 133 string linkText = item.GetString("LinkText"); 134 string secondaryUrl = item.GetString("SecondaryLink"); 135 string secondaryLinkText = item.GetString("SecondaryLinkText"); 136 string footerCssClass = ""; 137 string cardFooterClass = item.GetBoolean("ShowAsCard") ? "paragraph-card-footer" : "grid__cell-footer"; 138 cardFooterClass = Pageview.Device.ToString() != "Tablet" ? cardFooterClass : ""; 139 string alingClass = ""; 140 string spacing = item.GetList("InnerPadding") != null ? "paragraph-container__button--spacing-" + item.GetList("InnerPadding").SelectedValue : ""; 141 142 143 if (item.GetList("ContentPositions").SelectedValue == "all-centered" || item.GetList("ContentPositions").SelectedValue == "middle-center") { 144 footerCssClass = "grid--justify-center"; 145 alingClass = "grid--justify-center"; 146 } 147 148 if ((!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(linkText)) || (!string.IsNullOrEmpty(secondaryUrl) && !string.IsNullOrEmpty(secondaryLinkText))) 149 { 150 <div class="grid__cell @footerCssClass @cardFooterClass"> 151 <div class="paragraph-container__button @spacing @alingClass dw-mod"> 152 153 @if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(linkText)) 154 { 155 string buttonStyle = !String.IsNullOrEmpty(item.GetList("ButtonDesign").SelectedValue) ? item.GetList("ButtonDesign").SelectedValue : "primary"; 156 if (url.Contains("http")) 157 { 158 <a href="@url" class="btn btn--@buttonStyle dw-mod" target="_blank" rel="noopener">@linkText</a> 159 } 160 else if (url.Contains("/")) 161 { 162 <a href="@url" class="btn btn--@buttonStyle dw-mod" download>@linkText</a> 163 } 164 else 165 { 166 <a href="@url" class="btn btn--@buttonStyle dw-mod">@linkText</a> 167 } 168 } 169 170 @if (!string.IsNullOrEmpty(secondaryUrl) && !string.IsNullOrEmpty(secondaryLinkText)) 171 { 172 string secondaryButtonStyle = !String.IsNullOrEmpty(item.GetList("SecondaryButtonDesign").SelectedValue) ? item.GetList("SecondaryButtonDesign").SelectedValue : "primary"; 173 if (secondaryUrl.Contains("http")) 174 { 175 <a href="@secondaryUrl" class="btn btn--@secondaryButtonStyle u-margin-left dw-mod" target="_blank" rel="noopener">@secondaryLinkText</a> 176 } 177 else if (secondaryUrl.Contains("/")) 178 { 179 <a href="@secondaryUrl" class="btn btn--@secondaryButtonStyle u-margin-left dw-mod" download>@secondaryLinkText</a> 180 } 181 else 182 { 183 <a href="@secondaryUrl" class="btn btn--@secondaryButtonStyle u-margin-left dw-mod">@secondaryLinkText</a> 184 } 185 } 186 </div> 187 </div> 188 } else { 189 <div class="grid__cell-footer @footerCssClass @cardFooterClass"></div> 190 } 191 } 192 193 @helper RenderText(ItemViewModel item) 194 { 195 if (!string.IsNullOrWhiteSpace(item.GetString("Text"))) 196 { 197 @item.GetString("Text") 198 } 199 } 200 201 @helper RenderModule(ItemViewModel item) 202 { 203 @Model.GetModuleOutput(); 204 } 205 206 @helper RenderImage(ItemViewModel item, bool isCarousel) 207 { 208 if (!string.IsNullOrEmpty(item.GetString("Image")) && item.GetList("ImageStyle").SelectedValue != "background") 209 { 210 string url = item.GetString("Link"); 211 212 <div class="u-margin-bottom"> 213 @if (!String.IsNullOrEmpty(url)) 214 { 215 <a href="@url"> 216 @RenderImageElement(item, isCarousel) 217 </a> 218 } 219 else 220 { 221 @RenderImageElement(item, isCarousel) 222 } 223 </div> 224 } 225 } 226 227 @helper RenderImageElement(ItemViewModel item, bool isCarousel) 228 { 229 string image = item.GetFile("Image") != null ? item.GetFile("Image").PathUrlEncoded : ""; 230 string imageFocalPointParameters = item.GetFile("Image") != null ? "&" + item.GetFile("Image").GetFocalPointParameters() : ""; 231 string imageFilterColor = item.GetList("ColorForTheFilter") != null ? item.GetList("ColorForTheFilter").SelectedValue : "none"; 232 string imageFilterPrimary = item.GetList("ImageFilterPrimary") != null ? item.GetList("ImageFilterPrimary").SelectedValue : "none"; 233 string imageFilterSecondary = item.GetList("ImageFilterSecondary") != null ? item.GetList("ImageFilterSecondary").SelectedValue : "none"; 234 string imageFilterBall = item.GetList("ImageStyle").SelectedValue == "ball" ? "image-filter--ball" : ""; 235 string altText = item.GetString("Title"); 236 string imgCssClass = ""; 237 string imgCrop = item.GetList("ImageCrop") != null ? item.GetList("ImageCrop").SelectedValue : "5"; 238 bool fillCanvas = item.GetBoolean("FillCanvas"); 239 string fillCanvasString = fillCanvas ? "&amp;FillCanvas=true" : ""; 240 string imageBoxWidth = "480"; 241 int imageWidth = 1240; 242 int imageHeight = 950; 243 if (item.GetList("Width").SelectedValue != "auto") { 244 imageWidth = Int32.Parse(item.GetList("Width").SelectedValue) < 8 ? 620 : 1240; 245 imageHeight = Int32.Parse(item.GetList("Width").SelectedValue) < 8 ? 496 : 950; 246 } 247 string placeHolderImage = "/Files/Images/placeholder.gif"; 248 249 if (imageFilterPrimary == "colorize") { 250 imageFilterPrimary = imageFilterColor; 251 } 252 253 if (item.GetList("ContentPositions").SelectedValue == "image-centered" || item.GetList("ContentPositions").SelectedValue == "all-centered" || item.GetList("ContentPositions").SelectedValue == "middle-center") 254 { 255 imgCssClass = "grid__cell-img--centered"; 256 } 257 258 <div class="image image-filter image-filter--@imageFilterPrimary @imageFilterBall dw-mod js-main-image-filter @(item.GetList("ContentPositions").SelectedValue == "middle-center" ? "u-middle" : "")"> 259 <div class="image-filter image-filter--@imageFilterSecondary @imageFilterBall dw-mod"> 260 261 @if (item.GetList("ImageStyle").SelectedValue == "ball") 262 { 263 imgCssClass += " grid__cell-img--ball"; 264 if (!isCarousel) 265 { 266 <img class="grid__cell-img @imgCssClass b-lazy" src="@placeHolderImage" data-src="/Admin/Public/GetImage.ashx?width=@imageBoxWidth&amp;height=@imageBoxWidth&amp;crop=@imgCrop&amp;Compression=75&amp;DoNotUpscale=true&amp;FillCanvas=true&amp;image=@image+@imageFocalPointParameters" alt="@altText"> 267 } 268 else 269 { 270 <img class="grid__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+@imageFocalPointParameters" alt="@altText"> 271 } 272 } 273 else 274 { 275 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 + imageFocalPointParameters; 276 string largeImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&amp;height=" + imageHeight + "&amp;crop=" + imgCrop + "&amp;Compression=75" + fillCanvasString + "&amp;DoNotUpscale=true&amp;image=" + image + imageFocalPointParameters; 277 string smallImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&amp;height=" + imageHeight + "&amp;crop=" + imgCrop + "&amp;Compression=75" + fillCanvasString+ "&amp;DoNotUpscale=true&amp;image=" + image + imageFocalPointParameters; 278 279 if (!isCarousel) 280 { 281 <img class="@imgCssClass b-lazy" src="@placeHolderImage" data-src="@largeImage|@retinaImage" data-src-small="@smallImage" alt="@altText"> 282 } 283 else 284 { 285 <img class="@imgCssClass" src="@largeImage" alt="@altText"> 286 } 287 } 288 </div> 289 </div> 290 } 291 292 @{ 293 string fontColor = !string.IsNullOrEmpty(Model.Item.GetString("FontColor")) && !Model.Item.GetString("FontColor").StartsWith("#") ? "u-" + Model.Item.GetString("FontColor").Replace(" ", "-").ToLower() : ""; 294 string backgroundColor = !string.IsNullOrEmpty(Model.Item.GetString("BackgroundColor")) && !Model.Item.GetString("BackgroundColor").StartsWith("#") ? "u-" + Model.Item.GetString("BackgroundColor").Replace(" ", "-").ToLower() + "--bg" : ""; 295 string colorSettings = Model.Item.GetString("FontColor").StartsWith("#") || Model.Item.GetString("BackgroundColor").StartsWith("#") ? "style=\"" : ""; 296 string fontColorHex = Model.Item.GetString("FontColor").StartsWith("#") ? "color: " + Model.Item.GetString("FontColor") + ";" : ""; 297 string backgroundColorHex = Model.Item.GetString("BackgroundColor").StartsWith("#") ? "background-color: " + Model.Item.GetString("BackgroundColor") + ";" : ""; 298 colorSettings += fontColorHex; 299 colorSettings += backgroundColorHex; 300 colorSettings += Model.Item.GetString("FontColor").StartsWith("#") || Model.Item.GetString("BackgroundColor").StartsWith("#") ? "\"" : ""; 301 302 string paragraphContainerClasses = ""; 303 string containerClasses = ""; 304 string gridClasses = "grid "; 305 306 string spacingSize = Model.Item.GetList("Spacing") != null && Model.Item.GetList("Spacing").SelectedValue != "" ? Model.Item.GetList("Spacing").SelectedValue : "lg"; 307 string placeHolderImage = "/Files/Images/placeholder.gif"; 308 int columnCount = 0; 309 int paragraphCount = 0; 310 int totalParagraphs = Model.Item.GetItems("Paragraph").Count; 311 int totalSlides = 1; 312 313 switch (Model.Item.GetList("Width").SelectedValue) 314 { 315 case "center": 316 containerClasses += "center-container paragraph-container "; 317 paragraphContainerClasses += " " + fontColor + " " + backgroundColor; 318 break; 319 case "full": 320 containerClasses += fontColor + " " + backgroundColor + " "; 321 paragraphContainerClasses += "paragraph-container--full-width "; 322 break; 323 case "combi": 324 paragraphContainerClasses += "paragraph-container--full-width " + fontColor + " " + backgroundColor + " "; 325 containerClasses += "center-container paragraph-container "; 326 break; 327 default: 328 paragraphContainerClasses += "center-container "; 329 break; 330 } 331 332 if (spacingSize == "none") 333 { 334 containerClasses += "paragraph-container--spacing-none "; 335 } 336 337 //background 338 string containerBackgroundImage = ""; 339 string containerBackgroundImageLarge = ""; 340 string containerBackgroundImageMedium = ""; 341 string containerBackgroundImageSmall = ""; 342 string containerBackgroundImageFilterColor = Model.Item.GetList("ColorForTheFilter") != null ? Model.Item.GetString("ColorForTheFilter").Replace(" ", "-").ToLower() : "none"; 343 string containerBackgroundImageFilterPrimary = Model.Item.GetList("ImageFilterPrimary") != null ? Model.Item.GetList("ImageFilterPrimary").SelectedValue : "none"; 344 string containerBackgroundImageFilterSecondary = Model.Item.GetList("ImageFilterSecondary") != null ? Model.Item.GetList("ImageFilterSecondary").SelectedValue : "none"; 345 string containerBackgroundImageFilterColorCode = Model.Item.GetString("ColorForTheFilter").StartsWith("#") && containerBackgroundImageFilterPrimary == "colorize" ? "style=\"background-color: " + GenerateRgba(Model.Item.GetString("ColorForTheFilter"), 0.3) + "\"" : ""; 346 347 if (containerBackgroundImageFilterPrimary == "colorize" && !containerBackgroundImageFilterPrimary.StartsWith("#")) 348 { 349 containerBackgroundImageFilterPrimary = containerBackgroundImageFilterColor; 350 } 351 352 if (Model.Item.GetFile("BackgroundImage") != null) 353 { 354 string focalPointParameters = Model.Item.GetFile("BackgroundImage") != null ? "&" + Model.Item.GetFile("BackgroundImage").GetFocalPointParameters() : ""; 355 containerBackgroundImage = "/Admin/Public/GetImage.ashx?width=2500&amp;height=1100&amp;crop=0&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + Model.Item.GetFile("BackgroundImage").PathUrlEncoded + focalPointParameters; 356 containerBackgroundImageLarge = "/Admin/Public/GetImage.ashx?width=1920&amp;height=845&amp;crop=0&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + Model.Item.GetFile("BackgroundImage").PathUrlEncoded + focalPointParameters; 357 containerBackgroundImageMedium = "/Admin/Public/GetImage.ashx?width=1024&amp;height=450&amp;crop=0&amp;&amp;FillCanvas=TrueCompression=85&amp;DoNotUpscale=true&amp;image=" + Model.Item.GetFile("BackgroundImage").PathUrlEncoded + focalPointParameters; 358 containerBackgroundImageSmall = "/Admin/Public/GetImage.ashx?width=640&amp;height=544&amp;crop=0&amp;&amp;FillCanvas=TrueCompression=85&amp;DoNotUpscale=true&amp;image=" + Model.Item.GetFile("BackgroundImage").PathUrlEncoded + focalPointParameters; 359 } 360 else if (string.IsNullOrEmpty(backgroundColor)) 361 { 362 backgroundColor = "u-color-light--bg"; 363 } 364 365 //separation line 366 bool haveSeparationLine = Model.Item.GetBoolean("SeperationLineAfter"); 367 if (haveSeparationLine && Model.Item.GetList("Width").SelectedValue != "center") 368 { 369 paragraphContainerClasses += "multiple-paragraphs-container--seperation-line-after "; 370 } 371 else if (haveSeparationLine) 372 { 373 containerClasses += "multiple-paragraphs-container--seperation-line-after "; 374 } 375 376 //height 377 if (!string.IsNullOrEmpty(Model.Item.GetList("Height").SelectedValue)) 378 { 379 if (Model.Item.GetList("Height").SelectedValue != "screen") { 380 gridClasses += "paragraph-container--height-" + Model.Item.GetList("Height").SelectedValue + " "; 381 } else { 382 gridClasses += " screen-height"; 383 } 384 } 385 386 if (Model.Item.GetString("MakeParagraphsCenterAligned") != null && Model.Item.GetBoolean("MakeParagraphsCenterAligned")) 387 { 388 gridClasses += "grid--justify-center "; 389 } 390 391 string containerId = "Paragraph_" + Model.ID; 392 string carouselContainerClass = ""; 393 string carouselSlideClass = ""; 394 395 //Set as carousel 396 if (Model.Item.GetBoolean("EnableCarousel")) 397 { 398 containerClasses += "carousel"; 399 containerClasses.Replace(" paragraph-container ", ""); 400 401 carouselContainerClass += "carousel__container js-carousel-slides dw-mod "; 402 403 carouselSlideClass += "carousel__slide dw-mod "; 404 405 containerId = "Carousel_" + Model.ID; 406 } 407 408 //getting video ID from youtube URL 409 string videoCode = Model.Item.GetString("VideoURL"); 410 Regex regex = new Regex(@".be\/(.[^?]*)"); 411 Match match = regex.Match(videoCode); 412 string videoId = ""; 413 if (match.Success) 414 { 415 videoId = match.Groups[1].Value; 416 } 417 else 418 { 419 regex = new Regex(@"v=([^&]+)"); 420 match = regex.Match(videoCode); 421 if (match.Success) 422 { 423 videoId = match.Groups[1].Value; 424 } 425 } 426 } 427 428 <div class="grid__col-md-12 grid__col--bleed"> 429 <section class="multiple-paragraphs-container @paragraphContainerClasses multiple-paragraphs-container--spacing-@spacingSize dw-mod" @colorSettings> 430 <div class="background-image image-filter image-filter--@containerBackgroundImageFilterPrimary dw-mod" @containerBackgroundImageFilterColorCode> 431 <div class="background-image__wrapper image-filter image-filter--@containerBackgroundImageFilterSecondary dw-mod"> 432 <img class="background-image__cover dw-mod b-lazy" src="@placeHolderImage" data-src="@containerBackgroundImage" data-src-small="@containerBackgroundImageSmall" data-src-medium="@containerBackgroundImageMedium" data-src-large="@containerBackgroundImageLarge" alt=""> 433 @if (!string.IsNullOrEmpty(videoId)) 434 { 435 436 <div class="video-background"> 437 <div class="video-background__container"> 438 <div class="js-youtube-video" data-video="@videoId" id="ytPlayer@(Model.ID)"></div> 439 </div> 440 </div> 441 } 442 </div> 443 </div> 444 <div class="@containerClasses dw-mod" id="@containerId"> 445 <div class="@carouselContainerClass"> 446 <div class="@carouselSlideClass"> 447 <div class="@gridClasses dw-mod"> 448 @foreach (var paragraph in Model.Item.GetItems("Paragraph")) 449 { 450 int columnWidth = 12; 451 string columnCssClasses = ""; 452 bool hideParagraph = Pageview.Device.ToString() == "Mobile" && paragraph.GetList("WidthMobile").SelectedValue.ToLower() == "hide" ? true : false; 453 454 if (paragraph.GetList("Width").SelectedValue != "auto") { 455 columnWidth = Pageview.Device.ToString() != "Mobile" ? Int32.Parse(paragraph.GetList("Width").SelectedValue) : 12; 456 457 if (columnCount < 12) 458 { 459 columnCount += columnWidth; 460 } 461 else 462 { 463 columnCount = columnWidth; 464 } 465 466 columnCssClasses = "grid__col-sm-" + columnWidth + " "; 467 } else { 468 columnCssClasses = "grid__col-auto "; 469 } 470 471 if (paragraph.GetList("WidthMobile").SelectedValue != "hide") 472 { 473 columnCssClasses += "grid__col-xs-" + paragraph.GetList("WidthMobile").SelectedValue + " "; 474 } 475 476 if (Model.Item.GetList("Height").SelectedValue == "screen") 477 { 478 columnCssClasses += " screen-height"; 479 } 480 481 string backgroundImage = ""; 482 string backgroundImageLarge = ""; 483 string backgroundImageMedium = ""; 484 string backgroundImageSmall = ""; 485 int backgroundImageWidth = 2500; 486 int backgroundImageLargeWidth = 1920; 487 int backgroundImageMediumWidth = 1300; 488 int backgroundImageSmallWidth = 1024; 489 string imageStyle = paragraph.GetList("ImageStyle").SelectedValue; 490 string backgroundImageFilterColor = paragraph.GetList("ColorForTheFilter") != null ? paragraph.GetString("ColorForTheFilter").Replace(" ", "-").ToLower() : "none"; 491 string backgroundImageFilterPrimary = paragraph.GetList("ImageFilterPrimary") != null ? paragraph.GetList("ImageFilterPrimary").SelectedValue : "none"; 492 string backgroundImageFilterSecondary = paragraph.GetList("ImageFilterSecondary") != null ? paragraph.GetList("ImageFilterSecondary").SelectedValue : "none"; 493 string backgroundImageFilterColorCode = paragraph.GetString("ColorForTheFilter").StartsWith("#") && backgroundImageFilterPrimary == "colorize" ? "style=\"background-color: " + GenerateRgba(paragraph.GetString("ColorForTheFilter"), 0.3) + "\"" : ""; 494 495 if (columnWidth < 12) { 496 backgroundImageWidth = 1250; 497 backgroundImageLargeWidth = 960; 498 } 499 500 if (imageStyle == "background" && paragraph.GetFile("Image") != null) 501 { 502 string cropMode = paragraph.GetList("ImageCrop") != null ? paragraph.GetList("ImageCrop").SelectedValue : "0"; 503 string focalPointParameters = paragraph.GetFile("Image") != null ? "&" + paragraph.GetFile("Image").GetFocalPointParameters() : ""; 504 backgroundImage = "/Admin/Public/GetImage.ashx?width=" + backgroundImageWidth + "&amp;height=1100&amp;crop=" + cropMode + "&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + paragraph.GetFile("Image").PathUrlEncoded + focalPointParameters; 505 backgroundImageLarge = "/Admin/Public/GetImage.ashx?width=" + backgroundImageLargeWidth + "&amp;height=845&amp;crop=" + cropMode + "&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + paragraph.GetFile("Image").PathUrlEncoded + focalPointParameters; 506 backgroundImageMedium = "/Admin/Public/GetImage.ashx?width=" + backgroundImageMediumWidth + "&amp;height=572&amp;crop=" + cropMode + "&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + paragraph.GetFile("Image").PathUrlEncoded + focalPointParameters; 507 backgroundImageSmall = "/Admin/Public/GetImage.ashx?width=" + backgroundImageSmallWidth + "&amp;height=450&amp;crop=" + cropMode + "&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + paragraph.GetFile("Image").PathUrlEncoded + focalPointParameters; 508 } 509 510 if (backgroundImageFilterPrimary == "colorize" && !paragraph.GetString("ColorForTheFilter").StartsWith("#")) 511 { 512 backgroundImageFilterPrimary = backgroundImageFilterColor; 513 } 514 515 string paragraphContainerPadding = paragraph.GetBoolean("HidePadding") ? "paragraph-container--no-padding" : ""; 516 string contentPosition = paragraph.GetList("ContentPositions").SelectedValue; 517 string contentPositionClasses = contentPosition == "middle-center" || contentPosition == "middle-left" ? "grid--justify-center " : ""; 518 519 if (!hideParagraph) { 520 <div class="@columnCssClasses paragraph-container @paragraphContainerPadding dw-mod @contentPositionClasses"> 521 @if (imageStyle == "background" && paragraph.GetFile("Image") != null) 522 { 523 <div class="background-image image-filter image-filter--@backgroundImageFilterPrimary dw-mod" @backgroundImageFilterColorCode> 524 <div class="background-image__wrapper image-filter image-filter--@backgroundImageFilterSecondary dw-mod"> 525 <img class="background-image__cover dw-mod b-lazy" src="@placeHolderImage" data-src="@backgroundImage" data-src-small="@backgroundImageSmall" data-src-medium="@backgroundImageMedium" data-src-large="@backgroundImageLarge" alt=""> 526 </div> 527 </div> 528 } 529 530 @RenderContent(paragraph, Model.Item.GetBoolean("EnableCarousel")) 531 </div> 532 533 paragraphCount++; 534 if (paragraphCount != totalParagraphs) 535 { 536 string breakMarkup = string.Empty; 537 if (columnCount == 12) 538 { 539 breakMarkup = "</div></div><div class=\"" + carouselSlideClass + "\"><div class=\"" + gridClasses + " dw-mod\">"; 540 totalSlides++; 541 } 542 @breakMarkup 543 } 544 } 545 } 546 </div> 547 </div> 548 </div> 549 550 @if (Model.Item.GetBoolean("EnableCarousel") && totalSlides > 1) 551 { 552 bool enableDots = Model.Item.GetBoolean("ShowDots"); 553 <script> 554 document.addEventListener("DOMContentLoaded", function () { 555 new CarouselModule("#@containerId", { 556 slideTime: @Model.Item.GetString("SlideTime"), 557 dots: @(Model.Item.GetBoolean("ShowDots").ToString().ToLower()) 558 }); 559 }) 560 </script> 561 } 562 </div> 563 </section> 564 </div>