Recommended Posts

Maybe some javascript messages could work or you add a query string like ?comment=success which shows the message?

nice addition, I'll look into it as soon as possible ;)


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.

@kixe, think I need your help. I'm standing on the hose about your suggestions..

I replace the "cookie path" config input with an page select like used on "privacy page" right?
Then I'm getting an id. But I can't use that id as $path in setcookie or am I missing something?
So I would then find the page by this id, and store the page path?
But then how to be "multilanguage compatible"?

Edited by Can

Share this post

Link to post
Share on other sites


Sorry if I didn't speak clearly. I was talking about the banner, not the cookie itself. I don't need an option to modify the path of the consent cookie itself, so I would hardcode it to '/'. (To stay complete leave it as is.)

Much more interesting is to limit the display of the banner to a selectable page tree. Therefore an additional pagefield in the config could be useful. Lets call it pageTree.
You just need to add one line at the beginning of the renderCookieForm()  function.

 if($page->id != $this->pageTree && $page->parents->has(wire('pages')->get($this->pageTree)) == false) return;

An additional checkbox to include or exclude the parent page would complete this option.

  • Like 1

Share this post

Link to post
Share on other sites

Perhaps this new config field could be a field for entering a selector, that would allow more flexibility.

  • Like 3

Share this post

Link to post
Share on other sites

Perhaps this new config field could be a Selector field ... :rolleyes:

//in MarkupCookieConsentConfig

                        'type' => 'Selector',
                        'name' => 'pageSelector',
                        'label' => __('Banner display limit'),
                        'description' => __('Define selectors, which limits the display of the banner to selected pages.'),
                        'columnWidth' => 100

// in function renderCookieForm()
    // we stop here when on admin pages except this modules config page (for demonstration) or out of pageSelector
        if(($page->template != 'admin' && wire('pages')->find($this->pageSelector)->has($page) == false) || ($page->template == 'admin' && $this->wire('input')->get->name != $this)) return;


  • Like 1

Share this post

Link to post
Share on other sites

Finally pushed version 0.3.0

which includes your code snippets @kixe thanks for that and a button to remove the cookie for easier development..

Please tell me if all is clear, especially about the new selector, I added a little note on how to include tree parent using just the selector inputfield..
Let me know how you guys like it.

Should I still keep both branches? master for legacy (without namespace) and devns for namespace?

  • Like 2

Share this post

Link to post
Share on other sites

Hi all,

I'm using the current version of MarkupCookieConsent on PW 3.0.62, but it doesn't seem to work anymore (used to work fine a while ago). No error message whatsoever is displayed, but still no cookie is set (checked it in browser as well as on module's config page). The consent message isn't displayed either. I've already deleted/reinstalled the module two times.

Is anyone else experiencing the same problem? Suggestions?

Thanks a lot!


Share this post

Link to post
Share on other sites

Could you solve it?

Have you tried disabling ajax?

I'm really short on time at the moment :/

Share this post

Link to post
Share on other sites

hi @Can

i installed the module. it's working at the back-end but doesn's show up on front-end.
do i have to embed it manually in templates?

PW 2.8.35

Share this post

Link to post
Share on other sites

 @ngrmm just bumped the version to 0.3.2 including a little fix so it show up again, please let me know if it works :) 

@CalleRosa40 Just checked on pw 2.8.62 and 3.0.62, cookies are created as expected..have you checked console in dev tools? it should show something..and it could be interesting to check network tab in dev tools, too, to see if it actually sends the ajax request

  • Like 2

Share this post

Link to post
Share on other sites

Thanks for this module!

I seem to have a problem with it though...

I accept the cookie on my homepage, but then on other pages it asks for cookie consent again.

I tried with and without ajax, still this message keeps coming back.

How can I fix this?


Share this post

Link to post
Share on other sites


Does anyone have problems with the ProCache module? What happens is ProCache ignores the user choice when pressing the button "I have accept etc" and keeps popping up in every other page and in the page reload itself. I have asked on the ProCache forum and they redirect me here

Thanks for any help!

Share this post

Link to post
Share on other sites

Hi. Nice module, seems to work pretty well.

A few suggestions about configuring/customising. I like to keep my css files to a minimum, so I'd like to move the styles to my site css file (rather than inserting it after the first <link>). But when I untick the 'inject modules stylesheet?' option, it removes classes from the markup and hides the top/bottom, dark/light options. How about keeping these options available and just letting the user know that the css must then be manually added to a stylesheet?
I've done modified my installation to do that and it works well.

Also, when I've changed the class prefix in the config file, I had to still manually change one class:
I changed Line 104 of the module.php file from

    $cookieConsentForm .= "<p class='mCCF__message'>";


    $cookieConsentForm .= "<p class='{$classPrefix}__message'>";

You may want to update that. Thanks again for the module.

Share this post

Link to post
Share on other sites

hey guys I'm sorry for being away for such a long time and am unfortunate to say that I'm not able to maintain any of my modules at the moment
as I'm not doing any php / pw at the moment myself and don't have a working php/mysql environment locally right now to do anything "quickly"

but I would be open and happy if someone else wants to take over any of my processwire modules, by any way, for example by transferring the repo to a new home to have it redirect old links, or you could just upload yourself and i'll include a message in my repo readme and here in the thread

@strandoo maybe you are interested in taking over? than you could easily include your suggestions which sound good :) or just publish yourself and I'll link yours (just a thought, no pressure of cause!)


  • Like 1

Share this post

Link to post
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 Robin S
      I got tired of having to open the link dialog in CKEditor in order to check where a link is pointing to, so made this simple plugin.
      Link Hover
      A plugin for CKEditor. Shows the href attribute of a link in a tooltip when the link is hovered. This saves you from having to open the link dialog in order to check where a link points to.

      This readme assumes installation in ProcessWire CMS.
      The plugin folder must be named "linkhover" – if necessary, rename the folder to remove the "-master" suffix added by GitHub. Copy the "linkhover" folder to /site/modules/InputfieldCKEditor/plugins/
      In the field settings for each CKEditor field that you want to activate the plugin for, check the "linkhover" checkbox at Input > Plugins > Extra Plugins
    • By neosin
      I've been reading through the tutorials and have created an admin module based on the ProcessHello example module.
      I have a few questions regarding how to do a few things with the module that are not obvious or covered by the processhello tutorial.
      Outline of expected module functionality:
      The custom module admin setup page should contain a list of its editable pages. CMS users will be able to add/edit/delete pages of this module. The modules editable pages use the same defined fields. The editable pages data will need to be available for use by another custom module. This custom module (called "Stream Encoders") will handle creating/updating/deleting of "Stream Encoders".
      The encoders contain various fields such as encoder name, operational status (is it on or off) and brightcove asset ID
      A second module in "admin>setup" called "Video Streams" will handle creating/updating/deleting/scheduling of "Video Streams".
      Each video stream belongs to a video encoder and uses some of the settings from the encoder selected, such as the encoder title and the brightcove asset ID which on the frontend are used to display the video stream.
      My noob questions:
      Since they are not "pages" in the navigation tree, how do I define these "encoders" to add them to the custom stream encoders module? I don't believe my custom modules should be under "Setup", is it possible to have custom menus in the admin? It's fine if they can't but it would be more intuitive if they had their own menus in the admin instead of living under "Setup". Without having a specific page on the frontend for video streams, how would I access the data for a specific video stream from the home page? for example if I wanted to display a specific or random video stream in a sidebar on the homepage. Are there any tutorials on using scheduling with custom modules? The video streams can be scheduled or turned on/off as desired by the CMS users. thank you in advance
    • By BitPoet
      The module has been lying around on GitHub for some time now, so I thought I'd give it its own forum topic so I can give it a module list entry.
      Symmetric encryption for text based fields (supports multi language fields).
      Module page.
      Link to the GitHub repo.
      This module adds an encryption option to all text fields (and those derived from FieldtypeText).
      Field contents are encrypted using a symmetric key when a page is saved and decrypted when loaded from the database.
      The module by default uses sodium (if loaded) in PHP versions >= 7.2, otherwise it falls back to the bundled phpseclib.
      Multi-Language fields are supported too.
      Setting a field to encrypted and saving values in those fields is a one-way road!
      Once encrypted, the contents cannot be unencrypted without writing a program to do so. Disabling the encryption option on a field after the fact gets you encrypted "garbage".
      Download the zipped module through the green button at the top right of the GitHub repo or (once available there) from the official PW module repository Extract in its own directory under site/modules. In the backend, click "Modules" -> "Refresh", then install "Symmetric Encryption for Text Fields". Go to module settings. An appropriately sized, random key will be generated if this is your first use. Copy the supplied entry into site/config.php Add fields or configure already present fields. On the "Details" tab you can enable encryption for the field in question Edit a page with such a field, enter a value there, save and enjoy Existing, unencrypted values are left untouched until a new value is saved. That way, you can do a smooth upgrade to encryption, but you have to save all pre-populated pages to have their values encrypted in the database. Thus it is recommended to avoid adding encryption to already populated fields.
      Advanced Usage
      You can hook after SymmetricEncryptedText::loadKey to retrieve your key from somewhere else, e.g. a different server.
    • By BitPoet
      After building the ProcessMentions module and another autocomplete module for images, I found that I am going to need even more of these, but things were going to get repetitive. So I refactored the whole thing into a basic autocompletion module and individual "actions".
      The result is Autocomplete for CKEditor (GitHub).
      To try out,
      Install the module and actions

        Enable actions in the settings of any CKEditor field

        Edit a page with this field, type "@" and some characters for the  and enjoy
      There are still a few things I need to implement. ATM, it only supports single characters as triggers for the autocomplete. I'd like to change that to combinations so I don't run out of special characters at some point. I also have to add a few more configuration options (like search only at the beginning or also in the middle of the searched string). The documentation for custom styling also needs some work.
      I have tried to keep things generic. Implementing your own actions should be quite straight forward. The README at GitHub illustrates the main steps and the supplied action classes have inline documentation. I would love to get some feedback or even see some third party InlineCompleteAction implementations.
    • By Inxentas
      I love the option to export fields via the CMS, and wondered about using that export data in a module. Basicly, I'd want to configure a field using the CMS and then paste it's export data in the module code as a string, or save it in a seperate file I can read from the module code. Once I have that string as a variable or file, I'd want to run the same code the import option does... but then from my module code's install method!
      Is that possible? It would save a lot of time configuring fields through the API.