Search This Blog

Tuesday, 6 August 2013

Add Feature to Disable or Enable New Folder

Client want to be able to Enable or Disable a New Folder for a complete site.

You need to create a future for this.

Go to :
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES

Create a Folder, i used "DisableNewFolderButton"

Create a file called "Feature.xml" and add the following to it:

<?xml version="1.0" encoding="utf-8" ?>

<Feature Id="33057CD9-6D14-45c9-83ED-5E1FE066AC92"

Title="Disable New Folder Button"

Description="Disable New Folder Button"





 <ElementManifest Location="Manifest.xml"/>



Create a "Manifest.xml" and add the following to it:
<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="">



      Location="CommandUI.Ribbon" RegistrationId="0x0101"





          Location="Ribbon.Documents.New.NewFolder" />





Now you need to install the feature:
stsadm -o Installfeature -name DisableNewFolderButton

Now you need to activate it

stsadm -o activatefeature -name DisableNewFolderButton -Url

Now run a IISReset and you will have this feature under your "Manage Site Features"
(Yes it is small but you get the idea)
 So enable it and then your site's Libraries will automatically be set to not show "New Folder"

Note: At one point i got the following error: 

Feature with Id '33057cd9-6d14-45c9-83ed-5e1fe066ac92' is not installed in this farm, and cannot be added to this scope.

Turned out i was trying to run the activate feature before i ran the install  feature command as above.

Ok, now 


No comments:

Post a Comment