1.4 KiB
1.4 KiB
How to add new addon
Steps
- Add new addon to addons.json
- Create a directory in addons/controller/addons
- Create a class in that new directory (copy class from another addon and adjust the namespace, classname and methods.)
- Edit 'load_configuration' method. That is the only method that needs to be worked on to block the cookies. You can create your own method from there.
- Test
- Create integration test if you did use dependencies from the addon plugin. (We run daily tests to see if the dependencies from the addons plugin are still valid.)
- Send a pull-request in github
Example
-
New addon to addons.json
"Add_To_Any": { "class": "cookiebot_addons\\controller\\addons\\add_to_any\\Add_To_Any" }, -
Create directory 'add_to_any' in controller/addons
-
Create a class 'Add_To_Any' in 'add_to_any' directory (copy class from another addon and rename everything accordingly)
-
Go to 'load_configuration' method and rename the callback function to make it give more sense. Write your cookie-blocking logic in that function. You can find more information about how to block cookies in how-to-block-cookies.
-
Test if the cookies are blocked.
-
Create integration test for the addon dependencies: https://github.com/CybotAS/CookiebotAddons/blob/develop/tests/integration/addons/test-add-to-any.php
-
Send a pull-request to our github repository.