Drupal 7 Node Clone Module

By shane
Wed, 2013-01-16 23:35
1 comments
Daily Dose of Drupal Episode #88

The Drupal 7 Node Clone module allows you to easily make a copy of any node on your Drupal 7 website. This can be useful in many situations such as make a copy of content before making changes on a production site (for those that do not have a staging environment) as well as using an individual node as a template to make other nodes out of. The Drupal 7 Node Clone module is also very configurable.

In this episode you will learn:

  • How to use the Drupal 7 Node clone module to make a copy of an existing Drupal node
  • How to configure the Drupal 7 Node clone module

Hey there everybody and welcome to another Daily Dose of Drupal. As always I’m Shane, you can follow me on Twitter at smthomas3, also hop over to codekarate.com and make sure to sign up for the newsletter right over here on the left side. We’re on Episode Number 88 of the Daily Dose of Drupal today and it’s going to be a quick one. We’re going the Node Clone Module.

Generally; what this module can be used for is for I guess it sounds it up pretty clearly, it enables you to nodes. This can be useful if you have a very complex page and maybe you want to make some changes to it, it’s on a live site but you want to test those changes before you actually change on the live site so you can make a clone of it, put it on unpublished status, do all your changes and make sure it looks good and then copy those changes over or if you have a lot of nodes that are going to look the same, you can use that to kind of give a jump start so it cuts down the amount of work you have to do.

Obviously in the first situation you can use a development site and push it up through that but this is kind of a simple module that allows you to copy different pieces of content so if you have nodes and you want them to copy, not everything works as you’ll notice there’s a little warning.

If you have a really complex node type it may not clone completely cleanly, however in most cases it will so it can be a helpful little module if you just need to copy an existing node and then make changes to it. So we’re going to go ahead and take a look. I already have the Node Clone downloaded and it is installed, you can see I’m using the 7.x-1.0-RC1 version.

We’re going to start by going to the Configuration page. It gives you a couple of different options here; you can either have it pre-populate the node form fields so it doesn’t actually create the node when you click the link or you can have it actually go ahead and create the new node right away and then allow you to edit it and we’ll go over both those or you can tell if you need a confirmation when it creates a new node you can have it clone the menu links, you can set, reset publishing options for specific content types and you can also set which content types should not be cloned.

So if you have a content type that you know won’t work with this Node Clone Module you can omit certain content types here. So I’m going to leave that as a default and I’m going to come over to an article here, this is just an article content type but a couple of different fields, it has a five star rating, it has two other fields on it, one of them is hidden right now but what I can do is I can click this link that says Clone Content.

So right now it creates a Node Add Form basically that gives me all these content. It does add Clone Of at the beginning, it does load in the different fields so the status field had none, it does have the Bullian test checkbox checked, tag of test box was set correctly. So it has not actually saved the database yet until I hit Save.

So once I hit Save now it’s saved to the database and now you can see this is the Clone Of so I can go ahead and of course change things and make it a completely different copy so it’s not the same as the original as you can see if I open up the original here it looks different. It doesn’t have the extra field showing but it allows me to quickly and easily make a copy and then I can make changes of this.

Of course if I wanted to not allow other people to see the changes as I was making I can of course unpublished it and now it’s not going to show up on my list of articles but I can use it as a testing to see how an article would look after I copied it or of course just make changes or make another article based of that original one. We’re going to go ahead and check out the other configuration options just really briefly and you can see we can have it save as a new node and then have it edit.

So in this case we’ll also want a confirmation so I have this set as Required Confirmation. Now that I save this I’m going to go back and I’m going to clone this Test Article 2, I’ll click Clone Content it’s going to say that it’s creating a new node and I’ll be redirected to the edit page, I’ll click Node or Clone it clones that node, it says Clone of Test Article 2, this is now is saved to the actual database itself.

As you can see it’s on the Node 7 Edit page, it has actually already created the node on this case so even if I close out of this and I come back there’s clone of Test Article 2 which is exactly the same as Test Article 2 besides the fact that the title is a little different. It didn’t copy over any menu items or anything like that. So it’s an extremely simple module but it does serve a purpose on some sites. It’s not something you’re going to use everyday but it is something to have in your development toolkit and we’ll be back again next time with another episode of the Daily Dose of Drupal. Thanks for watching.

Need to learn more Drupal?

Premium Drupal Training Online (Horizontal)

Comments

Hi

Required help on Content staging from Staging TO production.

I have figured out the deploy module but some how it doesnt work out.

Thanks
Muthu

Post new comment