-
Notifications
You must be signed in to change notification settings - Fork 0
Kirby Detect Ad Block
Ahmet Bora edited this page Sep 15, 2022
·
1 revision
This plugin helps you detect ad blockers and manage the warning messages that will be displayed for Kirby 3.
- Download the latest release
- Unzip downloaded file
- Copy/paste unzipped folder in your
/site/plugins
folder
You can use sample basic snippet of plugin:
<?php snippet('detect-adblock') ?>
If you want to customize overlay, you can override detect-adblock-overlay
snippet like following:
<!-- /site/snippets/detect-adblock-overlay.php -->
<div id="custom-modal">
<h3>Warning!</h3>
<p>Looks like you are using ad blocker. Please disable and refresh the page!</p>
<button type="button" onclick="location.reload();">OK</button>
</div>
The default values of the package are:
Option | Type | Default | Description |
---|---|---|---|
title | string | AdBlock detected! | Overlay title |
text | string | Please disable AdBlock and refresh to see requested page. | Overlay text |
button | string | Refresh the page | Overlay button text |
All the values can be updated in the config.php
file and prefixed with owebstudio.detect-adblock.
.
<?php
// /site/config/config.php
return [
'owebstudio.detect-adblock' => [
'title' => 'Warning! ',
'text' => 'Looks like you are using ad blocker. Please disable and refresh the page!',
'button' => 'OK',
]
];