Egenproduktion af genbrugsplastEgenproduktion af genbrugsplast
Bestil før kl. 14.00 - så sender vi i dagBestil før kl. 14.00 - så sender vi i dag
Lagerførende på varer til akutopgaverLagerførende på varer til akutopgaver
Gratis beregning og dimensioneringGratis beregning og dimensionering
Error executing template "/Designs/Rapido/Paragraph/NZParagraph.cshtml"
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Exception of type 'System.InvalidOperationException' was thrown.
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.VerifyIntegrity()
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.TryGetValue(TKey key, TValue& value)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValue(TKey key, CreateValueCallback createValueCallback)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetOrCreateValue(TKey key)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CSharpSyntaxNode.GetStructure(SyntaxTrivia trivia)
   at Microsoft.CodeAnalysis.SyntaxTrivia.GetStructure()
   at Microsoft.CodeAnalysis.SyntaxNode.<DescendantTriviaIntoTrivia>d__171.MoveNext()
   at Microsoft.CodeAnalysis.SyntaxNodeOrToken.GetDirectives[TDirective](SyntaxNode node, Func`2 filter, List`1& directives)
   at Microsoft.CodeAnalysis.SyntaxNodeOrToken.GetDirectives[TDirective](SyntaxNodeOrToken& node, Func`2 filter, List`1& directives)
   at Microsoft.CodeAnalysis.CSharp.Syntax.NullableContextStateMap.GetContexts(SyntaxTree tree, Boolean isGeneratedCode)
   at Microsoft.CodeAnalysis.CSharp.Syntax.NullableContextStateMap.Create(SyntaxTree tree, Boolean isGeneratedCode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.EnsureNullableContextMapInitialized()
   at Microsoft.CodeAnalysis.CSharp.Binder.AreNullableAnnotationsEnabled(SyntaxTree syntaxTree, Int32 position)
   at Microsoft.CodeAnalysis.CSharp.Binder.AreNullableAnnotationsEnabled(SyntaxToken token)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNonGenericSimpleNamespaceOrTypeOrAliasSymbol(IdentifierNameSyntax node, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics, NamespaceOrTypeSymbol qualifierOpt)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeOrAliasSymbol(ExpressionSyntax syntax, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeSymbol(ExpressionSyntax syntax, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeSymbol(ExpressionSyntax syntax, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved)
   at Microsoft.CodeAnalysis.CSharp.Imports.FromSyntax(CSharpSyntaxNode declarationSyntax, InContainerBinder binder, ConsList`1 basesBeingResolved, Boolean inUsing)
   at Microsoft.CodeAnalysis.CSharp.InContainerBinder.<>c__DisplayClass6_0.<.ctor>b__0(ConsList`1 basesBeingResolved)
   at Microsoft.CodeAnalysis.CSharp.InContainerBinder.GetImports(ConsList`1 basesBeingResolved)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetImports(SingleNamespaceDeclaration declaration)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.<>c__DisplayClass49_1.<ForceComplete>b__0(Int32 i)
   at Roslyn.Utilities.UICultureUtilities.<>c__DisplayClass6_0`1.<WithCurrentUICulture>b__0(T param)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.<>c__DisplayClass49_1.<ForceComplete>b__0(Int32 i)
   at Roslyn.Utilities.UICultureUtilities.<>c__DisplayClass6_0`1.<WithCurrentUICulture>b__0(T param)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceModuleSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetSourceDeclarationDiagnostics(SyntaxTree syntaxTree, Nullable`1 filterSpanWithinTree, Func`4 locationFilterOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnostics(CompilationStage stage, Boolean includeEarlierStages, DiagnosticBag diagnostics, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CompileMethods(CommonPEModuleBuilder moduleBuilder, Boolean emittingPdb, Boolean emitMetadataOnly, Boolean emitTestCoverageData, DiagnosticBag diagnostics, Predicate`1 filterOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Compilation.Emit(Stream peStream, Stream metadataPEStream, Stream pdbStream, Stream xmlDocumentationStream, Stream win32Resources, IEnumerable`1 manifestResources, EmitOptions options, IMethodSymbol debugEntryPoint, Stream sourceLinkStream, IEnumerable`1 embeddedTexts, CompilationTestData testData, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Compilation.Emit(Stream peStream, Stream pdbStream, Stream xmlDocumentationStream, Stream win32Resources, IEnumerable`1 manifestResources, EmitOptions options, IMethodSymbol debugEntryPoint, Stream sourceLinkStream, IEnumerable`1 embeddedTexts, Stream metadataPEStream, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Compilation.Emit(Stream peStream, Stream pdbStream, Stream xmlDocumentationStream, Stream win32Resources, IEnumerable`1 manifestResources, EmitOptions options, CancellationToken cancellationToken)
   at RazorEngine.Roslyn.CSharp.RoslynCompilerServiceBase.CompileType(TypeContext context)
   at RazorEngine.Templating.RazorEngineCore.CreateTemplateType(ITemplateSource razorTemplate, Type modelType)
   at RazorEngine.Templating.RazorEngineCore.Compile(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.DynamicWrapperService.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 RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Exception of type 'System.InvalidOperationException' was thrown.
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.VerifyIntegrity()
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.TryGetValue(TKey key, TValue& value)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValue(TKey key, CreateValueCallback createValueCallback)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetOrCreateValue(TKey key)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CSharpSyntaxNode.GetStructure(SyntaxTrivia trivia)
   at Microsoft.CodeAnalysis.SyntaxTrivia.GetStructure()
   at Microsoft.CodeAnalysis.SyntaxNode.<DescendantTriviaIntoTrivia>d__171.MoveNext()
   at Microsoft.CodeAnalysis.SyntaxNodeOrToken.GetDirectives[TDirective](SyntaxNode node, Func`2 filter, List`1& directives)
   at Microsoft.CodeAnalysis.SyntaxNodeOrToken.GetDirectives[TDirective](SyntaxNodeOrToken& node, Func`2 filter, List`1& directives)
   at Microsoft.CodeAnalysis.CSharp.Syntax.NullableContextStateMap.GetContexts(SyntaxTree tree, Boolean isGeneratedCode)
   at Microsoft.CodeAnalysis.CSharp.Syntax.NullableContextStateMap.Create(SyntaxTree tree, Boolean isGeneratedCode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.EnsureNullableContextMapInitialized()
   at Microsoft.CodeAnalysis.CSharp.Binder.AreNullableAnnotationsEnabled(SyntaxTree syntaxTree, Int32 position)
   at Microsoft.CodeAnalysis.CSharp.Binder.AreNullableAnnotationsEnabled(SyntaxToken token)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNonGenericSimpleNamespaceOrTypeOrAliasSymbol(IdentifierNameSyntax node, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics, NamespaceOrTypeSymbol qualifierOpt)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeOrAliasSymbol(ExpressionSyntax syntax, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeSymbol(ExpressionSyntax syntax, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeSymbol(ExpressionSyntax syntax, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved)
   at Microsoft.CodeAnalysis.CSharp.Imports.FromSyntax(CSharpSyntaxNode declarationSyntax, InContainerBinder binder, ConsList`1 basesBeingResolved, Boolean inUsing)
   at Microsoft.CodeAnalysis.CSharp.InContainerBinder.<>c__DisplayClass6_0.<.ctor>b__0(ConsList`1 basesBeingResolved)
   at Microsoft.CodeAnalysis.CSharp.InContainerBinder.GetImports(ConsList`1 basesBeingResolved)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetImports(SingleNamespaceDeclaration declaration)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.<>c__DisplayClass49_1.<ForceComplete>b__0(Int32 i)
   at Roslyn.Utilities.UICultureUtilities.<>c__DisplayClass6_0`1.<WithCurrentUICulture>b__0(T param)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.<>c__DisplayClass49_1.<ForceComplete>b__0(Int32 i)
   at Roslyn.Utilities.UICultureUtilities.<>c__DisplayClass6_0`1.<WithCurrentUICulture>b__0(T param)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)
---> (Inner Exception #0) System.InvalidOperationException: Exception of type 'System.InvalidOperationException' was thrown.
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.VerifyIntegrity()
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.TryGetValue(TKey key, TValue& value)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValue(TKey key, CreateValueCallback createValueCallback)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetOrCreateValue(TKey key)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CSharpSyntaxNode.GetStructure(SyntaxTrivia trivia)
   at Microsoft.CodeAnalysis.SyntaxTrivia.GetStructure()
   at Microsoft.CodeAnalysis.SyntaxNode.<DescendantTriviaIntoTrivia>d__171.MoveNext()
   at Microsoft.CodeAnalysis.SyntaxNodeOrToken.GetDirectives[TDirective](SyntaxNode node, Func`2 filter, List`1& directives)
   at Microsoft.CodeAnalysis.SyntaxNodeOrToken.GetDirectives[TDirective](SyntaxNodeOrToken& node, Func`2 filter, List`1& directives)
   at Microsoft.CodeAnalysis.CSharp.Syntax.NullableContextStateMap.GetContexts(SyntaxTree tree, Boolean isGeneratedCode)
   at Microsoft.CodeAnalysis.CSharp.Syntax.NullableContextStateMap.Create(SyntaxTree tree, Boolean isGeneratedCode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.EnsureNullableContextMapInitialized()
   at Microsoft.CodeAnalysis.CSharp.Binder.AreNullableAnnotationsEnabled(SyntaxTree syntaxTree, Int32 position)
   at Microsoft.CodeAnalysis.CSharp.Binder.AreNullableAnnotationsEnabled(SyntaxToken token)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNonGenericSimpleNamespaceOrTypeOrAliasSymbol(IdentifierNameSyntax node, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics, NamespaceOrTypeSymbol qualifierOpt)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeOrAliasSymbol(ExpressionSyntax syntax, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeSymbol(ExpressionSyntax syntax, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved, Boolean suppressUseSiteDiagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindNamespaceOrTypeSymbol(ExpressionSyntax syntax, DiagnosticBag diagnostics, ConsList`1 basesBeingResolved)
   at Microsoft.CodeAnalysis.CSharp.Imports.FromSyntax(CSharpSyntaxNode declarationSyntax, InContainerBinder binder, ConsList`1 basesBeingResolved, Boolean inUsing)
   at Microsoft.CodeAnalysis.CSharp.InContainerBinder.<>c__DisplayClass6_0.<.ctor>b__0(ConsList`1 basesBeingResolved)
   at Microsoft.CodeAnalysis.CSharp.InContainerBinder.GetImports(ConsList`1 basesBeingResolved)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetImports(SingleNamespaceDeclaration declaration)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.<>c__DisplayClass49_1.<ForceComplete>b__0(Int32 i)
   at Roslyn.Utilities.UICultureUtilities.<>c__DisplayClass6_0`1.<WithCurrentUICulture>b__0(T param)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)<---
<---


1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 4 5 @functions { 6 public string columnClass() 7 { 8 if (Model.Item.GetList("WidthMobile").SelectedValue == "hide"){ 9 return "grid__col-lg-" + Model.Item.GetList("Width").SelectedValue + " grid__col-md-" + Model.Item.GetList("Width").SelectedValue + " grid__col-sm-" + Model.Item.GetList("Width").SelectedValue + " u-hidden-xs u-hidden-xxs"; 10 } else { 11 return "grid__col-lg-" + Model.Item.GetList("Width").SelectedValue + " grid__col-md-" + Model.Item.GetList("Width").SelectedValue + " grid__col-sm-" + Model.Item.GetList("Width").SelectedValue + " grid__col-xs-" + Model.Item.GetList("WidthMobile").SelectedValue; 12 } 13 } 14 } 15 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 16 @using Dynamicweb.Frontend 17 18 @helper RenderContent(ItemViewModel item, bool isCarousel = false) 19 { 20 string cardClass = item.GetBoolean("ShowAsCard") ? "paragraph-card" : "grid__cell"; 21 cardClass = Pageview.Device.ToString() != "Tablet" ? cardClass : "grid__cell"; 22 23 if (item.GetList("ContentPositions").SelectedValue == "image-top" || item.GetList("ContentPositions").SelectedValue == "image-centered" || string.IsNullOrEmpty(item.GetList("ContentPositions").SelectedValue)) 24 { 25 <div class="@cardClass"> 26 @RenderImage(item, isCarousel) 27 @RenderHeading(item) 28 @RenderText(item) 29 @RenderModule(item) 30 </div> 31 @RenderButton(item) 32 } 33 34 if (item.GetList("ContentPositions").SelectedValue == "title-top") 35 { 36 <div class="@cardClass"> 37 @RenderHeading(item) 38 @RenderImage(item, isCarousel) 39 @RenderText(item) 40 @RenderModule(item) 41 </div> 42 @RenderButton(item) 43 } 44 45 if (item.GetList("ContentPositions").SelectedValue == "image-left") 46 { 47 <div class="grid"> 48 <div class="grid__col-3"> 49 @RenderImage(item, isCarousel) 50 </div> 51 <div class="grid__col-9"> 52 @RenderHeading(item) 53 @RenderText(item) 54 @RenderModule(item) 55 @RenderButton(item) 56 </div> 57 </div> 58 } 59 60 if (item.GetList("ContentPositions").SelectedValue == "all-centered") 61 { 62 <div class="u-ta-center @cardClass"> 63 @RenderImage(item, isCarousel) 64 @RenderHeading(item) 65 @RenderText(item) 66 @RenderModule(item) 67 </div> 68 @RenderButton(item) 69 } 70 71 if (item.GetList("ContentPositions").SelectedValue == "middle-center") 72 { 73 <div class="u-ta-center u-middle"> 74 <div class="@cardClass"> 75 @RenderImage(item, isCarousel) 76 @RenderHeading(item) 77 @RenderText(item) 78 @RenderModule(item) 79 </div> 80 @RenderButton(item) 81 </div> 82 } 83 84 if (item.GetList("ContentPositions").SelectedValue == "middle-left") 85 { 86 <div class="grid__cell u-middle"> 87 <div class="@cardClass"> 88 @RenderImage(item, isCarousel) 89 @RenderHeading(item) 90 @RenderText(item) 91 @RenderModule(item) 92 </div> 93 @RenderButton(item) 94 </div> 95 } 96 } 97 98 @helper RenderHeading(ItemViewModel item) 99 { 100 if (item.GetBoolean("ShowTitle") != false && !string.IsNullOrEmpty(item.GetString("Title"))) 101 { 102 string headerMargin = item.GetString("Text") != "" && item.GetString("Image") != "" ? "u-margin-bottom" : ""; 103 headerMargin = Model.GetModuleOutput() == "" ? headerMargin : "u-margin-bottom"; 104 string url = item.GetString("Link"); 105 106 if (!String.IsNullOrEmpty(url)) 107 { 108 <a href="@url"> 109 <h1 class="@headerMargin">@item.GetString("Title")</h1> 110 </a> 111 } 112 else 113 { 114 <h1 class="@headerMargin">@item.GetString("Title")</h1> 115 } 116 } 117 } 118 119 @helper RenderButton(ItemViewModel item) 120 { 121 string url = item.GetString("Link"); 122 string linkText = item.GetString("LinkText"); 123 string footerCssClass = ""; 124 string cardFooterClass = item.GetBoolean("ShowAsCard") ? "paragraph-card-footer" : "grid__cell-footer d-block"; 125 cardFooterClass = Pageview.Device.ToString() != "Tablet" ? cardFooterClass : ""; 126 127 if (item.GetList("ContentPositions").SelectedValue == "all-centered" || item.GetList("ContentPositions").SelectedValue == "middle-center") { 128 footerCssClass = "grid--justify-center"; 129 } 130 131 if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(linkText)) 132 { 133 string buttonStyle = !String.IsNullOrEmpty(item.GetList("ButtonDesign").SelectedValue) ? item.GetList("ButtonDesign").SelectedValue : "primary"; 134 135 <div class="@footerCssClass @cardFooterClass"> 136 <div class="u-margin-top u-margin-bottom"> 137 @if (url.Contains("http")) 138 { 139 <a href="@url" class="btn btn--@buttonStyle dw-mod" target="_blank">@linkText</a> 140 } 141 else if (url.Contains("/")) 142 { 143 <a href="@url" class="btn btn--@buttonStyle dw-mod" download>@linkText</a> 144 } 145 else 146 { 147 <a href="@url" class="btn btn--@buttonStyle dw-mod">@linkText</a> 148 } 149 </div> 150 </div> 151 } else { 152 <div class="grid__cell-footer @footerCssClass @cardFooterClass"></div> 153 } 154 } 155 156 @helper RenderText(ItemViewModel item) 157 { 158 if (!string.IsNullOrWhiteSpace(item.GetString("Text"))) 159 { 160 @item.GetString("Text") 161 } 162 } 163 164 @helper RenderModule(ItemViewModel item) 165 { 166 @Model.GetModuleOutput(); 167 } 168 169 @helper RenderImage(ItemViewModel item, bool isCarousel) 170 { 171 if (!string.IsNullOrEmpty(item.GetString("Image")) && item.GetList("ImageStyle").SelectedValue != "background") 172 { 173 string url = item.GetString("Link"); 174 175 <div class="u-margin-bottom"> 176 @if (!String.IsNullOrEmpty(url)) 177 { 178 <a href="@url"> 179 @RenderImageElement(item, isCarousel) 180 </a> 181 } 182 else 183 { 184 @RenderImageElement(item, isCarousel) 185 } 186 </div> 187 } 188 } 189 190 @helper RenderImageElement(ItemViewModel item, bool isCarousel) 191 { 192 string image = item.GetFile("Image") != null ? System.Web.HttpContext.Current.Server.UrlEncode(item.GetFile("Image").Path) : ""; 193 string altText = item.GetString("Title"); 194 string imgCssClass = ""; 195 string imgCrop = !string.IsNullOrEmpty(item.GetList("ImageCrop").SelectedValue) ? item.GetList("ImageCrop").SelectedValue : "5"; 196 string imageBoxWidth = "480"; 197 int imageWidth = Int32.Parse(item.GetList("Width").SelectedValue) < 8 ? 496 : 992; 198 int imageHeight = Int32.Parse(item.GetList("Width").SelectedValue) < 8 ? 380 : 760; 199 string placeHolderImage = "/Files/Images/placeholder.gif"; 200 201 if (item.GetList("ContentPositions").SelectedValue == "image-centered" || item.GetList("ContentPositions").SelectedValue == "all-centered" || item.GetList("ContentPositions").SelectedValue == "middle-center") 202 { 203 imgCssClass = "grid__cell-img--centered"; 204 } 205 206 if (item.GetList("ImageStyle").SelectedValue == "ball") 207 { 208 imgCssClass += " grid__cell-img--ball"; 209 if (!isCarousel) 210 { 211 <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" alt="@altText"> 212 } 213 else 214 { 215 <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" alt="@altText"> 216 } 217 } 218 else 219 { 220 string largeImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth + "&amp;height=" + imageHeight + "&amp;crop=" + imgCrop + "&amp;Compression=75&amp;FillCanvas=true&amp;DoNotUpscale=true&amp;image=" + image; 221 string smallImage = "/Admin/Public/GetImage.ashx?width=" + imageWidth/2 + "&amp;height=" + imageHeight/2 + "&amp;crop=" + imgCrop + "&amp;Compression=75&amp;DoNotUpscale=true&amp;FillCanvas=true&amp;image=" + image; 222 223 if (!isCarousel) 224 { 225 <img class="@imgCssClass b-lazy" src="@placeHolderImage" data-src="@largeImage" data-src-small="@smallImage" alt="@altText"> 226 } 227 else 228 { 229 <img class="@imgCssClass" src="@largeImage" alt="@altText"> 230 } 231 } 232 } 233 234 @{ 235 string backgroundImage = ""; 236 string extraCssClasses = ""; 237 string imageStyle = Model.Item.GetList("ImageStyle").SelectedValue; 238 239 if (imageStyle == "background") 240 { 241 extraCssClasses = " grid__col--bg"; 242 string cropMode = Model.Item.GetList("ImageCrop").SelectedValue != null ? Model.Item.GetList("ImageCrop").SelectedValue : "0"; 243 backgroundImage = "background-image:url(/Admin/Public/GetImage.ashx?width=2500&amp;height=1100&amp;crop=" + cropMode + "&DoNotUpscale=true&amp;Compression=75&amp;image=" + Model.Item.GetFile("Image").Path + ");"; 244 } 245 } 246 247 248 <div class="@columnClass() @extraCssClasses center-container paragraph-container" style="@backgroundImage"> 249 @RenderContent(Model.Item) 250 </div>