I'm making good progress with developing the ePrivacy Plugin but I need you girls and guys to think along please.
At the moment third party service like Twitter can be inserted into a page via a Twig variable like {{ eprivacy.twitter }} and somewhere in the middle of your page content by using a shortcode like [eprivacy-twitter/] right in your markdown. I'll update the demo to show that soon.
What I'm not sure of is how to add the 62 service definitions tarteaucitron.js currently offers to this plugin?
By service definition I mean the code tarteaucitron.js requires to include a service. These are documented in "Step 3: Add your services" and look like for example:
- for Amazon:
HTML
<div class="amazon_product" amazonid="xxxxx-xx" productid="product_id"></div> - for Google Analytics (gtag.js):
HTML
<script type="text/javascript"> tarteaucitron.user.gtagUa = 'UA-XXXXXXXX-X'; tarteaucitron.user.gtagMore = function () { /* add here your optionnal gtag() */ }; (tarteaucitron.job = tarteaucitron.job || []).push('gtag'); </script>
What would be the best way to include all these definitions into the plugin and make it easy to set the required parameter values such as the values of amazonid and gtagUa in the above examples ?
I'm thinking about storing each definition in a separate file in the user/data folder and creating a single YAML file to hold all parameters. The service name (e.g. google-analytics-gtagjs) is used as the key to link an entry in the YAML file to it's folder by the same name in user/data.
This is just one thought and because Grav puts so few limits on solutions there are many other scenario's to solve this.
Please let me know what you think would be a smart way to add services and make them configurable from within the ePrivacy plugin.
Thank you for your time and thoughts!