Jump to content

MarkupCookieConsent


Can

Recommended Posts

Just lost my text due to wrong shortcut -.- (maybe auto storing in local storage would be nice :D) but anyways..

Now I got you maba.

Thanks to you I just notices that my pages weren't working too..

I actually don't really now what fixed the issue and maybe just re-installing could fix it but there is a new Version with some changes you could grab during re-installation process..see changelog in readme for detail

Make sure to remember your settings before uninstalling!

Please let me know if everything works now.

Sorry Manfred for the late response and thank you for the translation!

'notes' => sprintf(__("For example Font Awesome checkmark icon e.g. %s\n(You need to include Font Awesome on your own)"), "<i class='fa fa-check'></i>"),

I just stripped the \n for now

Maybe don't use the \n? Or delete part of string "(You need to include Font Awesome on your own)", because Font Awesome is already included in PW.

But it won't be included on your front pages templates so it works only in backend. You can of course reference the version used by PW but you have to do it yourself

(or am I missing something?)

'notes' => __("Default true\nIt has been suggested that this setting can effectively help to reduce identity theft through XSS attacks"),

Moved "Default true" to end of former line..

I have no idea why \n is not working I always used it as it's suggested in the docs and as far as I remember it always worked?!

EDIT: 0.1.2 adds minified CSS & JS

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Wow finally I can answer :o internet is quite slow at the moment and the new PW forums seem to be a little hungrier or dependent to load fully for the reply form to work/load so I can read but answering is a hard task for me..and here's now link anymore pointing to a stand alone reply form (which could maybe be more lightweight, I don't know..) anyway..now it works :D

So as @kixe requested the policy link text is now translatable, too. I'm not sure but I think till now the translations weren't reflected in the cookie notification at all, or maybe I confused myself and missed something don't know..
Anyway now it works (at least for me). Don't know if this is the proper way of coding this and I'm open to suggestions, maybe there's a PW way in doing this?

And as I'm a little more gitty now (working more with git, just found out what gitty actually means haha^^) I included a devns branch now..maybe it's a little confusing? (just now came the idea to call the branch namespaced or something) as it's not the development version of MarkupCookieConsent but the namespaced version meant to be used with PW 3.x devns. So the only difference is added namespace in the module and the config file and module info now reflects the need for PW >= 3 to install the devns branch

  • Like 2
Link to comment
Share on other sites

Hello I have currently integrated into the template cookieconsent manually.

In search of "maybe what better" I saw that yes there CookieConsent as a module.

Now I have it installed in my PW 2.7.3 and got this error

Error: Call to a member function isDefault() on null (line 78 of /home/wsc/web/bernhard.web-seo-consulting.eu/public_html/site/modules/MarkupCookieConsent/MarkupCookieConsent.module)

This error message was shown because you are logged in as a Superuser. Error has been logged. 

Is this due to the integrated or has other reasons in the template?

Link to comment
Share on other sites

2 hours ago, csaeum said:

Is this due to the integrated or has other reasons in the template?

@csaeumIf you install ProcessWire multi-language support, it should work ;)


@Can maybe this small check could help, on line 78/79

if($this->wire('modules')->isInstalled('ProcessLanguage')) {
    $userLanguage = $this->wire('user')->language;
    $lang = $userLanguage->isDefault() ? '' : "__$userLanguage->id";
}
else {
    $lang = '';
}

 

  • Like 2
Link to comment
Share on other sites

good catch @flydev never considered this as most of my projects are multi lang

tested and pushed your fix, should work now

@csaeum Please let me now if it works for you, too

EDIT: Just bumped version so you should be able to just update the module using ProcessWireUpgrade module (if installed)

  • Like 4
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
On 14.8.2016 at 5:34 PM, Can said:

For everyone interested in disabling cookies at all to avoid every possible need for this plugin checkout out this blog post from Ryan http://processwire.com/blog/posts/multi-instance-pw3/#more-session-control

@Can
Good to point this out. But already with a simple contactform you need cookies. I stay with your module as default.

Edit:
I ended up with a combination. Added the following code to my config.php

/**
 * if we would use cookies only for the admin area
 *
 */
$config->sessionAllow = function($session) {
	// if URL is an admin URL, allow session
	if(strpos($_SERVER['REQUEST_URI'], $session->config->urls->admin) === 0) return true;
	// if there is a session cookie, a session is likely already in use so keep it going
	if($session->hasCookie()) return true;	
	// user accepted cookies due to EU law (Module MarkupCookieConsent)
	if(!empty($_COOKIE['eu-cookie'])) return true;
	// otherwise disallow session
	return false;
};


Small request:
I would like to set a more specific target to the privacy policy page including an url fragment string like

/privacy-policy/#cookies

Would be nice to have an inputfield to add this to the url of the target page. Actually don't need this now but having an option to define an external page would be nice too.
I don't really get the usage of Link Target -> Custom Selector
Is it just to get the target frame by name according to the html attribute, or is it a kind of PW selector?

Edited by kixe
  • Like 1
Link to comment
Share on other sites

On 8.10.2016 at 6:20 AM, kixe said:

But already with a simple contactform you need cookies.

to use session based messages or what am I missing?

no it's no pw selector, maybe I'll change wording? it enables you to provide a custom link target (useful at all)

just pushed 0.1.6 with custom privacy page url

  • Like 3
Link to comment
Share on other sites

Thanks for the quick implementation. Again 2 small remarks.

1. Cookie Expire

The field description and the behaviour of the property 'cookieExpire' doesn't match. I got this after install:

Bildschirmfoto 2016-10-13 um 16.54.00.jpg


You should either change the description to something like 'Cookie expire date (Unix Timestamp)' or add time() later and not directly to the property like:

setcookie($this->cookieName, 1, time() + $this->cookieExpire, $this->cookiePath, $this->cookieDomain, $this->cookieSSL, $this->cookieHttp);

2. About Version Numbering

Your last version was: 0.1.51
Your update version is 0.1.6. PW detects an older version in this case and ask if I want to overwrite the newer module version by an older one.
PW handles only 2 subversion levels. A version number like 0.1.5.1 is not possible in PW.
So your new version number should be 0.1.52 or 0.2.0.
:rolleyes: It doesn't really hurt. Just to know ...

 

  • Like 1
Link to comment
Share on other sites

good catch @netcarver I think the thing is that I always forget that 0.1.51 is greater than 0.1.6 thinking about it I'll totally get it the first is fiftyone not 5.1 but a little distracted and I mix those things up..class, plugins, versioning are still kind of new..especially versioning as I never took it seriously coding for myself not bound to any automatic update process or other people involved ;)

@kixe fixed expiration and version issues

On 8.10.2016 at 6:20 AM, kixe said:

But already with a simple contactform you need cookies

Because I'm curious I have to ask again..what exactly do you mean by this? For convenience (e.g. to use session based messages)? By law?

Another general question..do those two branches master and devns make sense? Not that it's a big hassle to maintain, but again because I'm curious ;)

Saludos

Link to comment
Share on other sites

  • 3 weeks later...
On 15.10.2016 at 4:46 AM, Can said:

Because I'm curious I have to ask again..what exactly do you mean by this? For convenience (e.g. to use session based messages)? By law?

Nothing special. Just to use session based message.


Again something to complain about. Sorry for this :rolleyes:
Good to have the option to limit the cookie consent to a special path/ tree. But in this case the banner shouldn't be shown for pages not residing under this tree.
It would also be nice to store the page id and not the path, to stay multilanguage compatible and to avoid problems if the page name has been changed. A page-field (instead of text) would be the simplest solution here.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...