Closed PaulCWoods closed 4 years ago
Don't want to totally leave you hanging with this @PaulCWoods - and I've had similar requests previously which was why I added the settings to enable/disable the banner in specific sections.
My argument against introducing a variable to include the snippets, which would seem the most logical approach to fix the issue you are seeing as this could then be added on a per-template basis, is that it's a breaking change for everybody already using the plugin which I'm a bit reluctant to do really. Obviously, this is also a free plugin I maintain around my regular work schedule so I've not had much time to consider what the best approach may be. Perhaps it would be worth adding a setting to toggle whether the banner should be auto-injected or added with a variable, then you have the best of both worlds. I'll look to add that when I get some time.
Thanks @mark-adigital . Yes the toggle approach sounds like a sensible solution. Great little plug in by the way.
No worries - and thank you! I can't take all the credit as it's a port of a Craft 2 plugin which the previous developer couldn't get around to remaking... Though with the greater visibility lent by the plugin store, it has seen quite a few updates and improvements since that initial port over!
Hi @PaulCWoods - apologies for the long delay, but I just today released an update with various new configuration options, including a setting to not auto-inject the banner and instead render it with a variable as described above.
Hi @mark-adigital ! I'll get testing it at the start of next week and update the ticket, but this sounds like a great solution. Thanks again.
Hey @mark-adigital, thanks for the great plugin and the work on the latest update for the auto-inject setting. I've tried switching auto-inject off and using the variable {{ craft.cookieConsentBanner.addBanner() }}
but I get a server error message when I do.
Hi @jordanmoore - Mark is away for a couple of days and will be able to take a look at this for you next week. Hopefully this will be ok.
Hi @jordanmoore , I've just added a new release which should address the error you are seeing. Hope that helps.
@mark-adigital thank you. This is working great now! Marking as closed.
Is it possible to exclude the banner on certain templates? In my case an
amp.html
template. Here it’s causing validation errors since it injects css and js.