Handling Terms & Conditions / End user agreement to see content

We want to set it up so that the first time someone comes to our Omeka home page, they must agree to Terms & Conditions (or User Agreement?) before viewing any content - this notice would essentially be a pop-up where they check off “I agree.” Afterwards, when they return again, they would ideally not have to do this again. I was thinking I’d just set up a persistent cookie.

My question is: has anyone else done this (T & C and/or with a cookie) or similar and, if so, how did you do it? what’s the best method of handling this in Omeka?

Yes, there is such a plugin! Try https://github.com/ozmeka/plugin-TCsDialogue. I don’t check it, so I don’t know if it works as you want.

Anyway, you can always find the full list of plugins for Omeka and equivalent modules for Omeka S here: https://daniel-km.github.io/UpgradeToOmekaS.

1 Like

Thanks! I had no idea. I guess I need to check github more often…

I installed the plugin but am not sure exactly how to control it or test it. I modified the text in the main plugin php file, but can’t seem to get it to popup (even after clearing the cache, including cookies, in a browser I rarely use). Not sure if I’m missing something or what, so I’ll keep looking into it.

I just try it and it works fine, even if it is not really integrated in Omeka (no config form). Javascript should be enabled.

Try to open a “private browsing” window to avoid cookies.

I tried two separate browsers, including private browsing, and cleared all the browsing data (including cache and cookies) and with javascript enabled… I honestly must not be setting up something correctly initially. Aside from installing the plug-in, is there something else I need to do to “turn it on”? I’m looking at this right now:

So it appears to me I have to create a cookie after installing this plug-in, correct? Where exactly do I “put” this cookie code so the cookie shows up the first time they land on the site’s main page (index.php)?

Did you try with a standard theme? I just installed the plugin and it worked.

Admittedly, it’s my first time working with cookies. Do you mean to just add it to index.php with themes? If so, do I just add it at the top of that file?

So my understanding is that I would write a cookie at the top of that file that says something like:

$.cookie('termsconditions', 'yes', {  path: '/' });

Because we want a persistent (non-expiring) cookie set that they have read the terms and conditions? Do I also have to check to see if the cookie then exists each time?

I didn’t change anything in the plugin, I simply clicked “install”.

Is this a site in production? If not, go to Appearance, change the theme to the official theme “Berlin”, reset the plugin of all your changes, enable it and go to the public page. It works in all my browsers.

You don’t need to change anything in the code, except the text to display. Make sure there is no php error, html, or javascript error.

Yes, it’s a site already in production, and we’re using the seasons theme. I didn’t see any errors… but now I wonder if someone previously modified the themes file and that is throwing things off?

I just tried the theme seasons on a test site with the last version of Omeka and the plugin works fine, it displays a warning that I must accept to see any page.

1 Like

Interesting. OK, must specifically be an issue with our theme install that someone before me modified. I will look into it, thanks…

Still no luck, but I’m trying a few other things. When I look at the JS console in the browser, I see these two files before the cookie.js file:


After cookie.js, there’s also:


… and a bunch of others under the theme

I wonder if any of those are causing the issue? We have a bunch of plugins we’re using, including 3-4 related to Neatline, and I wonder if there’s a conflict?

EDIT: The console also throws this error:

“Uncaught TypeError: jQuery.cookie is not a function
at (index):106
at dispatch (jquery.min.js:3)
at r.handle (jquery.min.js:3)”

That seems to be a good clue, but not sure what to fix =/

Also, is it strange that there are two jquery.min.js files? I found this description of a similar problem, but I don’t then know why there would be two min.js files (different versions) called - would this be a plug-in doing something?

Edit2: Found the problem. Double call to jQuery files caused the error. Discovered that previous developer here added an extra line in the themes/seasons/common/header.php file that calls the second file. Once I got rid of that, it works. However now I wonder what else I’ve broken… (!)

So I discovered what it is that I broke… We have a “liquid slider” installed that uses the jQuery library 2.1.3.

Is there any harm if I change Omeka’s default (1.11.2 above) to 2.1.3? Or is this even possible? It is clear to me that the problem is: I cannot get BOTH the Terms & Conditions AND liquid slider to run at the same time because of this libraries conflict. The liquid slider seems to require the higher version of the library; when I remove it, it breaks. When I add it back, the two libraries conflict and T &C no longer works.


Did you try to use only jQuery 2.1.3?

I would like to do so but don’t think I can change that based on forum posts I read (I think it’s set automatically?). But if you have an idea as to where I could change it, let me know.

FWIW, I think I have a problem similar to this one described five years ago in the old forums. The conflict is between Terms & Conditions, which uses the default library, and liquid slider, which seems to use a different (higher version) jQuery library. I would like to keep both plug-ins, but I don’t know how it’s possible to change Omeka to work with the higher level library.

Just to add an image to show the problem, the offending lines (throwing javascript errors) are the jQuery library conflicts seen here:

When I remove the latter call to the jQuery file (2.1.3), the liquid slider we have installed stops working. If I leave it in, this conflict prevents T & C from working.

I know where to make the calls to the latter jQuery library in the themes/common/header.php, but I don’t know where Omeka is setting the initial jQuery 1.11 library, I don’t know why the jQuery conflict function is currently commented out (perhaps my predecessor?), nor do I know in what file to look for where this is set to begin with. Would really appreciate it if someone could tell me where to look for that…

Just modify the Omeka Core file application/libraries/global.js. This is the quick way to check if it works, but to change it in the good way, modify common/header.php in your theme, set the jquery you want with queue_js_url("xxx") and the jquery ui too, and don’t include them by default: echo head_js(false);.

1 Like

That didn’t work for some reason, so there must be a larger issue… but I did find the lines in the file, and I appreciate you telling me where it is located so I now know.

We had a meeting yesterday about our site and now the PI wants a registration page set up instead, so I’m going to just put the T & C in that and not worry about this issue for now.