Jump to content



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

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

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


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 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 ;)


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
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By Sebi
      AppApiFile adds the /file endpoint to the AppApi routes definition. Makes it possible to query files via the api. 
      This module relies on the base module AppApi, which must be installed before AppApiFile can do its work.
      You can access all files that are uploaded at any ProcessWire page. Call api/file/route/in/pagetree?file=test.jpg to access a page via its route in the page tree. Alternatively you can call api/file/4242?file=test.jpg (e.g.,) to access a page by its id. The module will make sure that the page is accessible by the active user.
      The GET-param "file" defines the basename of the file which you want to get.
      The following GET-params (optional) can be used to manipulate an image:
      width height maxwidth maxheight cropX cropY Use GET-Param format=base64 to receive the file in base64 format.
    • By MarkE
      This fieldtype and inputfield bundle was built for storing measurement values within a field, rendering them in a variety of formats and converting them to other units or otherwise modifying them via the API.
      The API consists of a number of predefined functions, some of which include...
      render() for rendering the measurement object, valueAs() for converting the value to another unit value, convertTo() for converting the whole measurement object to different units, and add() and subtract() for for modifying the stored value by the value (converted as required) in another measurement. In the admin the inputfield includes a checkbox (which can be optionally disabled) for converting values on page save. For an example if a value was typed in as centimeters, the unit was changed to metres, and the page saved with this checkbox selected, said value would be automatically converted so that e.g. 170 cm becomes 1.7 m.

      A simple length field using Fieldtype Measurement and Inputfield Measurement.
      Combination units (e.g. feet and inches) are also supported.
      Please note that this module is 'proof of concept' at the moment - there are limited units available and quite a lot of code tidying to do. More units will be added shortly.
      See the GitHub at https://github.com/MetaTunes/FieldtypeMeasurement for full details and updates.
    • By tcnet
      File Manager for ProcessWire is a module to manager files and folders from the CMS backend. It supports creating, deleting, renaming, packing, unpacking, uploading, downloading and editing of files and folders. The integrated code editor ACE supports highlighting of all common programming languages.

      This module is probably the most powerful module. You might destroy your processwire installation if you don't exactly know what you doing. Be careful and use it at your own risk!
      ACE code editor
      This module uses ACE code editor available from: https://github.com/ajaxorg/ace

      This module uses the JavaScript dragscroll available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability to drag the table horizontally with the mouse pointer.
      PHP File Manager
      This module uses a modified version of PHP File Manager available from: https://github.com/alexantr/filemanager
    • By tcnet
      This module implements the website live chat service from tawk.to. Actually the module doesn't have to do much. It just need to inserted a few lines of JavaScript just before the closing body tag </body> on each side. However, the module offers additional options to display the widget only on certain pages.
      Create an account
      Visit https://www.tawk.to and create an account. It's free! At some point you will reach a page where you can copy the required JavaScript-code.

      Open the module settings and paste the JavaScript-code into the field as shown below. Click "Submit" and that's all.

      Open the module settings
      The settings for this module are located int the menu Modules=>Configure=>LiveChatTawkTo.

    • By tcnet
      Session Viewer is a module for ProcessWire to list session files and display session data. This module is helpful to display the session data of a specific session or to kick out a logged in user by simply delete his session file. After installation the module is available in the Setup menu.

      The following conditions must be met for the module to work properly:
      Session files
      Session data must be stored in session files, which is the default way in ProcessWire. Sessions stored in the database are not supported by this module. The path to the directory where the session files are stored must be declared in the ProcessWire configuration which is by default: site/assets/sessions.
      Serialize handler
      In order to transform session data easier back to a PHP array, the session data is stored serialized. PHP offers a way to declare a custom serialize handler. This module supports only the default serialize handlers: php, php_binary and php_serialize. WDDX was dropped in PHP 7.4.0 and is therefore not supported by this module as well as any other custom serialize handler. Which serialize handler is actually used you can find out in the module configuration which is available under Modules=>Configure=>SessionViewer.

      Session data
      The session data can be displayed in two different ways. PHP's default output for arrays print_r() or by default for this module nice_r() offered on github: https://github.com/uuf6429/nice_r. There is a setting in the module configuration if someone prefers print_r(). Apart from the better handling and overview of the folded session data the output of nice_r() looks indeed nicer.

      ProcessWire module directory
  • Create New...