Sustainable Solutions
for the Health of the Planet

Welcome to
Greenfield
Global

Greenfield Global produces and delivers the high-purity alcohols, specialty solvents, custom blends, bioprocessing inputs, and low-carbon fuels that keep industries moving.

Built differently from traditional ethanol producers, with multiple high-purity alcohol distilleries, global supply chain infrastructure, and deep expertise in sourcing, testing, blending, packaging, and distribution.

We support customers from early-stage innovators to leading multinational corporations and we deliver over 800 million liters annually to more than 50 countries.

Privately held for 35 over years, we have the freedom focus on long-term customer success. We are a trusted, solutions‑driven provider with the expertise and operational discipline to execute - where and when our customers need us.

We advance solutions that support human health, industrial progress, and the transition to a more sustainable future.

Specialty Chemicals & Ingredients

Beverages & Distilled Spirits

Renewable Energy

Agribusiness

Why Work With Us

Uncompromising quality. Every batch, every time.

Uncompromising quality. Every batch, every time.

  • Facilities that are certified to ISO 9001/14001/45001, EXCiPACT, USP/EP/JP/ACS/FCC, FSSC 22000, and GMP
  • Products available that are certified Organic, Kosher and Non-GMO Project Verified, and meet USP/EP/JP/ACS/FCC standards
  • White rooms, cleanrooms, and purified water systems plus dedicated equipment
  • End-to-end testing and traceability with in-house testing for faster turnaround times and no third-party management
  • Advanced analytics capabilities and equipment to minimize operational quality risk
  • Reliability validated through thousands of successful customer and regulatory audits

What you need, when and where you need it

What you need, when and where you need it

  • Five distilleries, four manufacturing and packaging facilities, and nine bulk distribution locations
  • Global supply chain network serving 50+ countries with consistently reliable delivery, powered by 60 logistics partners worldwide
  • Flexible packaging that scales with you - from liters to rail cars

Decades of partnership, not short term priorities

Decades of partnership, not short term priorities

  • Deep expertise in complex, highly regulated materials and regulatory compliance
  • 96% global customer retention—customers stay because we deliver
  • World class customer Net Promoter Score of 83
  • As a privately held company, we invest in your success for decades, not quarters

Error executing template "/Designs/Swift/Grid/Page/RowTemplates/2Columns.cshtml"
System.InvalidOperationException: A prior operation on this collection was interrupted by an exception. Collection's state is no longer trusted.
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.Container.VerifyIntegrity()
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.Container.CreateEntryNoResize(TKey key, TValue value)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.Add(TKey key, TValue value)
   at Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax.MarkupTextLiteralSyntax.SetAnnotations(SyntaxAnnotation[] annotations)
   at Microsoft.AspNetCore.Razor.Language.Legacy.TokenizerBackedParser`1.GetNodeWithSpanContext[TNode](TNode node)
   at Microsoft.AspNetCore.Razor.Language.Legacy.HtmlMarkupParser.ParseRazorCommentWithLeadingAndTrailingWhitespace(SyntaxListBuilder`1& builder)
   at Microsoft.AspNetCore.Razor.Language.Legacy.HtmlMarkupParser.ParseDocument()
   at Microsoft.AspNetCore.Razor.Language.Legacy.RazorParser.Parse(RazorSourceDocument source)
   at Microsoft.AspNetCore.Razor.Language.DefaultRazorParsingPhase.ExecuteCore(RazorCodeDocument codeDocument)
   at Microsoft.AspNetCore.Razor.Language.DefaultRazorEngine.Process(RazorCodeDocument document)
   at Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine.GenerateCode(RazorCodeDocument codeDocument)
   at RazorEngine.Compilation.CompilerServiceBase.GenerateCodeFile(RazorTemplateEngine templateEngine, RazorCodeDocument document)
   at RazorEngine.Compilation.CompilerServiceBase.GetGeneratorResult(IEnumerable`1 namespaces, TypeContext context)
   at RazorEngine.Compilation.CompilerServiceBase.GetCodeCompileUnit(TypeContext context)
   at Dynamicweb.Rendering.Compatibility.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.RunCompile(IRazorEngineService service, String name, 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 RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String templateSource, 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 @*THERE ARE CUSTOM CHANGES IN THIS TEMPLATE*@ 2 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.GridRowViewModel> 3 4 @{ 5 string sectionClass = "py-3"; 6 string spaceBetweenRows = Model.Item.GetRawValueString("SpaceBetweenRows", "spacing"); 7 string spaceBetweenRowsMobile = Model.Item.GetRawValueString("SpaceBetweenRowsMobile", "auto"); 8 9 @*Custom START*@ 10 int splitBg = Model.Item.GetInt32("SplitBackground"); 11 @*Custom END*@ 12 13 //Row spacing mobile auto 14 if (spaceBetweenRowsMobile == "auto") 15 { 16 spaceBetweenRowsMobile = spaceBetweenRows; 17 } 18 19 //Row spacing mobile 20 switch (spaceBetweenRowsMobile) 21 { 22 case "none": //No spacing 23 sectionClass = "py-0"; 24 break; 25 case "spacing": //Small spacing top and bottom 26 sectionClass = "py-3"; 27 break; 28 case "spacing-small-top": //Small spacing top 29 sectionClass = "pt-3"; 30 break; 31 case "spacing-small-bottom": //Small spacing bottom 32 sectionClass = "pb-3"; 33 break; 34 case "spacing-medium": //Medium spacing top and bottom 35 sectionClass = "py-4"; 36 break; 37 case "spacing-medium-top": //Medium spacing top 38 sectionClass = "pt-4"; 39 break; 40 case "spacing-medium-bottom": //Medium spacing bottom 41 sectionClass = "pb-4"; 42 break; 43 case "spacing-large": //Large spacing top and bottom 44 sectionClass = "py-5"; 45 break; 46 case "spacing-top": //Large spacing top 47 sectionClass = "pt-5"; 48 break; 49 case "spacing-bottom": //Large spacing bottom 50 sectionClass = "pb-5"; 51 break; 52 } 53 54 //Row spacing dekstop 55 switch (spaceBetweenRows) 56 { 57 case "none": //No spacing 58 sectionClass += " py-lg-0"; 59 break; 60 case "spacing": //Small spacing top and bottom 61 sectionClass += " py-lg-3"; 62 break; 63 case "spacing-small-top": //Small spacing top 64 sectionClass += " pt-lg-3 pb-lg-0"; 65 break; 66 case "spacing-small-bottom": //Small spacing bottom 67 sectionClass += " pb-lg-3 pt-lg-0"; 68 break; 69 case "spacing-medium": //Medium spacing top and bottom 70 sectionClass += " py-lg-5"; 71 break; 72 case "spacing-medium-top": //Medium spacing top 73 sectionClass += " pt-lg-5 pb-lg-0"; 74 break; 75 case "spacing-medium-bottom": //Medium spacing bottom 76 sectionClass += " pb-lg-5 pt-lg-0"; 77 break; 78 case "spacing-large": //Large spacing top and bottom 79 sectionClass += " py-lg-6"; 80 break; 81 case "spacing-top": //Large spacing top 82 sectionClass += " pt-lg-6 pb-lg-0"; 83 break; 84 case "spacing-bottom": //Large spacing bottom 85 sectionClass += " pb-lg-6 pt-lg-0"; 86 break; 87 } 88 89 string containerClass = "container-xl"; 90 string width = Model.Item.GetRawValueString("Width", "container-xl"); 91 if (width == "none") 92 { 93 containerClass = "container-fluid px-0"; 94 } 95 if (width == "stretch") 96 { 97 containerClass = "container-fluid"; 98 } 99 if (width == "compressed") 100 { 101 containerClass = " container-compressed"; 102 } 103 104 /*Custom START*/ 105 if (width == "article") 106 { 107 containerClass = "custom-container"; 108 } 109 /*Custom END*/ 110 111 string rowClass = string.Empty; 112 string spaceBetweenColumns = Model.Item.GetRawValueString("SpaceBetweenColumns", string.Empty).ToLower(); 113 string spaceBetweenColumnsMobile = Model.Item.GetRawValueString("SpaceBetweenColumnsMobile", string.Empty).ToLower(); 114 //Mobile 115 if (spaceBetweenColumnsMobile == "auto") 116 { 117 spaceBetweenColumnsMobile = spaceBetweenColumns; 118 } 119 if (spaceBetweenColumnsMobile == "stick") 120 { 121 rowClass = " gap-0"; 122 } 123 if (spaceBetweenColumnsMobile == "spacing-medium") 124 { 125 rowClass = " gap-4"; 126 } 127 if (spaceBetweenColumnsMobile == "spacing-large") 128 { 129 rowClass = " gap-5"; 130 } 131 //Desktop 132 if (spaceBetweenColumns == "stick") 133 { 134 rowClass += " gap-lg-0"; 135 } 136 if (spaceBetweenColumns == "spacing-medium") 137 { 138 rowClass += " gap-lg-4"; 139 } 140 if (spaceBetweenColumns == "spacing-large") 141 { 142 rowClass += " gap-lg-5"; 143 } 144 145 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 146 147 string animationOnScrollCol1 = Model.Item.GetRawValueString("AnimationOnScrollCol1", "no-animation"); 148 animationOnScrollCol1 = animationOnScrollCol1 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol1 + "'" : ""; 149 string animationOnScrollCol2 = Model.Item.GetRawValueString("AnimationOnScrollCol2", "no-animation"); 150 animationOnScrollCol2 = animationOnScrollCol2 != "no-animation" ? "data-aos=" + "'" + animationOnScrollCol2 + "'" : ""; 151 152 string hideOverflow = " overflow-hidden"; 153 hideOverflow = 154 animationOnScrollCol1 != "" || 155 animationOnScrollCol2 != "" 156 ? hideOverflow : ""; 157 158 Dynamicweb.Frontend.FileViewModel backgroundImage = Model.Item.GetFile("BackgroundImage"); 159 string backgroundImagePath = backgroundImage?.Path ?? string.Empty; 160 backgroundImagePath = !string.IsNullOrEmpty(backgroundImagePath) ? $"/Admin/Public/GetImage.ashx?image={backgroundImagePath}&width=2600&format=webp&compression=75" : string.Empty; 161 backgroundImagePath = Dynamicweb.Core.Encoders.HtmlEncoder.UrlPathEncode(backgroundImagePath); 162 string backgroundRepeat = Model.Item.GetRawValueString("BackgroundImageRepeat", "no-repeat"); 163 string backgroundImageSize = Model.Item.GetRawValueString("BackgroundImageSize", "initial"); 164 int xPos = backgroundImage?.FocalPositionFromLeft ?? 50; 165 int yPos = backgroundImage?.FocalPositionFromTop ?? 50; 166 string cssPosition = $"{xPos}% {yPos}%"; 167 string gradient = Model.Item.GetRawValueString("Gradient", string.Empty); 168 string gradientOpacity = Model.Item.GetRawValueString("GradientOpacity", "0.00"); 169 string gradientString = "linear-gradient(" + gradient + "deg," + "rgba(var(--swift-foreground-color-rgb)," + gradientOpacity + "), rgba(var(--swift-background-color-rgb)," + gradientOpacity + "))"; 170 string backgroundImageString = "url(" + backgroundImagePath + ")"; 171 string backgroundImagePositionString = "background-position:" + cssPosition + ";"; 172 string backgroundRepeatString = "background-repeat:" + backgroundRepeat + ";"; 173 string backgroundImageSizeString = "background-size:" + backgroundImageSize + ";"; 174 string styleString = string.Empty; 175 176 var decorations = Model.Item?.GetList("CssDecorations")?.GetRawValue().OfType<string>() ?? Enumerable.Empty<string>(); 177 var css = string.Empty; 178 var cssClasses = new List<string> { }; 179 180 foreach (var itemId in decorations) 181 { 182 var item = Dynamicweb.Content.Services.Items.GetItem("Swift_Css", itemId); 183 item.TryGetValue("Class", out object classes); 184 if (classes is null) 185 { 186 continue; 187 } 188 189 var cssString = (string)classes; 190 if (cssString.StartsWith("[")) 191 { 192 var cssArray = Dynamicweb.Core.Converter.Deserialize<string[]>(cssString); 193 cssClasses.AddRange(cssArray); 194 } 195 else 196 { 197 cssClasses.Add(cssString.Replace(",", " ")); 198 } 199 } 200 css = string.Join(" ", cssClasses).Trim(); 201 202 @* Only gradient *@ 203 204 if (!string.IsNullOrEmpty(gradient) && string.IsNullOrEmpty(backgroundImagePath) && gradientOpacity != ("0.00")) 205 { 206 styleString += "style=\"background-image:" + gradientString + ";\""; 207 } 208 209 @* Only background image *@ 210 211 else if (string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 212 { 213 styleString += "style=\"background-image:" + backgroundImageString + "; " + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 214 } 215 216 @* Gradient and background image *@ 217 218 else if (!string.IsNullOrEmpty(gradient) && !string.IsNullOrEmpty(backgroundImagePath)) 219 { 220 styleString += "style=\"background-image:" + gradientString + "," + backgroundImageString + ";" + backgroundImagePositionString + backgroundRepeatString + backgroundImageSizeString + "\""; 221 } 222 223 @*Custom START*@ 224 if (splitBg > 0 && splitBg <= 100) 225 { 226 styleString = "style=\"--split-bg-pct:" + splitBg + "%\""; 227 } 228 229 @*Custom END*@ 230 231 int mobileColumnSize = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileColumnBehaviour", "1")); 232 int mobileOrderFirst = Dynamicweb.Core.Converter.ToInt32(Model.Item.GetRawValueString("MobileOrderFirst", "1")); 233 234 if (Pageview.IsVisualEditorMode || !string.IsNullOrWhiteSpace(Model.Column(1).Output()) || !string.IsNullOrWhiteSpace(Model.Column(2).Output())) 235 { 236 <div class="@(sectionClass)@(theme) @(css) @(splitBg > 0 ? "split-bg" : string.Empty) item_@Model.Item.SystemName.ToLower()" @styleString data-swift-gridrow> 237 <div class="@containerClass@(hideOverflow)"> 238 <div class="grid grid-@(mobileColumnSize) grid-lg-@Model.Columns.Count()@(rowClass)"> 239 <div class="g-col @(Model.Column(1).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="6" @animationOnScrollCol1 style="--bs-columns:12"> 240 @Model.Column(1).Output() 241 </div> 242 <div class="g-col @(Model.Column(2).ColumnNumber == mobileOrderFirst ? "order-first order-lg-0" : string.Empty)" data-col-size="6" @animationOnScrollCol2 style="--bs-columns:12"> 243 @Model.Column(2).Output() 244 </div> 245 </div> 246 </div> 247 </div> 248 } 249 } 250

30+ years

of global leadership as an ethanol producer, manufacturer and distributor

5

industrial, beverage and fuel alcohol distilleries in Canada and the United States.

63M Gallons

(239M liters)
of high-purity alcohol produced annually


35,000+

orders shipped per year

96%

customer retention

Near Zero Energy

Built one of the first Near Zero Energy building in Ireland

Leading Sustainability Innovator

in next-generation biofuels such as aviation fuel, hydrogen and methanol for marine.

Error executing template "CookieWarning/Cookies.cshtml"
System.InvalidOperationException: A prior operation on this collection was interrupted by an exception. Collection's state is no longer trusted.
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.Container.VerifyIntegrity()
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.Container.CreateEntryNoResize(TKey key, TValue value)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.Add(TKey key, TValue value)
   at Microsoft.AspNetCore.Razor.Language.Legacy.HtmlMarkupParser.OtherParserBlock(SyntaxListBuilder`1& builder)
   at Microsoft.AspNetCore.Razor.Language.Legacy.HtmlMarkupParser.ParseCodeTransition(SyntaxListBuilder`1& builder)
   at Microsoft.AspNetCore.Razor.Language.Legacy.HtmlMarkupParser.ParseDocument()
   at Microsoft.AspNetCore.Razor.Language.Legacy.RazorParser.Parse(RazorSourceDocument source)
   at Microsoft.AspNetCore.Razor.Language.DefaultRazorParsingPhase.ExecuteCore(RazorCodeDocument codeDocument)
   at Microsoft.AspNetCore.Razor.Language.DefaultRazorEngine.Process(RazorCodeDocument document)
   at Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine.GenerateCode(RazorCodeDocument codeDocument)
   at RazorEngine.Compilation.CompilerServiceBase.GenerateCodeFile(RazorTemplateEngine templateEngine, RazorCodeDocument document)
   at RazorEngine.Compilation.CompilerServiceBase.GetGeneratorResult(IEnumerable`1 namespaces, TypeContext context)
   at RazorEngine.Compilation.CompilerServiceBase.GetCodeCompileUnit(TypeContext context)
   at Dynamicweb.Rendering.Compatibility.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.RunCompile(IRazorEngineService service, String name, 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 RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String templateSource, 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.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Dynamicweb.Environment; 3 4 @{ 5 var categories = CookieManager.GetCategories(); 6 7 string cookieNoticeLink = Pageview.AreaSettings.GetLink("CookiePolicyLink") != null ? Pageview.AreaSettings.GetLink("CookiePolicyLink").Url : ""; 8 string privacyPolicyLink = Pageview.AreaSettings.GetLink("PrivacyPolicyLink") != null ? Pageview.AreaSettings.GetLink("PrivacyPolicyLink").Url : ""; 9 int cookieNoticePageID = Pageview.AreaSettings.GetLink("CookiePolicyLink") != null ? Pageview.AreaSettings.GetLink("CookiePolicyLink").PageId : 0; 10 int privacyPolicyPageID = Pageview.AreaSettings.GetLink("PrivacyPolicyLink") != null ? Pageview.AreaSettings.GetLink("PrivacyPolicyLink").PageId : 0; 11 string googleTagManagerID = Pageview.AreaSettings.GetString("GoogleTagManagerID"); 12 13 string layout = Pageview.AreaSettings.GetRawValueString("CookieLayout", "modal"); 14 15 layout = Pageview.Page.ID == cookieNoticePageID || Pageview.Page.ID == privacyPolicyPageID ? "both" : layout; 16 } 17 18 @if (!Pageview.IsVisualEditorMode) { 19 if (layout == "banner" || layout == "both") 20 { 21 string bannerTheme = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetRawValueString("CookieBannerTheme")) ? " theme " + Pageview.AreaSettings.GetRawValueString("CookieBannerTheme").Replace(" ", "").Trim().ToLower() : "theme light"; 22 23 <div class="position-fixed bottom-0 w-100 shadow @bannerTheme" id="dwCookieBanner"> 24 <div class="align-items-center grid p-3"> 25 @if (layout == "banner") 26 { 27 <div class="g-col-12 g-col-md-6 g-col-lg-8"> 28 <span>@Translate("By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Statistics and Marketing")</span> 29 </div> 30 <div class="g-col-12 g-col-md-6 g-col-lg-4"> 31 <div class="grid grid-1 grid-sm-2"> 32 <button type="button" onclick="setOptInCookie(2)" class="btn btn-primary" id="CookiesAcceptAll"> 33 @Translate("Accept all") 34 </button> 35 <button type="button" onclick="setOptInCookie(1)" class="btn btn-secondary" id="CookiesDeclineAll"> 36 @Translate("Decline") 37 </button> 38 </div> 39 </div> 40 } 41 @if (layout == "both") 42 { 43 <div class="g-col-12 g-col-lg-6 g-col-xxl-8"> 44 <span>@Translate("By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Statistics and Marketing")</span> 45 </div> 46 <div class="g-col-12 g-col-lg-6 g-col-xxl-4"> 47 <div class="grid grid-1 grid-sm-3"> 48 <button type="button" class="btn btn-link" data-bs-toggle="modal" data-bs-target="#dwCookieModal"> 49 @Translate("Customize settings") 50 </button> 51 <button type="button" onclick="setOptInCookie(2)" class="btn btn-secondary" id="CookiesAcceptAll"> 52 @Translate("Accept all") 53 </button> 54 <button type="button" onclick="setOptInCookie(1)" class="btn btn-secondary" id="CookiesDeclineAll"> 55 @Translate("Decline") 56 </button> 57 </div> 58 </div> 59 } 60 </div> 61 </div> 62 } 63 64 if (layout == "modal" || layout == "both") 65 { 66 string modalTheme = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetRawValueString("CookieModalTheme")) ? " theme " + Pageview.AreaSettings.GetRawValueString("CookieModalTheme").Replace(" ", "").Trim().ToLower() : "theme light"; 67 68 <div class="modal fade" id="dwCookieModal"> 69 <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" style="max-width:560px;"> 70 <div class="modal-content @modalTheme"> 71 <div style="overflow-y:auto;overflow-x:hidden"> 72 <div class="p-3 p-md-4 overflow-auto" style="max-height:50vh;"> 73 <div class="h3 mb-3">@Translate("You control your data")</div> 74 <p>@Translate("We and our partners use technologies, including cookies, to collect information about you for various purposes, including"):</p> 75 <ol> 76 <li>@Translate("Functionality")</li> 77 <li>@Translate("Statistics")</li> 78 <li>@Translate("Marketing")</li> 79 </ol> 80 <p>@Translate("By clicking 'Accept All' you consent to all these purposes. You can also choose to indicate what purposes you will consent to using the custom selections and then click 'Accept selected'").</p> 81 82 @if (!string.IsNullOrEmpty(cookieNoticeLink) || !string.IsNullOrEmpty(privacyPolicyLink)) 83 { 84 <p>@Translate("You can read more about our use of cookies and other technologies, as well as our collection and processing of personal data by clicking here"):</p> 85 } 86 87 @if (!string.IsNullOrEmpty(cookieNoticeLink)) 88 { 89 <a href="@cookieNoticeLink" class="d-block mb-3" id="CookiesReadModeAbout">@Translate("Read more about Cookies")</a> 90 } 91 @if (!string.IsNullOrEmpty(privacyPolicyLink)) 92 { 93 <a href="@privacyPolicyLink" class="d-block" id="CookiesPrivacyPolicy">@Translate("Our privacy policy")</a> 94 } 95 </div> 96 97 <div class="p-3 px-md-4 border-top"> 98 <div class="grid grid-1 grid-sm-2 gap-3"> 99 <button type="button" onclick="setOptInCookie(1)" class="btn btn-secondary" data-bs-dismiss="modal" id="dwCookieDeclineAll">@Translate("Decline")</button> 100 @if (categories.Any()) 101 { 102 <button type="button" onclick="acceptCustomSetup()" class="btn btn-secondary d-none" data-bs-dismiss="modal" id="dwCookieAcceptSelected">@Translate("Accept selected")</button> 103 } 104 <button type="button" onclick="setOptInCookie(2)" class="btn btn-secondary" data-bs-dismiss="modal" id="dwCookieAcceptAll">@Translate("Accept All")</button> 105 </div> 106 </div> 107 108 @if (categories.Any()) 109 { 110 int categoriesCount = 0; 111 int totalCategories = categories.Count(); 112 113 <form id="dwCookieModalCustomForm" method="post" action="/Admin/Public/CookieOptInLevelConfig.aspx"> 114 <input type="hidden" name="cmd" value="SetCookieOptInLevel"> 115 <input type="hidden" name="OptInLevel" id="OptInLevel" value="1"> 116 <div class="grid grid-2 grid-sm-4 gap-0 px-md-3 border-top border-1"> 117 <div class="p-3"> 118 <label class="form-check-label" for="dwCookieNecessary"><span>@Translate("Necessary")</span></label> 119 <div class="form-check form-switch form-control-lg py-0"> 120 <input class="form-check-input opacity-100" type="checkbox" id="dwCookieNecessary" checked disabled style="background-color: rgba(0,0,0,0.1);"> 121 </div> 122 </div> 123 @foreach (var category in categories) 124 { 125 string border = categoriesCount < (totalCategories - 1) ? "" : ""; 126 127 <div class="p-3 @(border)"> 128 <label class="form-check-label" for="CookieCategory_@category"><span>@Translate(category)</span></label> 129 <div class="form-check form-switch form-control-lg py-0"> 130 <input class="form-check-input js-checkbox" type="checkbox" name="OptInCategory" value="@category" id="CookieCategory_@category" onchange="toggleAcceptSelected()" style="background-color: rgba(0,0,0,0.1);"> 131 </div> 132 </div> 133 categoriesCount++; 134 } 135 </div> 136 </form> 137 } 138 </div> 139 </div> 140 </div> 141 </div> 142 } 143 144 145 <script> 146 async function setOptInCookie(optInLevel) { 147 let response = await fetch("/admin/public/CookieOptInLevelConfig.aspx?cmd=SetCookieOptInLevel&OptInLevel=" + optInLevel); 148 @if (!string.IsNullOrWhiteSpace(googleTagManagerID)){ 149 <text> 150 if (optInLevel == '2') { 151 consentGrantedAll(); 152 } 153 </text> 154 } 155 156 if (response.ok) { 157 if (document.querySelector("#dwCookieBanner")) { 158 document.querySelector("#dwCookieBanner").classList.add("d-none"); 159 } 160 document.location.reload(); 161 return false; 162 } else { 163 return false; 164 } 165 } 166 167 async function acceptCustomSetup() { 168 var form = document.querySelector("#dwCookieModalCustomForm"); 169 170 let formData = new FormData(form); 171 var fetchOptions = { 172 method: 'POST', 173 body: formData 174 }; 175 176 for (const value of formData.values()) { 177 console.log(value); 178 if (value == 'Marketing') { 179 console.log('Granting marketing cookies') 180 consentGrantedMarketing(); 181 } 182 if (value == 'Statistical') { 183 console.log('Granting statistical cookies') 184 consentGrantedAnalyticsStorage(); 185 } 186 } 187 188 189 let response = await fetch(form.action, fetchOptions); 190 191 if (response.ok) { 192 if (document.querySelector("#dwCookieBanner")) { 193 document.querySelector("#dwCookieBanner").classList.add("d-none"); 194 } 195 document.location.reload(); 196 return false; 197 } else { 198 return false; 199 } 200 } 201 202 203 function consentGrantedAll() { 204 consentGrantedMarketing(); 205 consentGrantedAnalyticsStorage(); 206 } 207 208 function consentGrantedMarketing() { 209 consentGrantedAdStorage(); 210 consentGrantedAdUserData(); 211 consentGrantedAdPersonalization(); 212 } 213 214 function consentGrantedAdStorage() { 215 if (!window.dataLayer) return; 216 gtag('consent', 'update', { 217 'ad_storage': 'granted' 218 }); 219 } 220 221 function consentGrantedAdUserData() { 222 if (!window.dataLayer) return; 223 gtag('consent', 'update', { 224 'ad_user_data': 'granted' 225 }); 226 } 227 228 function consentGrantedAdPersonalization() { 229 if (!window.dataLayer) return; 230 gtag('consent', 'update', { 231 'ad_personalization': 'granted' 232 }); 233 } 234 235 function consentGrantedAnalyticsStorage() { 236 if (!window.dataLayer) return; 237 gtag('consent', 'update', { 238 'analytics_storage': 'granted' 239 }); 240 } 241 242 function toggleAcceptSelected() { 243 var cookieCalegoriesElement = document.querySelector("#dwCookieModalCustomForm"); 244 var enableAcceptSelected = false; 245 246 cookieCalegoriesElement.querySelectorAll(".js-checkbox").forEach(function (field) { 247 if (field.checked == true) { 248 enableAcceptSelected = true; 249 } 250 }); 251 252 if (enableAcceptSelected) { 253 document.querySelector("#dwCookieDeclineAll").classList.add("d-none"); 254 document.querySelector("#dwCookieAcceptSelected").classList.remove("d-none"); 255 } else { 256 document.querySelector("#dwCookieDeclineAll").classList.remove("d-none"); 257 document.querySelector("#dwCookieAcceptSelected").classList.add("d-none"); 258 } 259 } 260 261 function showCookieModal() { 262 var cookieModal = new bootstrap.Modal(document.querySelector('#dwCookieModal'), { 263 backdrop: 'static' 264 }); 265 cookieModal.show(); 266 } 267 </script> 268 269 if (layout == "modal") 270 { 271 <script type="module"> 272 showCookieModal(); 273 </script> 274 } 275 } 276