Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 742779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:47:13+00:00 2026-05-14T08:47:13+00:00

I am developing a website in Sharepoint 2007. I came across a bit tricky

  • 0

I am developing a website in Sharepoint 2007. I came across a bit tricky problem. I have a document library web part in a web part page. I am using the summary toolbar view. I dont want users to add new documents on first screeen where it shows folders. I want them to open the folders and add documents there. I cannot do a No toolbar view because it will remove the link from every subsequent page. Has anyone implemented something like this. Please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:47:13+00:00Added an answer on May 14, 2026 at 8:47 am

    Event receiver to prevent adding item throught object model/web services or UI.

    One solution would be to use event receiver and, if document is being added in root folder, just cancel adding document, but that would transfer user to error page. This solution is not user friendly.

    Just hide the option to add new items

    The other one would be to use javascript to hide new button document and upload document buttons. It’s easy when you integrate SharePoint with jQuery.

    Hide New Button

    var newMenu = $('a[id$=NewMenu]').parents('.ms-toolbar') //Hides New button
    if (newMenu[0] && newMenu[0].nextElementSibling.className == 'ms-separator')
      newMenu[0].nextElementSibling.style["display"] = "block" //Hides seperator between new button and next button.
    

    But you probably would not like to completely hide the new button, but to leave creating new folder option.

    $('ie\\:menuitem[id*=New]').not('[id$=NewFolder]').remove()
    

    Hide Upload Menu

    var uploadMenu= $('a[id$=UploadMenu]').parents('.ms-toolbar') //Hides New button
    if (newMenu[0] && newMenu[0].nextElementSibling.className == 'ms-separator')
      uploadMenu[0].nextElementSibling.style["display"] = "block" //Hides seperator between new button and next button.
    

    Ahh, forgot the (al)most important: check if you are on the RootDirectory.

    var rootFolder = $.url.decode(getParameterByName("RootFolder"))
    if (rootFolder && ctx && rootFolder.replace($.url.decode(ctx.listUrlDir+"/"),"").length == 0 ) {
      ..Do code above..
    }
    
    • Link for $.url.decode
    • Link for getParameterByName
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a website with codeignite . I have problem with submiting forms
I'm developing a website. I'm using a single-page web-app style, so all of the
I'm developing a website for a client of ours and have been having a
I'm developing this website: http://parkoura.tk/a/sandbox/ I am using an ajax navigation. I have a
I'm developing a website, and part of the content will be a live 'departures
I am developing a website that requires several user types. I have been able
I'm developing a solution for SharePoint 2007, and I'm using SPSecurity.RunWithElevatedPrivileges a lot, passing
I am developing a website were I will have pages with videos on them.
I am developing a website that has two back to back web broadcasts. I
I'm developing a website (using asp.net by the way) and I'm having a problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.