Et nærbillede af en sort dagrenovationscontainer, der står op ad en rød murstensvæg

Dagrenovation

Dagrenovation er den rest af affald, der er tilbage, når du har sorteret fra til genbrug, genanvendelse og farligt affald.

Vi henter dagrenovation hver 14. dag og kører den direkte til forbrænding på Aars Fjernvarme, hvor den bliver til varme og strøm.

Error executing template "Designs/VF2019/Paragraph/Paragraph.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_53124e9d7ed84e17b662d5dd36c51444.Execute() in D:\home\site\wwwroot\Files\Templates\Designs\VF2019\Paragraph\Paragraph.cshtml:line 12
   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 @using Dynamicweb.Rendering 2 @using Dynamicweb.Frontend 3 @using System.Text.RegularExpressions 4 @inherits ViewModelTemplate<ParagraphViewModel> 5 @{ 6 Dynamicweb.Frontend.ItemViewModel content = Model.Item.GetItem("Content"); 7 Dynamicweb.Frontend.ItemViewModel image = Model.Item.GetItem("Image"); 8 Dynamicweb.Frontend.ItemViewModel video = Model.Item.GetItem("Video"); 9 Dynamicweb.Frontend.ItemViewModel code = Model.Item.GetItem("Code"); 10 Dynamicweb.Frontend.ItemViewModel layout = Model.Item.GetItem("Layout"); 11 12 string heading = content.GetString("Heading"); 13 string text = content.GetString("Text"); 14 15 string device = Dynamicweb.Frontend.Devices.DeviceInfo.ParseFromUserAgentString(Dynamicweb.Context.Current.Request.UserAgent).DeviceType.ToString(); 16 int imageFullWidth = device == "Mobile" || device == "Bot" ? 840 : device == "Tablet" ? 1000 : 1920; 17 18 string contentWidthClass = layout.GetItem("Layout").GetList("Width").SelectedValue + 19 " " + layout.GetItem("Layout").GetList("WidthSM").SelectedValue + 20 " " + layout.GetItem("Layout").GetList("WidthMD").SelectedValue + 21 " " + layout.GetItem("Layout").GetList("WidthLG").SelectedValue; 22 23 24 string paragraphClass = "paragraph " + contentWidthClass; 25 } 26 27 @if (layout.GetBoolean("StartNewRow")) 28 { 29 string newRow = "</div><div class=\"row\">"; 30 @newRow 31 } 32 @if (layout.GetBoolean("Panel") && !string.IsNullOrWhiteSpace(heading)) 33 { 34 <article id="paragraph-@Model.ID" class="panel-wrapper col-12 col-sm-12 col-md-12 col-lg-12"> 35 <div class="panel"> 36 <a data-toggle="collapse" href="#paragraph-panel-@Model.ID" class="collapsed" aria-controls="#paragraph-panel-@Model.ID" aria-expanded="false"> 37 <div class="panel-heading"> 38 <div class="d-inline-block"> 39 <h2 class="panel-title"> 40 @heading 41 </h2> 42 </div> 43 <div class="float-right"> 44 <div class="plus-btn"> 45 <span></span> 46 <span></span> 47 </div> 48 </div> 49 </div> 50 </a> 51 <div id="paragraph-panel-@Model.ID" class="panel-collapse row collapse" aria-expanded="false" style="height: 0px;"> 52 <div class="panel-body"> 53 @RenderContent(content, image, video, code, Model.GetModuleOutput(), imageFullWidth) 54 </div> 55 </div> 56 </div> 57 </article> 58 } 59 else 60 { 61 <article id="paragraph-@Model.ID" class="@paragraphClass"> 62 <div class="row"> 63 @if (!string.IsNullOrWhiteSpace(heading)) 64 { 65 <div class="col-12"> 66 <h2> 67 @heading 68 </h2> 69 </div> 70 } 71 @RenderContent(content, image, video, code, Model.GetModuleOutput(), imageFullWidth) 72 </div> 73 </article> 74 } 75 76 @helper ParagraphVideo(string videoUrl, string width = "", string height = "") 77 { 78 Match match; 79 80 if ((match = Regex.Match(videoUrl, @"^https?://youtu.be/(?<id>[^?&/]+)")).Success || (match = Regex.Match(videoUrl, @"^https?://www.youtube.com/watch\?v=(?<id>[^?&/]+)")).Success) 81 { 82 var url = string.Format("//www.youtube.com/embed/{0}?rel=0&showinfo=0", match.Groups["id"]); 83 @ParagraphYouTubeVideo(url, width, height); 84 } 85 else if ((match = Regex.Match(videoUrl, @"^https?://vimeo.com/(?<id>[^?&/]+)")).Success) 86 { 87 var url = string.Format("//player.vimeo.com/video/{0}?title=0&amp;byline=0&amp;portrait=0&amp;badge=0", match.Groups["id"]); 88 @ParagraphVimeoVideo(url, width, height); 89 } 90 else 91 { 92 @ParagraphUnknownVideo(videoUrl, width, height); 93 } 94 } 95 96 @helper ParagraphYouTubeVideo(string url, string width, string height) 97 { 98 <iframe width='@(width ?? "560")' height='@(height ?? "350")' src='@url' frameborder='0' allowfullscreen></iframe> 99 } 100 @helper ParagraphVimeoVideo(string url, string width, string height) 101 { 102 <iframe src='@url' width='@(width ?? "500")' height='@(height ?? "281")' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 103 } 104 @helper ParagraphUnknownVideo(string url, string width, string height) 105 { 106 <div style='width: @(width ?? "500px"); height: @(height ?? "281px")'> 107 @*<a href='@url'>@url</a>*@ 108 @url 109 </div> 110 } 111 112 @helper RenderContent(Dynamicweb.Frontend.ItemViewModel content, Dynamicweb.Frontend.ItemViewModel image, Dynamicweb.Frontend.ItemViewModel video, Dynamicweb.Frontend.ItemViewModel code, string module, int width) 113 { 114 if (image.GetFile("File") != null) 115 { 116 string imagePath = "/Admin/Public/GetImage.ashx?Image=" + image.GetFile("File").PathUrlEncoded + "&Format=.jpeg" + "&Width=" + width + "&Crop=6&DoNotUpscale=1"; 117 <div class="col-12"> 118 <img src="@imagePath" class="img-fluid w-100 mb-2" alt="@image.GetString("Alt")" title="@image.GetString("Title")" /> 119 </div> 120 } 121 if (!string.IsNullOrWhiteSpace(content.GetString("Text"))) 122 { 123 <div class="col-12"> 124 @content.GetString("Text") 125 </div> 126 } 127 if (!string.IsNullOrWhiteSpace(video.GetString("Link"))) 128 { 129 var videoStyle = ""; 130 if (video != null && !string.IsNullOrWhiteSpace(video.GetString("Width"))) 131 { 132 videoStyle += "width:" + video.GetString("Width") + "px; "; 133 } 134 if (video != null && !string.IsNullOrWhiteSpace(video.GetString("Height"))) 135 { 136 videoStyle += "height:" + video.GetString("Height") + "px;"; 137 } 138 139 <div class="col-12"> 140 <figure class="iframeContainer" style="@videoStyle"> 141 @ParagraphVideo(video.GetString("Link"), video.GetString("Width"), video.GetString("Height")) 142 </figure> 143 </div> 144 } 145 if (!string.IsNullOrWhiteSpace(module)) 146 { 147 <div class="col-12"> 148 @module 149 </div> 150 } 151 if (!string.IsNullOrWhiteSpace(code.GetString("Text"))) 152 { 153 <div class="col-12"> 154 @code.GetString("Text") 155 </div> 156 } 157 158 }