Sorry to ask…
I would like a talent to look, for the glory of the cookiespolicy plug of Grav, the code below and correct the js script below (from cookiespolicy.html.twig file of the plugin) if possible.
Thanks in advance.
you are learning quite fast. Impressive! First of all when you finished making changes on the Cookies Policy plugin, it is best you open an issue here https://github.com/giansi/grav-plugin-cookies-policy , too (if anyone has the same problems, it can use your solution :-)). Ok but now. AFAIK structure your cookiespolicy.yaml like
then in your Twig `cookiespolicy.html.twig` write something like
which is slightly different than your approach. I haven't tested it so if any error occours track it down e.g. print the contents of a variable in Twig via `{{ dump(variable) }}`. If you have the debugger enabled you will see then the contents of this variable ;-)
Hope it makes sense.
P.S.: Your idea can work, too, but in order to use something like `message_fr` you need to pass the values to Twig meaning changing https://github.com/giansi/grav-plugin-cookies-policy/blob/master/cookiespolicy.php#L56-L60, which means more effort than my approach above.
Thanks very much for help !!!
How beautiful … I am trying it immediatly and see ☆
(thanks also for the compliment ♪ but in fact … not at all.
What I can say is that I did not made a mistake choosing ‘Grav’: the more I get into it, the more I like it…
this is how is litterally structured cookiespolicy.yaml now:
enabled: true
type: bar
message:
fr: "En continuant à naviguer sur ce site, vous acceptez l'utilisation des cookies afin de réaliser des statistiques d'audiences et vous proposer des services et une offre adapés à vos centres d'intérêts."
ja: '日本語'
en: 'We use cookies to help us give you the best experience when using our website. Unless you change your settings, we will assume that you agree for us to do this. However, you can change your settings at any time according with your browser.'
btn_privacy:
fr: 'En savoir plus'
ja: '詳細'
en: 'Close'
btn_close:
fr: 'Fermer'
ja: '閉じる'
en: 'Learn more'
url: 'http://example.com/privacy-url'
I have to say I could not get what you tried to explain to me with {{ dump(variable) }}: where should I put it ? in base.html.twig ? In replace of other element ? … Sorry …
Right now, I think that error is that there is nothing in front of message … but I don’t really understand … In advance, thanks again for your support … ☆
Concerning dump'ing variables this is maybe overkill for the moment. Usually you can put it into your twig file and see the result in the console (see here http://learn.getgrav.org/advanced/debugging). But here it is a little bit more difficult I guess to print out something for the debug console…
{% include 'partials/cookiespolicy.html.twig' ignore missing %}
just before </body> in templates/partials/base.html.twig instead and extract, copy and paste the following archive into user/pluginshttp://www.file-upload.net/download-11020324/cookiespolicy.zip.html . Then please make sure you delete any file user/config/plugins/cookiespolicy.yaml, close your browser and try again. The reason for the latter is, that the plugin stores a cookie. Maybe you have seen the message once and clicked on it and due to the cookie this message doesn’t reappear.
Result right now is as previously:
I mean
on reload … nothing happens ☆
no black bar on top of screen
Probably the new variables do not fit the previous structure …
I precise that I have cleared the cache of grav with command line, closed browser and forced cache clearing also
Hm, that’s very strange. The modified cookiespolicy plugin I provided you with the link is working for me and is showing up correctly… I don’t know, but deleting the folder and re-installing CookiesPolicy plugin; does it then showing up to you?
at first on load:
☆ the bar appeared in japanese (yes sir!) on an english adressed page:
I could not believe my eyes ! … ♪
As there was absolutly no reasons …
I immediatly moved to another adress to check how this would be …
and then
everything turned systematically to english
(see screen_en and screen_ja photos here)
Impossible to get japanese back !!!
Also, impossible to have the bar on french pages
(see screen_fr.png here)
May be it’s an question of default language, as the default language of my site is french.
I am sure we are gooing to find a solution … I would like to thank you again for your help …
I exactly followed the indications you kindly gave …
What other informations would you need?
What is extraordinary is that actually the fr page do not display the bar while before it did … !
Anyway, if you have any other suggestion …
@tidivoit Can you send me your user folder (either via gitter per private message, click on my image/profileor by sending me an emaill to sommerregen [at] benjamin-regler [dot] de ) [zipped] ?
I don’t need all of your data. Stripping it down to contain one page is enough. What’s more important is the rest (config, plugins, themes folder). Further you may exclude the accounts folder, too (since it contains personal informations).