Article

Stort filmdrama og lysende stjerner på Kongenshus Hede

De tilhører den internationale filmscene, men i efteråret indtog Mads Mikkelsen, Amanda Collin og Nikolaj Arcel den jyske hede for at optage det episke drama ’Bastarden’. Det er unikke optagelser på det historiske sted, hvor hovedpersonen Ludvig von Kahlen kom til i 1754 for at opdyrke den golde jord.

Published on 12. March 2026

Artiklen er også bragt i vores medlemsmagasin VÆKST 1/2026
Se mere om Vækst

Af Mette Meldgaard
Foto: Xxx

Få viden, nyheder og invitationer i din indbakke

Nyhedsbrevet er til dig, der gerne vil lære mere om natur og miljø – og som gerne selv vil gøre en forskel. Vi lukker dig digitalt ind i vores foreningsliv og viser, hvordan vi dagligt arbejder for at benytte og beskytte naturen. Tilmeld dig vores nyhedsbrev og få nyeste nyt, invitationer og tips og tricks til fx øget biodiversitet.

Error executing template "Designs/Swift/Paragraph/Base_Paragraph.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_e7dbd6d5b59b4ed6881cd7c47003f8af.Execute() in D:\solutions\dalgas-production\Files\Templates\Designs\Swift\Paragraph\Base_Paragraph.cshtml:line 307
   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 @using System.Linq 2 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dalgas.Custom.ViewModels.Content.ParagraphViewModel> 3 4 @using System.Collections.Generic 5 @using System.Linq 6 @using Dynamicweb.Content.Items 7 8 @functions 9 { 10 11 public string GetContainerClassList(Dynamicweb.Frontend.GridRowViewModel model) 12 { 13 List<string> returnValues = new List<string>(); 14 string container = "container-xl"; 15 16 if (model.Item.GetString("Width") == "bleed") 17 { 18 if (model.Item?.GetRawValueString("OverallAlignment") == "justify-content-end") 19 { 20 container = "container-xl me-sm-0 pe-sm-0 custom-container-justify-content-end"; 21 } 22 else if (model.Item?.GetRawValueString("OverallAlignment") == "justify-content-start") 23 { 24 container = "container-xl ms-sm-0 ps-sm-0 custom-container-justify-content-start"; 25 } 26 else 27 { 28 container = "container-fluid px-0"; 29 } 30 } 31 32 returnValues.Add(container); 33 return string.Join(" ", returnValues); 34 } 35 36 37 38 public string GetColumnWidthClassList(Dynamicweb.Frontend.ItemViewModel model) 39 { 40 41 string columnWidth = "col"; 42 string mobileWidth = string.Empty; 43 string tabletWidth = string.Empty; 44 string desktopWidth = string.Empty; 45 string xlWidth = string.Empty; 46 47 if (model != null) 48 { 49 50 if (model.GetField("Mobile").GetRawValue() != null && model.GetField("Mobile").GetRawValue().ToString() != "auto") 51 { 52 53 mobileWidth = "col-" + model.GetField("Mobile").GetRawValue(); 54 if (model.GetField("Tablet").GetRawValue() == null) 55 { 56 mobileWidth = mobileWidth + " col-sm"; 57 } 58 } 59 if (model.GetField("Width").GetRawValue() != null && model.GetField("Width").GetRawValue().ToString() != "auto") 60 { 61 desktopWidth = "col-md-" + model.GetField("Width").GetRawValue(); 62 } 63 if (model.GetField("Tablet").GetRawValue() != null && model.GetField("Tablet").GetRawValue().ToString() != "auto") 64 { 65 66 desktopWidth = " col-lg-" + model.GetField("Width").GetRawValue(); 67 tabletWidth = "col-md-" + model.GetField("Tablet").GetRawValue(); 68 if (model.GetField("XL").GetRawValue() == null) 69 { 70 tabletWidth = tabletWidth + " col-lg-" + model.GetField("Width").GetRawValue(); 71 } 72 } 73 if (model.GetField("XL").GetRawValue() != null && model.GetField("XL").GetRawValue().ToString() != "auto") 74 { 75 xlWidth = "col-xxxl-" + model.GetField("XL").GetRawValue(); 76 } 77 78 columnWidth = $"col {mobileWidth} {tabletWidth} {desktopWidth} {xlWidth}"; 79 80 } 81 return string.Join(" ", columnWidth); 82 } 83 84 public string GetRowWidthClassList(Dynamicweb.Frontend.GridRowViewModel model) 85 { 86 List<string> returnValues = new List<string>(); 87 88 string rowWidth = model.Item.GetRawValueString("Width", string.Empty).ToLower(); 89 90 if (rowWidth == "6") 91 { 92 returnValues.Add("col-12 col-lg-6"); 93 } 94 if (rowWidth == "8") 95 { 96 returnValues.Add("col-12 col-lg-8"); 97 } 98 if (rowWidth == "9") 99 { 100 returnValues.Add("col-12 col-lg-9"); 101 } 102 if (rowWidth == "10") 103 { 104 returnValues.Add("col-12 col-lg-10"); 105 } 106 if (rowWidth == "12") 107 { 108 returnValues.Add("col-12 col-lg-12"); 109 } 110 if (rowWidth == "bleed") 111 { 112 returnValues.Add("col-12"); 113 } 114 115 return string.Join(" ", returnValues); 116 } 117 118 public string GetSectionContentAlignmentClassList(Dynamicweb.Frontend.GridRowViewModel model) 119 { 120 List<string> returnValues = new List<string>(); 121 122 returnValues.Add(model.Item.GetRawValueString("OverallAlignment", string.Empty).ToLower()); 123 124 return string.Join(" ", returnValues); 125 } 126 127 public string GetRowHorizontalAlignmentClassList(Dynamicweb.Frontend.GridRowViewModel model) 128 { 129 130 List<string> returnValues = new List<string>(); 131 132 returnValues.Add(model.Item.GetRawValueString("HorizontalAlignment", string.Empty).ToLower()); 133 134 return string.Join(" ", returnValues); 135 } 136 137 public string GetRowVerticalAlignmentClassList(Dynamicweb.Frontend.GridRowViewModel model) 138 { 139 140 List<string> returnValues = new List<string>(); 141 142 returnValues.Add(model.Item.GetRawValueString("VerticalAlignment", string.Empty).ToLower()); 143 144 return string.Join(" ", returnValues); 145 } 146 147 public string GetRowSpacing(Dynamicweb.Frontend.GridRowViewModel model) 148 { 149 List<string> returnValues = new List<string>(); 150 151 string disableGutters = model.Item.GetRawValueString("ContentSpacing", string.Empty).ToLower(); 152 153 returnValues.Add(disableGutters == "disable-gutters" ? "g-0" : "g-4"); 154 155 return string.Join(" ", returnValues); 156 } 157 158 public string GetSectionClassList(Dynamicweb.Frontend.GridRowViewModel model) 159 { 160 List<string> returnValues = new List<string>(); 161 returnValues.Add($"item_{model.Item.SystemName.ToLower()}"); 162 returnValues.Add(!string.IsNullOrWhiteSpace(model.Item.GetRawValueString("Theme")) ? " theme " + model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""); 163 string paddingTop = model.Item.GetRawValueString("PaddingTop", "large"); 164 string paddingBottom = model.Item.GetRawValueString("PaddingBottom", "large"); 165 166 if (paddingTop == "none") 167 { 168 returnValues.Add("pt-0"); 169 } 170 171 if (paddingTop == "medium") { 172 returnValues.Add("pt-4"); 173 } 174 175 if (paddingTop == "extraextralarge") { 176 returnValues.Add("pt-6"); 177 } 178 179 if (paddingBottom == "none") 180 { 181 returnValues.Add("pb-0"); 182 } 183 184 if (paddingBottom == "medium") 185 { 186 returnValues.Add("pb-4"); 187 } 188 189 if (paddingBottom == "extraextralarge") { 190 returnValues.Add("pb-6"); 191 } 192 193 return string.Join(" ", returnValues); 194 } 195 196 197 198 } 199 200 201 @helper RenderImage() 202 { 203 if (!string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("Image"))) 204 { 205 string ratioCssClass = Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") != "0" && Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") != "" ? "ratio" : string.Empty; 206 string ratioVariable = Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") != "0" && Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") != "" ? "style=\"--bs-aspect-ratio: " + Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageAspectRatio") + "\"" : string.Empty; 207 string ImageObjectFit = Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("ImageObjectFit", string.Empty); 208 ImageObjectFit = ImageObjectFit == "cover" ? string.Empty : ImageObjectFit; 209 ImageObjectFit = ImageObjectFit == "contain" ? "object-fit:contain" : ImageObjectFit; 210 211 var parms = new Dictionary<string, object>(); 212 parms.Add("loading", "lazy"); 213 parms.Add("style", ImageObjectFit); 214 parms.Add("alt", Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("ImageAltText")); 215 parms.Add("columns", Model.GridRowColumnCount); 216 217 parms.Add("fullwidth", true); 218 parms.Add("cssClass", "img-fluid w-100 " + Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("ImageCustomClasses")); 219 220 <figure class="mb-0"> 221 @RenderPartial("Components/Image.cshtml", Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel(), parms) 222 </figure> 223 } 224 } 225 226 @{ 227 var colSizeClasslist = GetColumnWidthClassList(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("ImageWidth")); 228 229 string imgPlacement = string.Empty; 230 string imgFloat = string.Empty; 231 232 if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Image") 233 { 234 imgPlacement = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("ImagePlacement"); 235 } 236 else if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Graphic") 237 { 238 imgPlacement = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Graphic")?.GetString("ImagePlacement"); 239 } 240 241 if (imgPlacement == "image-top") 242 { 243 imgPlacement = "flex-column"; 244 imgFloat = "top"; 245 } 246 else if (imgPlacement == "image-left") 247 { 248 imgPlacement = "flex-column flex-md-row"; 249 imgFloat = "left-right"; 250 } 251 else if (imgPlacement == "image-right") 252 { 253 imgPlacement = "flex-column flex-md-row-reverse"; 254 imgFloat = "left-right"; 255 } 256 257 258 var parms = new Dictionary<string, object>(); 259 parms.Add("cssClass", "h-100 w-100"); 260 } 261 262 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 263 @using Dynamicweb.Ecommerce.ProductCatalog 264 @using System.IO 265 @using Dynamicweb.Frontend 266 267 @{ 268 bool movePageBehind = false; 269 bool isFirstPoster = false; 270 string movePageBehindClass = ""; 271 if (Pageview.Page.PropertyItem != null) 272 { 273 string headerCssClass = Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"] != null ? Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"].ToString() : "sticky-top"; 274 movePageBehind = headerCssClass == "fixed-top" && !Pageview.IsVisualEditorMode ? true : false; 275 276 if (movePageBehind) 277 { 278 movePageBehindClass = " poster-behind"; 279 if (!Dynamicweb.Context.Current.Items.Contains("firstPosterIsRendered")) 280 { 281 isFirstPoster = true; 282 Dynamicweb.Context.Current.Items.Add("firstPosterIsRendered", true); 283 } 284 285 } 286 287 } 288 } 289 290 @if (movePageBehind && isFirstPoster) 291 { 292 <script> 293 ['resize', 'load'].forEach(function (e) { 294 window.addEventListener(e, () => swift.Scroll.setContentPosition()); 295 }); 296 </script> 297 } 298 299 @using System.Collections.Generic 300 @using System.Linq 301 302 @{ 303 string layout = Model.Item?.GetItem("Paragraph_Text")?.GetRawValueString("Layout"); 304 var textColSizeClasslist = GetColumnWidthClassList(Model.Item?.GetItem("Paragraph_Text")?.GetItem("TextWidth")); 305 306 var textHeight = string.Empty; 307 if (string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("Image")) && !string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text")) && string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Graphic")?.GetString("Image"))) 308 { 309 textHeight = "h-100"; 310 } 311 312 if (layout == "top-left") 313 { 314 layout = "d-flex flex-column align-items-start"; 315 } else if (layout == "top-center") 316 { 317 layout = "d-flex flex-column align-items-center text-center mx-auto"; 318 } 319 else if (layout == "top-right") 320 { 321 layout = "d-flex flex-column align-items-end text-end ms-auto"; 322 } 323 else if (layout == "center-left") 324 { 325 layout = "d-flex flex-column justify-content-center"; 326 } 327 else if (layout == "center") 328 { 329 layout = "d-flex flex-column justify-content-center align-items-center text-center mx-auto"; 330 } 331 else if (layout == "center-right") 332 { 333 layout = "d-flex flex-column justify-content-center align-items-end text-end ms-auto"; 334 } 335 else if (layout == "bottom-left") 336 { 337 layout = "d-flex flex-column justify-content-end"; 338 } 339 else if (layout == "bottom-center") 340 { 341 layout = "d-flex flex-column justify-content-end align-items-center text-center mx-auto"; 342 } 343 else if (layout == "bottom-right") 344 { 345 layout = "d-flex flex-column justify-content-end align-items-end text-end ms-auto"; 346 } 347 } 348 349 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 350 @using System.Collections.Generic 351 @using Dynamicweb.Ecommerce.ProductCatalog 352 353 @{ 354 string linkType = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetRawValueString("LinkType", "page") != string.Empty ? Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetRawValueString("LinkType", "page") : string.Empty; 355 Dynamicweb.Frontend.LinkViewModel link = new Dynamicweb.Frontend.LinkViewModel(); 356 357 if (linkType == "page" && Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetLink("ButtonLink") != null) 358 { 359 link = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetLink("ButtonLink"); 360 } 361 362 if (linkType == "product-group") 363 { 364 IList<ProductGroupViewModel> selectedGroups = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetValue<IList<ProductGroupViewModel>>("ProductGroupLink"); 365 IList<string> groupIds = new List<string> {}; 366 367 if (selectedGroups != null) 368 { 369 foreach (var fromGroup in selectedGroups) 370 { 371 groupIds.Add(fromGroup.Id); 372 } 373 } 374 375 link = new Dynamicweb.Frontend.LinkViewModel() 376 { 377 Url = "/Default.aspx?ID=" + GetPageIdByNavigationTag("Shop") + "&GroupID=" + string.Join(",", groupIds) 378 }; 379 } 380 381 if (linkType == "product") 382 { 383 ProductListViewModel products = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetItem("Link")?.GetValue<ProductListViewModel>("ProductLink"); 384 IList<string> productIds = new List<string> {}; 385 386 if (products != null) 387 { 388 foreach (var product in products.Products) 389 { 390 productIds.Add(product.Id); 391 } 392 } 393 394 string productParameter = productIds.Count == 1 ? "ProductID" : "MainProductId"; 395 string pageTag = productIds.Count == 1 ? "ProductDetailPage" : "Shop"; 396 link = new Dynamicweb.Frontend.LinkViewModel() 397 { 398 Url = "/Default.aspx?ID=" + GetPageIdByNavigationTag(pageTag) + "&" + productParameter + "=" + string.Join(",", productIds) 399 }; 400 } 401 402 } 403 404 405 @{ 406 bool hasImage = Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetFile("Image") != null; 407 bool hasGraphic = Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Media")?.GetItem("Graphic")?.GetFile("Image") != null; 408 bool hasVideo = !string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoSourceID")); 409 bool hasText = !string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Text")?.GetString("Text")); 410 bool hasHeading = Model.Headings.Any(); 411 bool hasButton = Model.Buttons.Any(); 412 bool hasMicrosoftForm = !string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_MicrosoftForm")?.GetString("FormId")); 413 414 string panelHasGraphic = string.Empty; 415 if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Graphic") 416 { 417 panelHasGraphic = "panel-has-graphic"; 418 } 419 if (Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetFile("Image") != null) 420 { 421 panelHasGraphic = "panel-has-image"; 422 } 423 424 if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() != "Graphic" && Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetFile("Image") == null) 425 { 426 panelHasGraphic = "panel-text-no-image-or-graphic"; 427 } 428 } 429 430 @if (Model.Item?.GetItem("Paragraph_Media")?.GetItem("Image")?.GetString("ImagePlacement") == "image-poster" || Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video")?.GetString("VideoPlacement") == "video-poster") 431 { 432 string posterOverlay = string.Empty; 433 if (hasImage && hasText || hasImage && hasHeading || hasImage && hasButton) 434 { 435 posterOverlay = "poster-overlay"; 436 } 437 <div class="p-poster-container @posterOverlay" id="@Model.ID"> 438 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 439 440 @{ 441 string theme = string.Empty; 442 string posterHeight = string.Empty; 443 string mediaType = Model.Item.GetItem("Paragraph_Media").GetString("Media"); 444 445 if ( mediaType == "video") 446 { 447 posterHeight = Model.Item.GetItem("Paragraph_Media").GetItem("Video").GetString("Height"); 448 449 theme = !string.IsNullOrWhiteSpace(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Theme")) ? " theme " + Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 450 } else if (mediaType == "image") 451 { 452 posterHeight = Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetString("Height"); 453 454 theme = !string.IsNullOrWhiteSpace(Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("Theme")) ? " theme " + Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : string.Empty; 455 456 } 457 458 posterHeight = posterHeight == "auto" ? "height-auto" : posterHeight; 459 posterHeight = posterHeight == "small" ? "min-vh-50 min-vh-md-50" : posterHeight; 460 posterHeight = posterHeight == "medium" ? "min-vh-50 min-vh-md-75" : posterHeight; 461 posterHeight = posterHeight == "large" ? "min-vh-100 min-vh-md-100" : posterHeight; 462 posterHeight = posterHeight == "ratio-1x1" ? "ratio ratio-1x1 mx-auto" : posterHeight; 463 posterHeight = posterHeight == "ratio-4x3" ? "ratio ratio-4x3 mx-auto" : posterHeight; 464 posterHeight = posterHeight == "ratio-16x9" ? "ratio ratio-16x9 mx-auto" : posterHeight; 465 posterHeight = posterHeight == "ratio-9x16" ? "ratio ratio-9x16 mx-auto" : posterHeight; 466 posterHeight = posterHeight == "ratio-3x4" ? "ratio ratio-3x4 mx-auto" : posterHeight; 467 468 469 } 470 471 <div class="position-relative row @posterHeight @theme @(movePageBehindClass)"> 472 473 @if (Model.Item.GetItem("Paragraph_Media").GetString("Media") == "video") 474 { 475 <div class="p-poster-video-container position-absolute top-0 bottom-0 end-0 start-0 px-0"> 476 <video preload="auto" loop autoplay muted playsinline class="h-100 w-100" style="object-fit: cover;"> 477 <source src="@Model.Item.GetItem("Paragraph_Media").GetItem("Video").GetString("VideoPath")" 478 type="video/@Path.GetExtension(Model.Item.GetItem("Paragraph_Media").GetItem("Video").GetString("VideoPath")).ToLower().Replace(".", "")"> 479 </video> 480 </div> 481 482 } else if (Model.Item.GetItem("Paragraph_Media").GetString("Media") == "image") 483 { 484 <div class="position-absolute top-0 bottom-0 end-0 start-0 px-0"> 485 486 @if (link != null && !string.IsNullOrEmpty(link.Url)) 487 { 488 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "target=\"_blank\"" : ""; 489 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "rel=\"noopener\"" : ""; 490 <a class="bottom-0 position-absolute top-0 w-100" href="@link.Url" @target @rel style="z-index: 2"> 491 </a> 492 } 493 @RenderPartial("Components/Image.cshtml", Model.Item?.GetItem("Paragraph_Media").GetItem("Image").GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel(), parms) 494 </div> 495 <figure class="m-0"> 496 @RenderPartial("Components/Image.cshtml", Model.Item.GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel(), parms) 497 </figure> 498 499 } 500 501 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 502 @using System.Linq 503 504 505 <div class="d-flex @(posterHeight == "none" ? string.Empty : "position-absolute top-0 bottom-0")"> 506 <div class="container-xl mx-auto px-0 py-5 row"> 507 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dalgas.Custom.ViewModels.Content.ParagraphViewModel> 508 @using System.Linq 509 @using Dalgas.Custom.ViewModels.UI 510 511 @if (Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Text") != null) 512 { 513 if (Model.Headings.Any() || Model.Buttons.Any() || !string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text"))) 514 { 515 <div class="p-txt-container @textHeight @(layout) @textColSizeClasslist"> 516 517 @foreach (HeadingViewModel heading in Model.Headings) 518 { 519 @heading 520 } 521 522 @if (!string.IsNullOrEmpty(Model.Lead)) 523 { 524 <p class="lead">@Model.Lead</p> 525 } 526 527 @if (!string.IsNullOrEmpty(Model.Text)) 528 { 529 @Model.Text 530 } 531 532 @if (Model.Buttons.Any()) 533 { 534 <div class="d-flex flex-wrap gap-3"> 535 @foreach (ButtonViewModel button in Model.Buttons) 536 { 537 @button 538 } 539 </div> 540 } 541 </div> 542 } 543 } 544 545 </div> 546 </div> 547 548 </div> 549 550 </div> 551 } 552 else 553 { 554 if (hasImage || hasGraphic || hasVideo || hasText || hasHeading || hasButton) 555 { 556 string isCard = string.Empty; 557 558 if (Model.GetModuleOutput().Any()) 559 { 560 isCard = ""; 561 textHeight = ""; 562 } 563 else 564 { 565 isCard = "h-100"; 566 textHeight = ""; 567 } 568 if (imgPlacement?.Contains("row") == true) 569 { 570 isCard = "row"; 571 } 572 573 <div class="p-panel-container @textHeight @imgPlacement @panelHasGraphic" id="@Model.ID"> 574 <div class="@isCard"> 575 @if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Image") 576 { 577 if (Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Media").GetItem("Image").GetFile("Image") != null) 578 { 579 580 var imgPadding = string.Empty; 581 582 if (Model.Headings.Count() > 0 && imgFloat == "top") 583 { 584 imgPadding = "mb-4"; 585 } 586 587 else if (Model.Buttons.Any() && imgFloat == "top") 588 { 589 imgPadding = "mb-4"; 590 } 591 592 else if (!string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text")) && imgFloat == "top") 593 { 594 imgPadding = "mb-4"; 595 } 596 597 else 598 { 599 imgPadding = "mb-4 mb-sm-0"; 600 } 601 602 603 604 <div class="@imgPadding p-img-container @colSizeClasslist mx-auto"> 605 606 @if (link != null && !string.IsNullOrEmpty(link.Url)) 607 { 608 string target = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "target=\"_blank\"" : ""; 609 string rel = Pageview.AreaSettings.GetBoolean("OpenLinksInNewTab") && link.IsExternal ? "rel=\"noopener\"" : ""; 610 <a href="@link.Url" @target @rel> 611 @RenderImage() 612 </a> 613 } 614 else 615 { 616 @RenderImage() 617 } 618 619 </div> 620 } 621 622 } 623 else if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Graphic") 624 { 625 <div class="p-graphic-container mb-3 col flex-grow-0 pe-0"> 626 <div class="@(layout) graphic-size-@Model.Item.GetItem("Paragraph_Media").GetItem("Graphic").GetString("GraphicSize")"> 627 @RenderPartial("Components/Image.cshtml", Model.Item?.GetItem("Paragraph_Media")?.GetItem("Graphic")?.GetFile("Image") ?? new Dynamicweb.Frontend.FileViewModel()) 628 </div> 629 </div> 630 631 } 632 else if (Model.Item?.GetItem("Paragraph_Media")?.GetField("Media").Value.ToString() == "Video") 633 { 634 if (Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video")?.GetString("VideoPlacement") != "video-poster") 635 { 636 <div class="p-video-container"> 637 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 638 @using Dynamicweb.Ecommerce.ProductCatalog 639 640 @{ 641 642 643 string visual = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Visual", "inline"); 644 645 string provider = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("VideoSourceProvider", "none"); 646 string videoId = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoSourceID"); 647 648 Dynamicweb.Frontend.FileViewModel video = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetFile("VideoPath"); 649 string videoPath = video?.Path ?? ""; 650 651 string posterPath = "/Admin/Public/GetImage.ashx?image=" + @Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoPoster") + "&width=1000&format=webp"; 652 653 string iconPath = "/Files/Templates/Designs/Swift/Assets/icons/play.svg"; 654 string theme = !string.IsNullOrWhiteSpace(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Theme")) ? " theme " + Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 655 } 656 657 658 @switch(visual) { 659 case "inline" : 660 <div class="h-100 position-relative grid grid-1"> 661 662 @switch (provider) 663 { 664 case "youtube" : 665 case "vimeo" : 666 667 <div 668 id="player_@Pageview.CurrentParagraph.ID" 669 class="player plyr__video-embed @(theme) h-100 w-100" 670 data-plyr-provider="@provider" 671 data-plyr-embed-id="@videoId" 672 style="--plyr-color-main: var(--swift-foreground-color); " 673 > 674 </div> 675 676 break; 677 678 case "self-hosted" : 679 680 <video 681 id="player_@Pageview.CurrentParagraph.ID" 682 class="player plyr__video-embed @(theme) h-100 w-100" 683 src="@videoPath" 684 style="--plyr-color-main: var(--swift-foreground-color);" 685 preload="metadata" 686 poster="@posterPath"> 687 </video> 688 689 break; 690 } 691 <script type="module" defer src="~/Files/Templates/Designs/Swift/Assets/js/plyr.js"></script> 692 <script type="module" defer> 693 694 const player = new Plyr('#player_@Pageview.CurrentParagraph.ID', { 695 type: 'video', 696 youtube: { 697 noCookie: true, 698 showinfo: 0 699 }, 700 fullscreen: { 701 enabled: true, 702 iosNative: true, 703 } 704 }); 705 </script> 706 707 </div> 708 709 break; 710 711 case "poster-modal" : 712 <div class="h-100 position-relative@(theme) grid grid-1"> 713 <div class="player position-relative" data-player="player_@Pageview.CurrentParagraph.ID"> 714 715 @RenderVideo() 716 717 <div class="position-absolute top-0 bottom-0 end-0 start-0 h-100 d-flex align-items-center justify-content-center gradient-overlay"> 718 <button type="button" class="btn btn-primary rounded-circle lh-1 p-3" data-bs-toggle="modal" data-bs-target="#modal_@Pageview.CurrentParagraph.ID"> 719 <span class="icon-3"> 720 @ReadFile(iconPath) 721 </span> 722 <span class="visually-hidden">@Translate("Play video")</span> 723 </button> 724 </div> 725 </div> 726 </div> 727 728 <div class="modal fade" id="modal_@Pageview.CurrentParagraph.ID" tabindex="-1" aria-hidden="true"> 729 <div class="modal-dialog modal-xl modal-dialog-centered"> 730 <div class="modal-content"> 731 <div class="modal-body p-0"> 732 733 @switch (provider) 734 { 735 case "youtube" : 736 case "vimeo" : 737 738 <div 739 id="player_@Pageview.CurrentParagraph.ID" 740 class="player plyr__video-embed @(theme) h-100 w-100" 741 data-plyr-provider="@provider" 742 data-plyr-embed-id="@videoId" 743 style="--plyr-color-main: var(--swift-foreground-color); " 744 > 745 </div> 746 747 break; 748 749 case "self-hosted" : 750 751 <video 752 id="player_@Pageview.CurrentParagraph.ID" 753 class="player plyr__video-embed @(theme) h-100 w-100" 754 src="@videoPath" 755 style="--plyr-color-main: var(--swift-foreground-color);" 756 preload="metadata" 757 > 758 </video> 759 760 break; 761 } 762 <script type="module" src="~/Files/Templates/Designs/Swift/Assets/js/plyr.js"></script> 763 <script type="module"> 764 765 var player = new Plyr('#player_@Pageview.CurrentParagraph.ID', { 766 youtube: { 767 noCookie: true, 768 showinfo: 0 769 }, 770 fullscreen: { 771 enabled: true, 772 iosNative: true, 773 } 774 }); 775 776 document.querySelector('#modal_@Pageview.CurrentParagraph.ID').addEventListener('show.bs.modal', function (event) { 777 player.togglePlay(); 778 779 player.on('ready', event => { 780 player.play(); 781 }); 782 }); 783 784 document.querySelector('#modal_@Pageview.CurrentParagraph.ID').addEventListener('hide.bs.modal', function (event) { 785 player.pause(); 786 }); 787 </script> 788 789 </div> 790 </div> 791 </div> 792 </div> 793 794 break; 795 } 796 797 @helper RenderVideo() 798 { 799 string provider = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("VideoSourceProvider", "none"); 800 string videoId = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoSourceID"); 801 string ratio = Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetRawValueString("AspectRatio", ""); 802 ratio = ratio != "0" ? ratio : ""; 803 string ratioCssClass = ratio != "" && ratio != "fill" ? " ratio" : ""; 804 string ratioVariable = ratio != "" ? "style=\"--bs-aspect-ratio: " + ratio + "\"" : ""; 805 string fillClass = ratio == "fill" ? " h-100" : ""; 806 807 var parms = new Dictionary<string, object>(); 808 parms.Add("loading", "lazy"); 809 if (ratio == "fill") { 810 parms.Add("cssClass", "w-100 h-100"); 811 } 812 else 813 { 814 parms.Add("cssClass", "mw-100 mh-100"); 815 } 816 parms.Add("style",""); 817 parms.Add("alt", @Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("ImageAltText")); 818 parms.Add("columns", Model.GridRowColumnCount); 819 820 <figure class="m-0@(ratioCssClass)@(fillClass)" @ratioVariable> 821 822 @if (string.IsNullOrEmpty(Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetString("VideoPoster"))) 823 { 824 switch (provider) 825 { 826 case "youtube" : 827 @RenderYouTubePoster(videoId) 828 break; 829 830 case "vimeo" : 831 @RenderVimeoPoster(videoId) 832 break; 833 } 834 } 835 else 836 { 837 @RenderPartial("Components/Image.cshtml", Model.Item?.GetItem("Paragraph_Media")?.GetItem("Video").GetFile("VideoPoster") ?? new Dynamicweb.Frontend.FileViewModel(), parms) 838 } 839 840 </figure> 841 } 842 843 @helper RenderYouTubePoster(string videoId) 844 { 845 <script type="module"> 846 function setVideoThumbnail(source) { 847 var figure = document.querySelector("[data-player='player_@Pageview.CurrentParagraph.ID'] figure"); 848 var thumbnail = document.createElement("img"); 849 thumbnail.style = "object-fit: cover;"; 850 thumbnail.classList.add('mw-100','mh-100'); 851 thumbnail.src = source; 852 figure.appendChild(thumbnail); 853 }; 854 setVideoThumbnail('https://i.ytimg.com/vi/@(videoId)/hqdefault.jpg'); 855 </script> 856 } 857 858 @helper RenderVimeoPoster(string videoId) 859 { 860 <script type="module"> 861 function setVideoThumbnail(source) { 862 let figure = document.querySelector("[data-player='player_@Pageview.CurrentParagraph.ID'] figure"); 863 let thumbnail = document.createElement("img"); 864 thumbnail.style = "object-fit: cover;"; 865 thumbnail.classList.add('mw-100','mh-100'); 866 thumbnail.src = source; 867 figure.appendChild(thumbnail); 868 }; 869 function getVimeoThumbnail() { 870 fetch('https://vimeo.com/api/v2/video/@(videoId).json') 871 .then(function(response) { 872 return response.text(); 873 }) 874 .then(function(data) { 875 let { thumbnail_large } = JSON.parse(data)[0]; 876 let thumbnail = `${thumbnail_large}`; 877 thumbnail = thumbnail.replace("_640", "_1920"); 878 setVideoThumbnail(thumbnail); 879 }) 880 .catch(error => { 881 console.log(error); 882 }); 883 } 884 885 getVimeoThumbnail(); 886 </script> 887 } 888 889 </div> 890 } 891 } 892 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dalgas.Custom.ViewModels.Content.ParagraphViewModel> 893 @using System.Linq 894 @using Dalgas.Custom.ViewModels.UI 895 896 @if (Model != null && Model.Item != null && Model.Item.GetItem("Paragraph_Text") != null) 897 { 898 if (Model.Headings.Any() || Model.Buttons.Any() || !string.IsNullOrEmpty(Model.Item.GetItem("Paragraph_Text").GetString("Text"))) 899 { 900 <div class="p-txt-container @textHeight @(layout) @textColSizeClasslist"> 901 902 @foreach (HeadingViewModel heading in Model.Headings) 903 { 904 @heading 905 } 906 907 @if (!string.IsNullOrEmpty(Model.Lead)) 908 { 909 <p class="lead">@Model.Lead</p> 910 } 911 912 @if (!string.IsNullOrEmpty(Model.Text)) 913 { 914 @Model.Text 915 } 916 917 @if (Model.Buttons.Any()) 918 { 919 <div class="d-flex flex-wrap gap-3"> 920 @foreach (ButtonViewModel button in Model.Buttons) 921 { 922 @button 923 } 924 </div> 925 } 926 </div> 927 } 928 } 929 930 </div> 931 </div> 932 } 933 else 934 { 935 if (Pageview.IsVisualEditorMode) 936 { 937 <div class="alert alert-warning" role="alert"> 938 @Translate("This paragraph is empty") 939 </div> 940 } 941 } 942 } 943 @if (hasMicrosoftForm) 944 { 945 string formBlockId = Model.Item?.GetItem("Paragraph_MicrosoftForm")?.GetString("FormId"); 946 string formContainerId = Model.Item?.GetItem("Paragraph_MicrosoftForm")?.GetString("ContainerId"); 947 <div class="js-remove-microsoft-form-styling microsoft-form-container"> 948 <script src="https://cxppusa1formui01cdnsa01-endpoint.azureedge.net/eur/FormLoader/FormLoader.bundle.js" crossorigin="anonymous" defer></script> 949 <div data-cached-form-url="https://assets-eur.mkt.dynamics.com/@formBlockId/digitalassets/forms/@formContainerId" data-form-api-url="https://public-eur.mkt.dynamics.com/api/v1.0/orgs/@formBlockId/landingpageforms" data-form-id="@formContainerId"></div> 950 </div> 951 } 952 else 953 { 954 @Model.GetModuleOutput() 955 } 956

Overskrift om medlemsfordele

Hedeselskabets forening er et fællesskab med dedikerede medlemmer med interesse for benyttelse og beskyttelse af naturen. Der er mange gode grunde til at være medlem af Hedeselskabet. Her har du fire af dem:

Netværk

Som medlem bliver du en del af et stærkt, fagligt interessefællesskab, som består af en bred kreds af fagfolk, beslutningstagere, studerende og andre med interesse for natur, klima, bæredygtighed og biodiversitet.

Viden

Som medlem modtager du Hedeselskabets magasin VÆKST fire gange årligt. Du får i VÆKST ny viden og faglig indsigt i naturpleje, klimatilpasning, bæredygtighed og biodiversitet samt adgang til fysiske og digitale arrangementer og digitale platforme.

Oplevelser

Som medlem kan du deltage i Hedeselskabets mange arrangementer. De er gratis for medlemmer og giver faglig viden, indsigt, netværk med ligesindede samt mulighed for at deltage på en årlig jagt og en fisketur.

Indflydelse

Som medlem kan du foreslå, hvilke projekter Hedeselskabet skal støtte med midler fra medlemspuljen, ligesom du selv kan søge midler. Du har også mulighed for at stemme, når der er valg til Hedeselskabets repræsentantskab, som er vores øverste myndighed.

Se mere om medlemskaber
Article
Published on 12. March 2026

No products in cart