Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/10/2024 in all areas

  1. Here's a small module I wrote a few years ago and was asked to share in the module repo. TextformatterImgDataUri This Textformatter checks all images in the field's markup for images under a certain size and converts those from links to data URLs, i.e. it embeds the image data itself. This can be handy when you cache whole pages and want to cut down on the number of requests. Original post with the module code:
    3 points
  2. <script> function gtag() { dataLayer.push(arguments); } gtag('consent', 'default', { 'ad_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied', 'analytics_storage': 'denied' }); </script> <script type="text/plain" data-type="text/javascript" data-category="statistics"> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('consent', 'update', { 'analytics_storage': 'granted' }); </script> <script type="text/plain" data-type="text/javascript" data-category="statistics"> // GTM </script> I use GTM only for Statistics, this is how it work for me.
    2 points
  3. Published to GitHub and pending approval in the module directory.
    1 point
  4. OK. Thanks for notice. I will try to find some logs. I wanted to just try your module. I will use Form Builder from Ryan, but your module also appears interesting.
    1 point
  5. Same question here ? As far as I understand the docs https://developers.google.com/tag-platform/security/guides/consent?hl=de&consentmode=advanced it's necessary to set & update the "consent status" Here's a snippet as google recommends on its website. <script> // Define dataLayer and the gtag function. window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} // Set default consent to 'denied' as a placeholder // Determine actual values based on your own requirements gtag('consent', 'default', { 'ad_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied', 'analytics_storage': 'denied' }); </script> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID "> </script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'TAG_ID'); </script> <!-- Create one update function for each consent parameter --> <script> function consentGrantedAdStorage() { gtag('consent', 'update', { 'ad_storage': 'granted' }); } </script> <!-- Invoke your consent functions when a user interacts with your banner --> <body> ... <button onclick="consentGrantedAdStorage">Yes</button> ... </body> I'm thinking about using PrivacyWire for triggering a custom js function: Passing the necessary gtag parameters to google after the user had interacted with the Consent Banner. @joshua Is it possible to define multiple data-categories at the same time – e.g.: <script type="text/plain" data-type="text/javascript" data-category="statistics|marketing|external_media"> // Load GTM </script>
    1 point
  6. If there is a ruby one there should also be a python one ?: https://wagtail.org/ If ProcessWire didn't exist I probably would have already tried it. (I would also probably have tried a ruby one.)
    1 point
  7. RockPageBuilder has the concept of "Widgets". You can turn every "Block" (similar to a repeater matrix element) into a widget with one click. Then on any other page you can add a widget block and select the original item to be displayed. This is handy for situations where you want to reuse content elements across your site, but want to manage the content at one central place. An example could be a "contact us" element or a "donate now" element where you'd maybe want to display that element on hundreds of pages but want to change the phone number or bank account only once. A RockPageBuilder block can be text but also just an image field. So having an image block, uploading an image and then turning it into a widget would make the use case that you describe possible. As always this comes with a downside. It would then not be possible to show different versions of that block. All would be 100% identical. You could build the same concept on your own with RepeaterMatrix as well. After all it's just a page reference field and an some additional logic to not render the reference directly but render the referenced source. Actually that can get quite tricky, but that's another story ? So as always in ProcessWire it's up to you how you do what you need and it depends on the exact use case what is the best solution. There is no one-size-fits-all solution for what you describe and I think as @wbmnfktr mentioned uploading images multiple times might be the most native solution and is often really not bad and comes with other benefits.
    1 point
  8. "if ($article->gallery_images)" just works if the field is set to one image only. You have to use "if (count($article->gallery_images))" if you want to check whether one or more images are available. https://processwire.com/docs/fields/images/ -> "How to tell if a page has images present"
    1 point
×
×
  • Create New...