Closed WeeSee closed 4 years ago
Found the problem: need to enable fxp-asset
(was set to false
):
"config": {
"process-timeout": 1800,
"fxp-asset": {
"enabled": true
}
},
still not working...
I added the <?= CookieConsent::widget(
from the readme to ./views/layouts/main.php
and now get stuck with this error:
Unknown Property – yii\base\UnknownPropertyException
Setting unknown property: dmstr\cookieconsent\widgets\CookieConsent::detailsOpen
When commenting out this line and some others from the example, I get it working, but only on some pages, not the home page e.g. even there is only one layout in the app.
And I had to specify in the composer:
"config": {
"process-timeout": 1800,
"fxp-asset": {
"enabled": true,
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
},
need example code of cookie-consent
here is my code in layouts/main.php
<?= CookieConsent::widget([
'name' => 'cookie_consent_status',
'path' => '/',
'domain' => '',
'expiryDays' => 365,
'message' =>
'We use cookies to ensure the proper functioning of our website. '.
'For an improved visit experience we use analysis products. '.
'These are used when you agree with "Statistics".'
,
'save' => 'Save',
'acceptAll' => 'Accept all',
'controlsOpen' => 'Change',
//'detailsOpen' => 'Cookie Details',
'learnMore' => 'Privacy statement',
//'visibleControls' => true,
//'visibleDetails' => false,
'link' => '#',
'consent' => [
'necessary' => [
'label' => 'Necessary',
'checked' => true,
'disabled' => true
],
'statistics' => [
'label' => 'Statistics',
'cookies' => [
['name' => '_ga'],
['name' => '_gat', 'domain' => '', 'path' => '/'],
['name' => '_gid', 'domain' => '', 'path' => '/']
],
'details' => [
[
'title' => 'Google Analytics',
'description' => 'Create statistics data'
],
[
'title' => 'Goal',
'description' => '_ga, _gat, _gid, _gali'
]
]
]
]
]) ?>
<footer class="footer">
i think is because you are trying to install version 1.3.2. You need 1.4.3 for details
Good hint. I saw 1.3.2 as latest release mentioned in https://github.com/dmstr/yii2-cookie-consent/releases
there are more releases but github displays them "collapesed" and are not to easy to see :)
can i close this?
Yes, close the issue. I'll be sure it will work now. Thanx a lot for your help.
May you can add the composer requirements
"fxp-asset": {
"enabled": true,
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
to the docs since the sample app Yii2-basic just uses
"config": {
"process-timeout": 1800,
"fxp-asset": {
"enabled": false
}
},
I added this line to composer
require:
section:When executing
composer update
it fails withDid I miss something?