Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Setting to use consent manager data attributes #2

Closed
t3easy opened this issue Sep 29, 2023 · 17 comments
Closed

[FEATURE] Setting to use consent manager data attributes #2

t3easy opened this issue Sep 29, 2023 · 17 comments

Comments

@t3easy
Copy link

t3easy commented Sep 29, 2023

Tools like the Klaro! consent manager use data-name and data-src attributes of the iframe tag for "contextual consent".
https://klaro.org/docs/tutorials/contextual_consent
A setting to change the rendering like this would help to use your extension and respect the privacy of website visitors.

@ayacoo
Copy link
Owner

ayacoo commented Sep 30, 2023

@t3easy Thank you for your feature request. I will look into an option for the privateSettings and add an event to be able to change the soundcloud HTML.

However, this will take a while, as I'm still on "holiday".

@t3easy
Copy link
Author

t3easy commented Sep 30, 2023

Thanks for the answer! Maybe I can have a look and send a PR.

@ayacoo
Copy link
Owner

ayacoo commented Sep 30, 2023

Gladly! Any support is welcome :-) Do you want to bring the whole thing towards v11 or is v12 enough for you?

Output

I would adapt this part: https://github.com/ayacoo/ayacoo-soundcloud/blob/main/Classes/Rendering/SoundcloudRenderer.php#L52

Otherwise I would continue to save the actual HTML from Soundcloud away in the original.

Note the following: The backend also uses the soundcloud HTML in info mode. A corresponding condition would be good to ensure that the BE remains in the original.

Settings

For me, it's always a question of where the settings are best placed. If clients are to be handled differently, the SiteConfig or TypoScript would be better. My personal favourite is usually TypoScript, because you can overwrite the settings if necessary. What do you think?

I will create a separate issue/branch for the event later.

@ayacoo
Copy link
Owner

ayacoo commented Oct 29, 2023

@t3easy I have created a pull request for you: #5

The PSR-14 event is already there for me, and that went well. For the privacy thing, I added a setting at TypoScript level. See if that's something for you. If everything is fine, I'll create a release 2.1.

Btw: Everything implemented and tested with v12

@hilburger
Copy link

hilburger commented Nov 7, 2023

Hi guys!
This is just what I needed for a friend's synth accesories website where I have started using Klaro implemented via the extension erhaweb/klaro-consent-manager by the very nice Eric Harrer! 🎉

I got stuck at the example in the readme file.

In the services.yaml I have added the lines to my existing settings:

services:
  TntDigital\TntSitepackageBs5\EventListener\ModifyFlexformEvent:
    tags:
      - name: event.listener
        identifier: 'news-flexParsing'
        event: TYPO3\CMS\Core\Configuration\Event\AfterFlexFormDataStructureParsedEvent

  TntDigital\TntSitepackageBs5\EventListener\SoundcloudOutputEventListener:
    tags:
      - name: event.listener
        identifier: 'soundcloud/output'
        event: Ayacoo\AyacooSoundcloud\Event\ModifySoundcloudOutputEvent

Then I have created the /packages/tnt_sitepackage_bs5/Classes/EventListener/SoundcloudOutputEventListener.php and added these lines:

<?php

namespace TntDigital\TntSitepackageBs5\EventListener;
use Ayacoo\AyacooSoundcloud\Event\ModifySoundcloudOutputEvent;

class SoundcloudOutputEventListener
{
    public function __invoke(ModifySoundcloudOutputEvent $event): void
    {
        $output = $event->getOutput();
        $output = str_replace('src', 'data-src', $output);
        $event->setOutput($output);
    }
}

Although I have cleared the caches via Maintenance the Soundcloud player(s) still are rendered with src- instead of data-src attribute.

Am I overlooking something or do I have to wait for the 2.1 release?

Thank you and great work!!

@ayacoo
Copy link
Owner

ayacoo commented Nov 7, 2023

@hilburger Thank you for your feedback! Actually, 2.1 is not out yet, as I wanted to get feedback first to see if it works for you. It works for me, but the more people who test it, the better.

You can theoretically use dev-main for the event: https://packagist.org/packages/ayacoo/ayacoo-soundcloud#dev-main

I don't know how fit you are with composer, versions & Co, but have a look to see if you can use this branch:
https://github.com/ayacoo/ayacoo-soundcloud/tree/3/privacy-setting

Here you can use the data attribute via Typoscript Settings. Please let me know if this helps you. We'll get it working.

@hilburger
Copy link

@hilburger Thank you for your feedback! Actually, 2.1 is not out yet, as I wanted to get feedback first to see if it works for you. It works for me, but the more people who test it, the better.

You can theoretically use dev-main for the event: https://packagist.org/packages/ayacoo/ayacoo-soundcloud#dev-main

I don't know how fit you are with composer, versions & Co, but have a look to see if you can use this branch: https://github.com/ayacoo/ayacoo-soundcloud/tree/3/privacy-setting

Here you can use the data attribute via Typoscript Settings. Please let me know if this helps you. We'll get it working.

I'm on it!

@hilburger
Copy link

@hilburger Thank you for your feedback! Actually, 2.1 is not out yet, as I wanted to get feedback first to see if it works for you. It works for me, but the more people who test it, the better.

You can theoretically use dev-main for the event: https://packagist.org/packages/ayacoo/ayacoo-soundcloud#dev-main

I don't know how fit you are with composer, versions & Co, but have a look to see if you can use this branch: https://github.com/ayacoo/ayacoo-soundcloud/tree/3/privacy-setting

Here you can use the data attribute via Typoscript Settings. Please let me know if this helps you. We'll get it working.

I'm just looking up how to use te branch via Composer instead of a specific version.
Looks like adding the repo like here is the way to go, right?
https://www.strangebuzz.com/en/snippets/using-a-specific-branch-instead-of-a-version-with-composer

@ayacoo
Copy link
Owner

ayacoo commented Nov 7, 2023

@hilburger I have spontaneously released 2.1.0 (without TER) with the PSR-14 event. That might make it a little easier for you to test.

For the data-privacy settings branch:
This information in composer.json should actually be sufficient for the branch, as it is registered in the packagist. "dev-3/privacy-setting"

Btw: If you're in Slack and have any questions, you can also find me there.

@t3easy
Copy link
Author

t3easy commented Nov 7, 2023

@t3easy I have created a pull request for you: #5

The PSR-14 event is already there for me, and that went well. For the privacy thing, I added a setting at TypoScript level. See if that's something for you. If everything is fine, I'll create a release 2.1.

Btw: Everything implemented and tested with v12

@ayacoo Sorry, haven't found the time to test, yet, but it looks promising. The only thing, that could be a "problem", is that it could be complex for a junior integrator ext+yml+php.

@hilburger
Copy link

I'll test it within my site package. My last set up of news with this method and also the Klaro ext by Eric went pretty well. We are using my tests to enhance the documentation.
I'll try the new version tomorrow, my eys are starting to close themselves ;)

@ayacoo
Copy link
Owner

ayacoo commented Nov 8, 2023

@t3easy Yes, I agree. Hence the option for simple setting adjustment.

@hilburger Before you get into big trouble: I think I'll update all my media extensions at the weekend. Then you can simply download 2.1.1 on saturday or sunday.

@hilburger
Copy link

@t3easy Yes, I agree. Hence the option for simple setting adjustment.

@hilburger Before you get into big trouble: I think I'll update all my media extensions at the weekend. Then you can simply download 2.1.1 on saturday or sunday.

That sounds great and I will focus on other stuff until then, there's enough to do. :D
Thanks for giving me the hint!

@ayacoo
Copy link
Owner

ayacoo commented Nov 11, 2023

@hilburger The 2.1.1 has just been released. If something does not fit or you are still missing something, please let me know.

@hilburger
Copy link

@hilburger The 2.1.1 has just been released. If something does not fit or you are still missing something, please let me know.

That's awesome news!
I will try to have a look today and test it to give feedback asap.

@hilburger
Copy link

I have finally started to work on this and it looks good so far. I will send feedback as soon as I'll be ready.

@ayacoo
Copy link
Owner

ayacoo commented Mar 2, 2024

Issue is closed. The implementation has been integrated since release 2.1.1.

@ayacoo ayacoo closed this as completed Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants