New user here, but have searched docs and forums for the last 2 hours and still can't find the answer to this. In the administer>menus section, there is no option to disable create content...just enable and reset are available options. There is no need for visitors to see this option since I only allow admins to post content. However, logged in as admin or not logged in at all, "create content" comes up in the menu. I either want to make it come up only when an admin is logged in (like the "administer" link) or not come up at all and just point the browser to the node/add URL directly. This would be very inefficient, but I would settle for that if I had to.
Also, how do I create links directly to the categories from the menu on the left? The only reference I see to the categories is the link at the end of every article.
Any help will be greatly appreciated. Thanks.
Comments
Visitors do not see that
Just logout as admin and you will see the 'create content' link is disappeared. Your visitors will not see that unless they login as admin.
Unfortunately drupal does not come (anymore) with a separated backend and frontend structure. If you really like this feature, search the forum for some work-arounds -- it is possible to make 2 virtual hosts one for frontend and one for backend, then you need to specify what to include in each side.
Alternatively, you may want to write to the drupal developers to think of something about this problem. I am sure this 'mixed administration' scares a lot of newbies to leave the cms before trying it.
Might not exactly be what he is looking for...
Greetings,
He did say that "create content" still shows up when not logged in. There are many viable and sophisticated solutions to this little 'quirk', the majority of them involve programmatically (sp?) customising block display.
I have a quick-and-very-dirty workaround (although this impies that authenticated users have access rights to the system module):
1. While logged in as admin, go to 'administer->access control-> 'permissions', under 'system module', tick off the 'access administration pages' checkbox for anon users
2. Go to administer->menus, enable the 'content' menu item and move it to be the child of the 'administer' menu item.
3. Back at the menus list, disable the 'content' menu item. That's all.
Normally, the 'create content' should now be visible only to logged-in users.
Like I said before, this is a quick workaround to newbies like myself to hide the 'create cotent' menu from anonymous users. Once you become more saavy with Drupal, you can find much better solutions in the handbooks section of this site.
Thanks for the replies.
Thanks for the replies. giao.dinh's solution is very close to what I'm looking for. It looked like it was going to work at first, but when I logged off, the "create content" link came back up on the menu. This is driving me nuts.
the 'content' menu now appears twice
i got the same result as besheer (ie doesn't work, bug still present) and the 'content' menu is now duplicated in administer > menus.
Under administer>menus,
If Under administer>menus, disable "Content" & "Create content", but leave the sub-menu items enabled.
I found this idea at http://drupal.org/node/13887 .
There is no option to
There is no option to disable create content in my admin panel. Just enable and reset are there.
Just figured it out. Using a
Just figured it out. Using a combination of these suggested solutions, I took out the sub-links (story, page, poll) and put them on the root. Then I reset the create content menu since I don't have the disable option. Somehow, this fixed it. Now admins have the three subs on the root and create content is under content, which I have disabled. When logged out, create content does not appear anywhere. Thanks again.
Bonus Points for you man -
Bonus Points for you man - I've been searching all over for this!
thanks besheer! that
thanks besheer! that worked
stated more simply, what worked for me was: just click "reset" on "create content"
def. a small bug.
Worked!
Yup, just reset "create content" (I had "content" already disabled) worked for me as well.
I Also know how to replicate this: just tick "always expanded" for "create content". Now it shows up again, but when you un-tick, it'll still do, until you reset "create content" again.
---
www.sothisisme.nl - (not drupal yet...but will be :)
Exactly. Just don't keep it expanded.
None of the other solutions offered above are necessary, except just sothisisme's. You don't have to move you the menu item or its submenus, as suggested above. At least I didn't have to on the three 4.7 sites I just tested this on.
All you have to do, is just RESET "create content" menu item in admin>menus. That's all. If you click edit and make it expanded, it will reappear again for anon users. You have to keep it not expanded, which is of course pain for administrators who want quick access to the sublinks of create content.
But what a timeconsuming pain in the neck it was to figure it out. I hate how a SEEMINGLY little thing like this just sucks out so much time but you can't leave it be because CREATE CONTENT for anon users just doesn't make sense in so many sites.
Drupal people say this is not a bug. I totally disagree. Call it a quark, an issue, something. It is a problem for the web designer.
It basically prohibits you from having a design that offers no sidebars to anon users (the super clean design)--until you find this thread and realize that its expanded option that has to be turned off. I wish there was a way to create a handbook to document the really irritating quarks like this one.
i agree that this is a bug
I kindof posted about it here, but nobody has responded (probably because its confusing even for me). I think the bug is that the MENU_VISIBLE_IF_HAS_CHILD call doesn't care whether or not there are any visible children. And, at least for my brain, it should make all the difference.
Thanks, it works
I´ve been searching the forum for day´s till I found this tread. The extra one click is not a high price to pay for fixing this so easily.
Still confused...
Oh my God, I am a newbie and it's so confusing to me!
I tried what has been discussed without success.
Under "menus" in the admin it says:
Menu item Expanded Operation
content (disabled) No enable
- create content No edit
How do I accomplish, that there is no link for anos that reads "Navigation" and underneath:"content".
That's what it currently says.
Phew...
Any help very much appreciated.
Thanks guys!
Dada
For anyone running into this
For anyone running into this problem in Drupal 5, use the technique that Besheer pointed out.
The "don't expand the menu" tip discussed above may work on 4.7, but it doesn't seem to on 5.x
Another solution
Another solution, is to put in the navigation bloc with this option in the "show only if this php code is true"
If the user is log-in, the navigation bloc will show.
Alexandre Racine
www.gardienvirtuel.com Sécurité informatique, conformité, consultation, etc
www.salsamontreal.com La référence salsa à Montréal
and...
more here...
http://drupal.org/node/61874
Alexandre Racine
www.gardienvirtuel.com Sécurité informatique, conformité, consultation, etc
www.salsamontreal.com La référence salsa à Montréal
Create content showing for visitors
I was having the same problem with version 7.4.5.
Just clicking reset on create content in admin/menu fixed it with no other changes.
advanced_menu.module solves this!
yo, so I've encountered this problem recently.
which was cured after installing the advanced_menu module, I noticed that you can do the following:
Select the menu item you want to disable, ie. "create content".
>>go to advanced options
>>check off "Visible in tree views"
Defines whether the menu item should be visible in tree views. (Affects the enabled/disabled option directly)
Realize this is an old thread, but figured newbies like myself would benefit from this tip/module.
peace.
This has been raised as a bug
I can see what causes the problem with "create content" appearing for visitors who are not logged in. If you make any change to the settings of a menu item, the flags on the item (database column "type" in the table "menu") get set to make the item visible. This makes sense at first thought, because if a user is changing a setting then they obviously want to see the menu item. The name of the flag bit in the code is MENU_VISIBLE_IN_TREE. But the "create content" menu item has a special flag MENU_VISIBLE_IF_HAS_CHILDREN set, which makes it appear only if any of its children are visible to the current user. If you set MENU_VISIBLE_IN_TREE as well, then it appears for all users, ie when you are not logged in.
This a bug in menu.module. See http://drupal.org/node/58806.
Some workrounds are to reset the "create content" menu item, and the other suggestions above.
If you actually want to modify the properties on the "create content" menu item, a workround is to unset the MENU_VISIBLE_IN_TREE flag by modifying the database table manually (I used phpMyAdmin). The MENU_VISIBLE_IN_TREE flag has value 2, so you have to subtract 2 from the type column -- mine was 62 so I changed it to 60.
I should add that the reason I changed the "create content" menu item in the first place is that I was trying to change the position of this item in the menu by changing its weight. But actually its position is determined by its invisible parent (4, 1, 'node', 'content', '', 0, 16). So in the end I put "create content" back to its original values, and changed the parent's weight, by setting it directly in the table (4, 1, 'node', 'content', '', 8, 48) to avoid the bug mentioned above. You have to add 32 to the type (MENU_MODIFIED_BY_ADMIN flag) to make the database entry override the default.
Charles
Use an extra block
Here is what I did to get rid of any item in the menu at the front end. I created a new block "Editor". Then I configured it so that this block will only be visible on the backend with the setting "Show only on listed pages" and the pathes (each on a new line) "admin/*", "admin", "node/add/*", "node/add" and so on . I moved "Create Content" and other menu items I don't want at the front end to this new menu. Seems to work fine. You can style this menu with CSS.
Mazso
Removing the 'create content' completely for anonymous users
If you only want the site administrator to have access to the 'create content' link, you can look inside the node.module, and do a search for 'create content'. You will quickly find a section that looks like:
Which you can change to
Technically speaking, I suppose you could hack the node.module a bit more and create a way to allow any specified user roles to have access to the 'create content' menu item. You would search for 'function node_perm ()' and add an item (like 'create content') to the array beneath that line, then change 'adminster nodes' to the exact same wording you added to the array. You would then have to configure the access rules for each role in the access control section of your administrative menu.
Hide the "create content" link for everyone but administrators
I'm reposting the comment that's above mine, but with a different title so it'll show up in a search. I've spent two hours looking for the answer that Dwees gave. I only wanted the "content" and the "create content" links to be visible to administrators. I was quite surprised to find that you actually have to edit the php inside a core Drupal module to achieve this feat. The ability to hide the "content" and "create content" links from everyone but the admin is just what I need. Only show the "content" and "create content" links to admins or administrators.
BEGIN COPIED POST
*********************************
If you only want the site administrator to have access to the 'create content' link, you can look inside the node.module, and do a search for 'create content'. You will quickly find a section that looks like:
Which you can change to
*********************************
END COPIED POST
Thanks for this code snippet, dwees!
****
Joel "Senpai" Farris | certified to rock score
Are other permissions...
...still allowed to create content using custom links you insert if you do this?
Thanks for posting BTW.
To disable create content item for all users
One way to do it, is to delete:
$items[] = array('path' => 'node/add', 'title' => t('create content'),
'callback' => 'node_page',
'access' => user_access('access content'),
'type' => MENU_ITEM_GROUPING,
'weight' => 1);
from node.module
Obviously, this solves the problem from the root, but should only be used by someone comfortable with php programming, debugging (if necessary), and upgrade headaches.
So far, this works perfectly for us, but the create option link never shows up.
What I have done is to create a menu item (Create a...) without any link, and made the "page", "story," etc, options as children of "Create a..."
Thanks!!!
That was driving me nuts...
I replaced code as mentioned but found other error
Thanks to debug this problem providing required changes in code. I have done it but found following other error,
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
public_html/modules/node/node.module on line 1845
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in public_html/modules/node/node.module on line 1845
I have configured Durpal 5.1 just few days ago. Earlier I have no experiece in any CMS and PHP.
Please help me.
Thanks
Hide the "create content" link for everyone but administrators
Wouldn't it be easier to just disable the content and create content items in admin/menu? As an administrator you can always enable them to post and then disable them again. That way you are not messing with the code.
could you maybe give more details?
I'd like to specify another type of user to be able to create content, but still have the "create content" item hiden from most users.
I changed my code to allow only administrator, but then realized i needed another set of permisions for another user that needs only the ablility to add stories and book pages... but now i changed node.module back to its original code, and it still is only accessible to admin.
More details
Go to /admin/access/roles and add your new user role.
Go back to /admin/access and click on the heading for that new role.
Check all of the boxes that you want that role to be able to do and save.
If you check book and page but not story then only book and page will show in create content.
Go to /admin/menu and if reset is an option for create content click on that.
Create content will only show for those roles that you have given permission to create something.
Every time you change permissions go and check if reset is an option for create content and click it if it is there.
Here's how I solved it...
I removed create content from the navigation menu. I created a new menu called Add Content and put create content and the content types under it. I put this menu in a new block that is only visible to the user types I specified. This worked well, and has the added value of making the add content menu items more visible to the appropriate users.
Thanks
Thank you very much the above posters worked great for me on drupal 5
Thx for the Block idea
... i think this is the most elegant solution if you want to keep able of a 3rd user role to create submissions. and usability wise it also is not bad, to separate content from navigation. good idea, thx!
That's exactly how I do it now.
This is exactly how I now do all of my drupal sites, and in addition to being very flexible and working well with the Drupal Way, it has the added benefit of maintaining a stock drupal core. Thou shalt not hack core, lest thy RAM be sacrificed on the alter of upgradability, or something like that.
[/Senpai]
****
Joel "Senpai" Farris | certified to rock score
Different kind of hack
Often menus under 'Navigation' are only useful by the 'admin' user.
I you dont' want any of the child menus appearing for a 'regular' user, add some custom php code for 'Navigation' block as follows:
go here: admin/build/block, click 'Configure' in the Navigation row,
look for this section: "Show block on specific pages:", and add this code:
Also select "Show if the following PHP code returns TRUE (PHP-mode, experts only)."
This works fine for me and i don't have to worry about menus like 'create content' in the visitor's pages
Tried the reset one and it Works
I have removed every sub link and press reset. It automatically disable create content.
nice. This is one thing I miss about joomla. Although hacking around with Drupal is rather fun.
Ideapreneur.net - Hot Business Ideas
Tried the reset one and it Works
BTW the one above I used it for drupal 5.1
Going to try playing around with the code. BTW is there a good menu module that is like Joomla?
Ideapreneur.net - Hot Business Ideas
My way around this problem: Define new parent for "Content"
Hi all,
I have been fighting with this same problem, unwanted appearance of "Create Content" in Menu Navigation.
What did the trick for me was quite simple:
I just enabled the "Content" menu tab, then moved the whole "Content" Menu (automatically including its Submenus "Create Content" etc.) to the new Parent "Administrator".
Now, it only apprears for the Admin.
Hope this will work for someone else as well
Cheers
Tysk
Use Menu Per Role
I have got over this issue by using Menu Per Role module, so I can restrict the "Create Content" link to show for just authorized users, in the admin/menu.
Menu Per Role is here - http://drupal.org/project/menu_per_role
on the downside, you have to modify menu.inc to get it to work, just add some code. As I upgraded from 5.1 to 5.5, I couldn't figure this out, until i stumbled upon the menu per role project page page and realized/remembered I would have to re-patch this file to get my "create content" hidden like before.