Drupal 7 Legal Module

By shane
Thu, 2013-01-03 21:19
Daily Dose of Drupal Episode #80

Share with Others

Have you ever needed to add a terms and conditions page to your Drupal website? You know the legal stuff that most people don't care much about but is actually important. If so, the Drupal 7 Legal module can help.

Note: This module automatically adds a /legal page to your website. I forgot to cover this in the video.

In this episode you will learn:

  • How to install and configure the Drupal 7 Legal module
  • How to manage and track Drupal 7 terms and conditions revisions
  • How to add multiple checkboxes to the terms and conditions form

Hello everyone and welcome to another Daily Dose of Drupal, today we’re on Episode Number 80. As always I’m Shane, you can follow me on Twitter at smthomas3, you can also go to codekarate.com and sign up for the newsletter.

Today we’re going to be talking about the Drupal Legal Module. The Drupal Legal Module is a very simple module in theory, it just provides you a way to have a terms in condition section on your site and allows you to easily manage that but it does have quite a few nice features for managing different revisions to your terms and conditions and making sure that every user has accepted the most recent version of the Terms and Conditions.

So I already have this downloaded on the test site here, we’re going to go ahead and turn it on. So go ahead and find the legal module and turn it on, the next thing you want to do is check the permissions for the legal module and make sure that the right users can view the Terms and Conditions and then you want to save that of course.
The next step is to actually start building out your Terms and Conditions and you can do this from the Configuration page. And what this is going to allow you to do is we’re going to basically be able to set up a Terms and Conditions and there’s a couple of different formats we can choose and once the Terms and Conditions are set up then we’re going to go ahead and run a test with a user that we’re going to go ahead and create and show how they can accept Terms and Conditions and even view a new revision to those Terms and Conditions.

So if you make a change to their Terms and Conditions and then they log in the next time it’s going to make them accept those changes before they can login to the site. So as you can see there’s a legal section here, we’ll go ahead and click on that, this first part is just an example so it says that there’s no Terms and Conditions yet so we haven’t created one.

There’s 4 different display styles; you can have a Scroll Box, Scroll Box with CSS, just a full HTML text to Terms and Conditions or a page length. I’m going to leave it at the default for now. Obviously you’ll have Terms and Conditions that are probably much bigger than this but I’ll go ahead and just paste some text in there so we can see it, you can also add additional checkboxes.

So if you needed to add a checkbox, the example to use I believe on the project page is the checkbox to say I am over the age of 18 so I’ll add an extra checkbox. Make sure that they agree to that before they can sign up to the site but you obviously put something that you can actually want them to agree to it in order to accept your terms and conditions and if you have any changes since the previous version you can add them here.

So go ahead and click Save, now you can see here’s an example of how it’s going to look. If we go ahead and change the style I believed it changes it up there. Also note that it tells you the version ID and when it was created. So we’ll save that, that didn’t really change much I guess.

The other thing to make sure you do have installed the Views Module because what it’s going to allow you to do is view the terms and condition history, it tells you the additional changes, the data was added, it also tells you to a list of all the users that have accepted the terms and conditions.

So what I’m going to do is I’m going to login as a different user to the site, actually I’ll create a new account so I’ll start from the beginning. As you can see here’s the Terms and Conditions, if I come back to the other browser I’ll go ahead and change the scroll box a little bit and save that so we can see what design changes have effect, you can see that caps the height and gives me a scroll box so it looks a little cleaner that way.

We can also do HTML text but that’s just going to display the entire thing and the page length is just going to give you a link so I’m going to keep it the way it is and I’m going to go ahead and sign up for an account . So test Terms and Conditions, so now that I accepted those it sends me the e-mail with the welcome message since I don’t want to go grab that e-mail, I’m just going to hop in here and reset this user’s password so I can login quickly.

Obviously I can take that e-mail and login as I normally would but I’ll just reset that so I can get in so now I’ll go ahead and login. You’ll notice that when I come to my account and I edit, it’s going to show me the terms and conditions that I’ve accepted. So that works pretty well out of the box but what’s interesting is now when you come in and you’re actually able to change the terms and conditions. So let’s say I need to add a new section to the Terms and Conditions; So I add a new section in there and then I go ahead and … as you notice before I saved it, it says I’m on Version 1, it tells me the specific date it was created.

Once I save this it sets me on Version 2, updates the date and as you can see now the new section is in there. What this then allows you to do before we jump over we’ll go ahead and take a look at the accepted page, you can see that it says this user’s test terms … it should be Terms and Conditions, test TOC, this Version 1, revision 1 and tells me when to accept it and also if I go to the history I can see the first version and the second version here.

So now if I login we’ll go ahead and logout and then log back in as this user you’ll notice it brings me to a Terms and Conditions page, it also gives me a changes list which gives me a bolded list of all the lines that I added so it says I added a new section to the terms and conditions, it allows me to review it, I then have to accept both again, confirm it and also there’s a warning there that I’ll take a look at but if you go ahead and come to the other page you’ll notice that it’s back … looks like I’ve accepted it because I have … it is the newest version with the new section and everything works.

I come back over to the accepted page and now it says that I accepted the first version, I also have accepted the newest version which is the second version. So it’s a relatively simple module but it does do an important thing especially if you need to have a legal section of Terms and Conditions on your site and not just have the text there but actually want the user to have to physically accept it then this is the module that’s going to get that job done for you. So go ahead and take a look if you haven’t already and thanks for watching the Daily Dose of Drupal and we’ll see you next time.

Post new comment