Drupal 7 Override Node Options Module

By adam
Thu, 2014-12-04 08:08
Daily Dose of Drupal Episode #182

Share with Others

Drupal: Configuring Override Node Options Module

All the best modules are simply built, and override node options is exactly that. The purpose of this module is to give you individual control over the fields with the authoring and publishing fieldsets on Drupal nodes.

Within permissions you are able to set access control (based on role) to show or hide these fields. Some of the fields include sticky at top of page, promoted to front page, authored by and authored on.

Before, without this module it was either an all or nothing in regards to showing the fields within those two sections. NOT ANY MORE.

****** IMPORTANT! *******
If you give a role the permission of "Administer Content" it will override the functionality of this module completely. In other words, that permission makes this module pointless (at least for any role that has that permission granted to them).

Try it out and let me know your thoughts.

Hey everybody! Welcome to Episode 182, I am Adam Learing and today we are going to be looking at the Override Node Options Module. This module basically allows us what the title says. It allows you to override certain fields on the node when you’re creating it. So if you look at this image here you can kind of get an idea. So you see here that there is different options that you can then allow different roles to either see or not see based on the configuration.

So for example we’re looking at authored by option, authored on promoting different page, promoting publishing options, stuff like that. I believe it is only for the authoring information, yeah right here, it says only for authoring information and publishing field options so as you’ll see as you’ll go through it’s just into those two field sets but anyway, we’re going to be taking a look at that.

I am using the 7 version, 7.1.13 so you make sure that you…if you’re not using the same version as me, do take that into consideration. Pretty [inaudible - 0:01:13.4] recent module and we’re going to get into here in a second. The other things I want to of course do is head on over to Code Karate and just show you a few things. If you haven’t yet, check out our Cheat Sheets, we have both one on Git and Drush, check those out. Those are completely free.

Also if you’re on Code Karate check out our other post and check out our EBook as well, Five Secrets to Becoming a Drupal 7 Ninja. Alright so let’s get to the module. So we go ahead and we’re going to download the module which I have already done and we will enable the module so I’m going to head on over here to the modules and you’ll see here under the Permissions section, Override Node options and just click on that to get that enabled. Alright so once it’s enabled then all is left to do is set the permissions but before I do that I want to show you what the default would look like.

So I’m going to double check and make sure nothing preset here. Okay so as you here this is the override node options section and nothing is checked so it’s all at default as it will be one when you download it. So what I’ve done is I have two different roles on my site so if I go up to People here, permissions and roles you’ll see that I have just…all three actually, these are the default ones.

I have Administrator, Authenticated and Anonymous. I have created another authenticated user which is Bugs here. So he’s an authenticated guy, so once I head on over here and I have given him some pre-permissions but basically if I come over here and I’m going to add a basic page content type you’ll see it here I can do a title, the body or like you expect and I don’t see anything else. There might some defaults that I’ve given him for permissions. As you see those options right there. It’s kind of important to keep those in mind.

So I head back over here to the Permissions section and you’ll see here that I’ve given him comments and that’s the Administrator comments and that’s why he then can see this comment setting section here. This is very important, very very important to note here to right here; Administer Content, this permission. If you give a role of this permission right here, it will override and not basically make the override node options module irrelevant.

So if I click on this I will get obviously…right here, I’ll just do it. So if I click Administer Content I come in here and save it and then over here back to my authenticated user bugs and refresh, now you can see I have all these options which is maybe what you want for your certain user but it’s using this Node Override Module, you’re not going to want that box checked for this role.

One thing that you can note though is…okay so here we have the Published, Promoted the front page and Sticky at the top of the list. Those are the three fields in there but once this is over with module I can show only some of these or all of these or whatever I’d like. So I’m going to uncheck that box so I do not want that and if I head down here to the Override Node Options section you’ll see it’s broken down to every bite each content type I have, article and basic page but let’s say I want to be able to give this authenticated person the ability to make sticky tops, the pages and…let’s see what else I want. Let’s just do front page.

So Promote with a Front Page option, so let’s go ahead and save that, come back over here and now you’ll see that I have this two options now available to me. Again remember I took off the administrator content roles so if I would uncheck these two boxes. I’m going to do this just to show you here, you can see that it goes back to the default and then these two fields are going to disappear into the whole publishing options, the field set is going to go as well which are these.

So we’re going to turn those back on real quick here. You’ll see there’s Sticky and Promoted Front Page I have it checked. You can do other ones too, like you can get Authored on, Authored by, you can do bunch. I’m coming back here, let’s see a few more things here now. So now I can see the Authored information which I just checked and then the Publishing Two Fields I just checked as well. So that really all the Override Node Options Module does but again it does allow you fine and gain control on certain fields.

But again it’s a two fields in the authoring, it’s the fields in the authoring information and the publishing options field sets. These other three you see above are handled by different permissions. For example like I showed you the comment section, menu section and then URL sections. So like Menu, if I get rid of that, URL is down here somewhere…where is that one, get rid of those. So I save that then again I can really control what this person will see in the end. So now you see those rooms are gone, comments are still there. I could get rid of that if I wanted.

I can really decide on what I want this user to use [inaudible - 0:07:19.1] excuse me, so now it’s gone up and now these are the fields I’ve checked. So obviously this whole modules…Field Permissions are important when you have non-technical people using your site and you don’t want them to see stuff that they don’t understand. So you can really get and find your control so they only see when they’re creating content, the stuff they don’t need to see and then they’ll ask you questions like what this mean, do I need to click this or not or people in the website and for customer, same thing. Only give them what they need. Don’t give them anything else because it just creates headaches for you.

So anyway, that is the module, if you have any questions about the module make sure you leave them in the comment section below the post. Otherwise head on over to Code Karate and check it out, let us know what you think about everything, check out the Cheat Sheets, check out the EBook and that’s it. Alright guys, until our next episode, talk to you later.