Closed (won't fix)
Project:
Node clone
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Nov 2008 at 03:32 UTC
Updated:
26 Jul 2011 at 18:58 UTC
I didn't like the Clone tab on a site I was build, I wanted a normal link users can click to clone a node. So I added an option to clone's settings which allows admins to set whether or not the tab appears. The sucky thing about this is you need to clear cache after you set this, to rebuild the menu. I'm not sure how to get around this.
I also created an API function to return a node_clone link so you can add it into your node's template. It adds a class but could be expanded to do full theming with a template file (flag module does something very similar.)
Would love to hear any feedback!
| Comment | File | Size | Author |
|---|---|---|---|
| menu_tab.patch | 2.86 KB | gdd |
Comments
Comment #1
tordrup commentedThanks for this heyrocker!
I didn't pay attention to the code I was patching, so it took me a few minutes to figure how to add the link in my template. (I stupidly expected it to be part of the $node object or $links output)
Put this in your node.tpl.php file:
Comment #2
pwolanin commentedwhy not use the normal hook_link API for nodes?
Comment #3
wgrunberg commentedWhat do I need to do to just remove/hide the "clone" tab on node pages? I use Views to add clone links.
I have looked at the clone_menu() function in clone.module but don't know how to proceed.
Comment #4
pwolanin commentedLooks basically ok, but as above, there ought to be an option to add this link to hook link, and also you need to add a submit function tot he form which calls menu_rebuild() when it's needed.
The alternative, of course, is a 3 line addition to a site-custom module to do hook_menu_alter().
Comment #5
pwolanin commented