/Files/Icons/phone.svg
  • +46728433495
  • /Files/Icons/envelope.svg
  • sales@plamako.se
    /Files/Icons/1_none.svg
  • Om oss
    • Vilka är vi
    • Medarbetare
    • Leverantörer
  • /Files/Icons/1_none.svg
  • Kontakta oss
    /Files/Icons/user.svg
  • Logga in
    • Logga in
    • Glömt lösenord
    • Skapa konto
  • /Files/Icons/shopping-bag.svg
  • Cart 0
  • Produkter
    Vattenkopplingar
    Flödesmätning
    Förbrukningsvaror
    Temperaturkontroll
    Materialhantering
    End Of Arm Tooling
    Skruvspetsar
    Handverktyg
    Maskintillbehör
    Spännjärn
    Lyftteknik
    Formkomponenter
    Kringutrustning
    Error executing template "Designs/Swift/Navigation/MegaMenu/GroupImage.cshtml"
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.GetGroupAssets(MediaViewModelSettings settings, Group group)
       at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateProductGroup(ProductGroupViewModelSettings settings, ViewModelPropertyFiller`1 filler, Group group)
       at Dynamicweb.Ecommerce.ProductCatalog.NavigationTreeViewNodeExtensions.GetProductGroup(NavigationTreeNodeViewModel node)
       at CompiledRazorTemplates.Dynamic.RazorEngine_a744af72fc8b45c0810424b9b382813f.ExecuteAsync()
       at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
       at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
       at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
       at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
       at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
       at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
       at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
       at RazorEngine.Templating.RazorEngineServiceExtensions.Run(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()
    
    1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.Navigation.NavigationTreeNodeViewModel> 2 @using Dynamicweb 3 @using System.IO 4 @using Dynamicweb.Ecommerce.ProductCatalog 5 @using Dynamicweb.Ecommerce.Common 6 7 @functions { 8 public string GetImagePathSanitized(string imagePath) 9 { 10 if (!imagePath.StartsWith("/Files", StringComparison.OrdinalIgnoreCase)) 11 { 12 if (!imagePath.StartsWith("Files/", StringComparison.OrdinalIgnoreCase)) 13 { 14 imagePath = $"/Files/Images/{imagePath}"; 15 } 16 } 17 return imagePath; 18 } 19 } 20 21 @{ 22 23 var group = Model.GetProductGroup(); 24 IList<FieldValueViewModel> groupFields = group.GroupFields; 25 26 if (groupFields != null) 27 { 28 foreach (FieldValueViewModel field in groupFields) 29 { 30 if (field.SystemName == "ProductGroupNavigationImage") 31 { 32 if (!string.IsNullOrEmpty(field.Value.ToString())) 33 { 34 string productGroupImageShape = GetViewParameterString("ProductGroupImageShape"); 35 string productGroupImageSize = GetViewParameterString("ProductGroupImageSize"); 36 string ratio = GetViewParameterString("Ratio"); 37 string ratioCssClass = ratio != string.Empty ? "ratio" : string.Empty; 38 string ratioVariable = ratio != "" ? "--bs-aspect-ratio: " + ratio : string.Empty; 39 var groupImage = GetImagePathSanitized(field.Value.ToString()); 40 var groupName = group.Name; 41 42 if (Path.GetExtension(groupImage).ToLower() == ".svg") 43 { 44 if (!string.IsNullOrEmpty(ratio)) 45 { 46 <div class="@(ratioCssClass)" style="@ratioVariable"> 47 @ReadFile(groupImage) 48 </div> 49 } 50 else 51 { 52 <div class="icon-auto" style="height: @(productGroupImageSize)px; width: @(productGroupImageSize)px;"> 53 @ReadFile(groupImage) 54 </div> 55 } 56 57 } 58 else 59 { 60 if (!string.IsNullOrEmpty(ratio)) 61 { 62 var imagePath = Dynamicweb.Context.Current.Server.UrlEncode(groupImage); 63 var imageSrc = $"/Admin/Public/GetImage.ashx?Image={imagePath}&Width=320"; 64 65 <figure class="@(ratioCssClass) m-0" style="@ratioVariable"> 66 <img loading="lazy" class="@productGroupImageShape" alt="@groupName" src="@imageSrc" style="object-fit: contain"> 67 </figure> 68 69 } 70 else 71 { 72 var imagePath = Dynamicweb.Context.Current.Server.UrlEncode(groupImage); 73 var imageSrc = $"/Admin/Public/GetImage.ashx?Image={imagePath}&Width={productGroupImageSize}&Height={productGroupImageSize}&crop=0"; 74 75 <img loading="lazy" class="@productGroupImageShape" alt="@groupName" width="@productGroupImageSize" height="@productGroupImageSize" src="@imageSrc"> 76 } 77 } 78 } 79 } 80 } 81 } 82 83 } 84
    Transportband
  • Teknologi
    Flosense
    Slangkonfigurator
    Prodoptim
  • Kundsupport
    Nyheter & händelser
    Policies
    Nedladdningsområde
    FAQ
  1. Produkter
  2. Kringutrustning
Vi hittade inget som matchar ditt sökresultat

Registrera dig för nyhetsbrev

Plamako i Anderstorp AB
Ågatan 13
33432 Anderstorp
Sweden
 

    /Files/Icons/phone.svg
  • +46728433495
  • /Files/Icons/envelope.svg
  • sales@plamako.se

    /Files/Icons/1_none.svg
  • Cookiepolicy
  • /Files/Icons/1_none.svg
  • Integritetspolicy
    • GDPR Unsubscribe
  • /Files/Icons/1_none.svg
  • Allmänna villkor
Copyright © 2025 Plamako i Anderstorp AB. Alla rättigheter reserverade.
Favoritlista uppdaterad