Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
node system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
29 Jan 2007 at 17:17 UTC
Updated:
20 May 2008 at 13:04 UTC
Jump to comment: Most recent file
Comments
Comment #1
Crell commentedI can't guarantee that it would be accepted, but I'd certainly be interested in such a feature for nodereview.module. You can have a look at that for a somewhat hacky way to hide it for now (it's 4.7-based, 5.0 upgrade is forthcoming), but a clean and standard way to do so would be very welcome. +1.
Comment #2
Crell commentedComment #3
ChrisKennedy commentedIs it not possible to create a set of permissions for each dynamic content type, like node.module does for custom content types?
Comment #4
RobRoy commentedRemember that UID 1 has all permissions so even though he may see it on node/add, if you don't allow anyone else to "create" on Access Control they won't see it. Then, you could still programatically create a node using drupal_execute(). I think...is that what you're looking for?
Comment #5
moonray commentedActually, in my case the node gets created, and linked to a taxonomy term, from the taxonomy term's page:
taxonomy/term/34. You should only be able to create it from there, and not from the add node section.What I did as a work-around is to give a "Not available" message when you try to go to
node/add/term. But it would be nicer if it didn't show up undernode/addat all.Comment #6
Crell commentedFor Drupal 5, have a look at how nodereview does it.
For Drupal 6, let's just get a real toggle checkbox in the system. :-)
Comment #7
Crell commentedOK, let's see if anyone bites... Patch attached. Includes a system.module update function. Someone check my postgres syntax, please. :-)
Comment #8
chx commentedMeanwhile, I removed a better half of node_add. Less code but more alterable thanks hook_menu_alter. Yay.
Comment #9
Crell commented/me steals the issue back from chx. :-)
After some discussion in IRC with chx and the other usual suspects, here's a revised revised version. This one includes chx's addition to make the node/add index cleaner, but instead of just hiding the menu item node types that are not listed there have no callback at all. node/add/foo simply won't exist. If you want to restore the callback, there or elsewhere, you would have to add your own node/add/foo menu callback (or put it someplace else if you prefer) in your own module. Since the code would be the same, the menu entry is all you'd need.
Comment #10
chx commentedI thought we agreed on renaming show_in_menu to visible?
Comment #11
Crell commentedNo, I said that since we weren't switching to a 3-value field I didn't see a need to change "show_" to "visible_". If TPTB really want it, though, it wouldn't be hard to do I guess.
Comment #12
oscnet commented+1 for this, it is what I needed currently .
Comment #13
chx commentedAfter my patch, why stick this to the content type screen, why not just disable in menu.module ? (i have menu item disable working, so it'll be available)
Comment #14
chx commentedJust let the menu system handle it. You want to remove from the menu system totally? hook_menu_alter it out of existence -- just unset it from the menu tree. You can use the upcoming menu module feature -- disable the menu item. Many posisiblities are there. And, it's less code.
Comment #15
chx commentedSpectacularly broken lil' patch, that was.
Comment #16
chx commentedSpectacularly broken lil' patch, that was.
Comment #17
Jaza commentedTested this, and it seems to work great. Except that you get a white screen of death on 'node/add', until you manually call menu_rebuild() - so just do that after applying, and you'll be fine.
Can't remove node types from this page given the current state of HEAD, but Chx assures me that once the menu admin page is back, you'll be able to remove node types from the listing, simply by disabling the menu item for that node type.
+1, I think this can go in.
Comment #18
dries commentedLooks good, but it doesn't work 100%. When I disable a content type, it is removed from the menu, but not from the overview page. See the screenshot.
Secondly, when I disable the 'story' menu on the menu administration page, it 'sinks' to the bottom, and it gets attached to the wrong parent. It becomes a child of 'logout' on a stock Drupal CVS HEAD install. This second issue might belong in a separate issue, but I figured I'd mention it nonetheless.
Comment #19
dries commentedNevermind, my first bug report (with the screenshot) -- upon closer investigation, it does work as intended. Good stuff, chx! :)
The menu item does loose its parent though.
I've committed the patch, but I'm leaving this as 'code needs work' so we can look at the parent issue -- or move it to another issue.
Comment #20
moonray commentedJust read Dries' post #17... does that mean that the patch only disables the item in the menu system, and not from the node/add overview page? Or was that just a glitch in your test environment Dries?
Comment #21
moonray commentedSorry, I meant Dries' post #19.
Comment #22
chx commentedThe parent issue is a) have nothing to do with this issue b) is already fixed, there are known problems with the custom menu items, this being one. Patch expected for that ... soon.
Comment #23
chx commentedD'oh! I have skipped the 'i committed' part. OK, this issue is fixed. Parents will be elsewhere.
Comment #24
dwwshouldn't this get a mention at the 6.x upgrade doc? (http://drupal.org/node/114774). it's developer-visible, right? for example, when upgrading project_release.module to 6.x, i'd certainly take advantage of this fact to finally have a sane solution for the /node/add/project-release problem, if only i knew about it. ;)
Comment #25
chx commentedDoc'd.
Comment #26
(not verified) commentedComment #27
summit commentedHi,
Is this patch committed. And does this mean that node/add contenttypes can be made unvisible on "create content" screen?
Greetings, Martijn
Comment #28
robertgarrigos commentedI ported this to drupal 5.x with a slightly different approach.