Assign default content type to any library automactially when site get created or people add the library
we are on on premise environment, and we have a requirement that when people create a site or a sub site or even when they add a new document library , we want to ensure our custom content type is assigned as default content type to this library.
the question is that is there any non-full trust solution, i know we probably can do it via feature stapling, or custom site template stuff. but they are NOT considered as we want PLA compliance
Hi,
As I understand, you would like to asscoiate a custom content type to a library when the library is created.
With OOB option, you could try add this content type to an existing library, and save library as template. Then the library template should appear in Your Apps page, that is to say, users can directly create document library based on this template.
As I tested, new document library created based on this template contains custom content type by default.
With programatically methods, please refer to the similar threads below:
https://social.technet.microsoft.com/Forums/en-US/ec9e243b-ea4c-4a46-8780-75a3a5659164/mysite-add-content-type-to-document-library-by-default?forum=sharepointadminprevious
https://social.technet.microsoft.com/Forums/en-US/e58eb107-daa5-4a51-a139-dca2b1cf8591/set-default-content-type-for-document-libraries-on-a-custom-site-template?forum=sharepointdevelopmentprevious
Regards,Please
remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected] .
Rebecca Tu
TechNet Community Support
Similar Messages
-
Document Set default content type
When defining a document set, you can define what content types can be used in a document set. If, after uploading a document, the user cancels the properties page, the default content type for the library is assigned to the document (even though the
document set does not permit the content type). This is obviously a bug. There have been several posts on this and it appears 2013 has the bug as well as 2010.
We are seeking a work around to this bug.
Is it possible in in the client object model by placing a CEWP in the editform.aspx to force a content type on the item when the form is loaded?
The other option is to modifiy the url that opens EditForm.aspx to force the content type. Unfortunately the link that opens the EditForm.aspx page cannot be modified in the document library.Hi Clem_FRB,
I did a test in my environment and I reproduce this issue.
As a workaround, I suggest you change the content type or return an error in ItemAdded Event Receiver for document library.
Here is a similar thread for you reference:
http://sharepoint.stackexchange.com/questions/21986/document-sets-dont-enforce-allowed-content-types-when-multiple-doc-set-ct-are-a
More information for your reference:
http://www.niteenbadgujar.com/2013/05/change-default-content-type.html
https://social.technet.microsoft.com/Forums/en-US/281fa281-7071-4beb-b275-e3179ce2cc08/how-to-set-default-content-type-in-document-library-using-client-object-model?forum=sharepointdevelopmentprevious
Best Regards
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Zhengyu Guo
TechNet Community Support -
Powershell to add/delete content type to particular library alone in a site collection
Hi,
I am trying to add and delete content type from a particular picture library (site collection) using powershell.
I have tried the below, but it is not working.
Below scenarios are not working:
1) If the content type to be added is there in library, then the loop is still moving to "No content type exists".
2) Content type is not getting deleted from library
3) Set the newly added content type as default content type.
Below is the powershell, which I am trying:
function ChangeContentType($url)
$site = Get-SPSite($url);
$web =$site.RootWeb
$lookForList = "PicLibrary"
$lookForCT = "Img1ContentType"
$lookForRemoveCT = "Image2CT"
write-host "Checking site:"$web.Title
#Make sure content types are allowed on the list specified
$docLibrary = $web.Lists[$lookForList]
if ($docLibrary -ne $null)
$docLibrary.ContentTypesEnabled = $true
$docLibrary.Update()
if (($web.ContentTypes | where { $web.Name -eq $lookForCT }) -eq $null)
write-host "No content type exists with the name" $lookForCT "on list" $docLibrary.Title
#Add site content types to the list
write-host "Adding content type " $lookForCT "on list" $docLibrary.Title
$ctToAdd = $web.ContentTypes[$lookForCT]
$ct = $docLibrary.ContentTypes.Add($ctToAdd)
write-host "Content type" $ct.Name "added to list" $docLibrary.Title
$docLibrary.Update();
else
write-host "content type exists with the name" $lookForCT "on list" $docLibrary.Title
#Remove Content type
if (($web.ContentTypes | where { $web.Name -eq $lookForRemoveCT }) -eq $null)
write-host "No content type exists with the name" $lookForRemoveCT "on list" $docLibrary.Title
else
$ctToRemove = $web.ContentTypes[$lookForRemoveCT]
write-host "Removing content type" $ctToRemove.Name "from list" $docLibrary.Title
$docLibrary.ContentTypes.Delete($ctToRemove.Id)
$docLibrary.Update()
else
write-host "The list" $lookForList "does not exist in site" $web.Title
#Dispose object
$site.Dispose()
$web.Dispose()
How to fix this?
ThanksHi,
Thanks for the reply.
I checked it. If the script is run multiple times, the add and delete content type will throw error.
How to delete content type? I have tried the below:
$docLibrary = $web.Lists[$lookForList]
if ($docLibrary -ne $null)
$docLibrary.ContentTypesEnabled = $true
$docLibrary.Update()
#get the content Type
Write-host "Getting content type $lookForCT in site $web"
#Confirm that the content type exists.
$contentType = $web.ContentTypes | where {$web.ContentTypes.Name -eq $lookForCT}
##Abort if not found.
if ($contentType -eq $null)
Write-host "$lookForCT not found in site collection."
else
if ($web.ContentTypes.Name -eq $lookForCT)
Write-host $docLibrary.ContentTypes.Name
if($docLibrary.ContentTypes.Name -eq $lookForCT)
write-host "Content type $lookForCT is already added to list" $docLibrary.Title
else
write-host "No content type exists with the name" $lookForCT "on list" $docLibrary.Title
write-host "Adding Content Type"
$ctToAdd = $web.ContentTypes[$lookForCT]
$ct = $docLibrary.ContentTypes.Add($ctToAdd)
$docLibrary.Update()
write-host "Content type" $ct.Name "added to list" $docLibrary.Title
#get the content Type
Write-host "Getting content type $lookForRemoveCT in site $web"
#Confirm that the content type exists.
$contentType = $web.ContentTypes | where {$web.ContentTypes.Name -eq $lookForRemoveCT}
##Abort if not found.
if ($contentType -eq $null)
Write-host "$lookForRemoveCT not found in site collection."
else
if ($web.ContentTypes.Name -eq $lookForRemoveCT)
Write-host $docLibrary.ContentTypes.Name
if($docLibrary.ContentTypes.Name -eq $lookForRemoveCT)
write-host "Content type $lookForRemoveCT is added to list" $docLibrary.Title.
write-host "Removing Content type $lookForRemoveCT"
$ctToRemove = $web.ContentTypes[$lookForRemoveCT]
$docLibrary.ContentTypes.Delete($ctToRemove.Id)
$docLibrary.Update()
else
write-host "No content type exists with the name" $lookForRemoveCT "on list" $docLibrary.Title
I am getting error in delete now. Error is "Exception calling "Delete" with "1" argument(s): "Specified argument was out of the range of valid values.
Parameter name: id"
Thanks -
Hi,
How to make 'New Document' and 'Upload Document' to have same content type(Custom) in Document Library in Sharepoint2010.
Note : I have created custom Content Type since I have custom columns along with upload column..
Regards, Shreyas R Sgo to library settings
Change new button order and default content type
set your custom content type to be #1
when you upload new document it will automatically have your custom content type
Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010 -
Content Type name is not changing on site level
Hello
I have one new SP2010 site. I am changing the content type name using following script, but it is not working. I have not used content type in any list or library nor in any existing ite, I am not using content type hub. Can anyone why content name is not
updating?
$ParentContentType = $site.RootWeb.AvailableContentTypes["Data control1"]
if ($ParentContentType -eq $null)
write-host "not exist"
else
$web.$ParentContentType.Name="Data 123Control1"
$web.AllowUnsafeUpdates = $true;
$web.Update()
$web.AllowUnsafeUpdates = $false;Make the following change, hope this helps you
$site.RootWeb.AvailableContentTypes
to
$site.RootWeb.ContentTypes
Ashish Kanoongo, MCP, MCSD, MCTS http://akanoongo.blogspot.in/ -
When I type for example "Apple Store" I am getting something completely different, like the MBP is anticipating, any ideas, When I type for example "Apple Store" I am getting something completely different, like the MBP is anticipating, any ideas
what do you expect from this code out.print(lecture); ?
lecture is an Element, toString() is not implemented, so print correctly displays some fuzzy pointer information, nothing more... -
Assign roles automatically when user gets created
Hello,
I want to know if there is a way to assign basic roles to all the users in the system when they get created in the back end as well in the portal.
Thanks in advance.Hi Rahul,
There is no such way to assign automatically basic role to all users. You can go for tool sugested by Alex.
And also you can check one solution if this works for you that we have used in Past and proposed by business. In that if the Basic role is like end user role and needed for all portal users. Then you can create on Template users (Type dialog) . Then you can create the new users by copying the template user. -
Although my ipod shows the number of steps, calories, and time, it no longer is saving it to the history. Also when I open the history it takes me to May 2010 instead of the current date. Any ideas on how to get it to start recording the history again?
Try:
- iOS: Not responding or does not turn on
- Also try DFU mode after try recovery mode
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
- If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
- Try another cable
- Try on another computer
- If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
Apple Retail Store - Genius Bar
The missing apps could have been done by setting the Restrictions that can hid those apps. If the backup was made with those retrictions set the the Restrictions are also restored.
Thus, if you get it to work restore to factory settings/new iPod, not from backup
You can redownload most iTunes purchases by:
Downloading past purchases from the App Store, iBookstore, and iTunes Store -
Is there any difference from when you buy software or you purchase the app from the app store?
I would like to buy Final Draft, but I'm not sure if I should buy it from the app store or go to their website and get it shipped to me. Is there any diference? Do you get more if you have the software shipped?
Thank you!Use the email form to report the issue to Apple > Apple - Support - iTunes Store - Contact Us
-
How to assign permissions to choice values when using content types in a library
Hi,
I just now started using content types in document libraries instead of folder structure. The structure I was given is as follows:
Master group (library name)
L.A.
South Street
Number 1
Number 2
North Street
Number 1
Number 2
Boston
West Street
Number 1
Number 2
East street
Number 1
Number 2
India
North Street
Number 1
Number 2
West Street
Number 1
Number 2
So, I created a Content Type called Areas (which included LA, Boston, and India) and I created choice field values for each columns (South street and North street). Then, I gave the choice values as Number 1 and Number 2.
Now, the complexity was in terms of permission levels, wherein the client was accustomed to using folder structure. And hence, they had given a set to users to have access only to Number 1 of West street of Boston. Now that I have the content
type structure in place, how do I configure the granular permission for the 3rd level of the hierarchy?
Shonilchi..Thanks for your post. I had already done this via Windows Explorer, and it works for all of the My Docs files
but not Acrobat files, which still come up in List View. I am running Windows XP still, is that a factor? -
OSB defaulting Content-Type to "multipart/related" in case of attachments
I have scenario where I need to invoke a REST Webservice from OSB which accepts only media types which has "multipart/atom+xml". OSB is used for protocol transformation converting the SOAP request into the HTTP POST request with multipart. I have Proxy Service which will unwrap the message from the SOAP Body and post the same message into the payload of the Business Service and the attachment is passed 'as is' from the SOAP Service. The external REST Service Provider expects the media type to be "multipart/atom+xml", but in OSB when an attachment is present in the message, OSB is overrding the "Content-Type" proeprty to "multipart/related" inspite of me setting the "Content-Type" property of HTTP Transport Header in OSB and as result external RESTFUL Service is throwing "415-Unsupported Media Type" error. Below is the test results. One interesting thing is, it happens only when there is attachment present in the message. In case of a message which doesn't have attachment any "Content-Type" specified in the Transport Header is passed by the OSB to the external service. Any help is highly appreciated.
OSB Transport Header
Added the header <http:Content-Type>multipart/atom+xml</http:Content-Type>
Actual Raw Message
POST http://xxx7200:7004/XXXInterfaces/identify HTTP/1.1
Content-Type: multipart/related; type="text/plain"; start="<Root_-328322390>"; boundary=MIME_Boundary; charset=UTF-8
MIME-Version: 1.0
User-Agent: Java1.6.0_17
Host: xxx7200:7004
Accept: text/html, image/gif, image/jpeg, */*; q=.2
Proxy-Connection: Keep-Alive
Content-Length: 4823
Expected Raw Message
POST http://xxx7200:7004/XXXInterfaces/identify HTTP/1.1
Content-Type: multipart/atom+xml; boundary=MIME_Boundary;
User-Agent: Java1.6.0_17
Host: xxx7200:7004
Accept: text/html, image/gif, image/jpeg, */*; q=.2
Proxy-Connection: Keep-Alive
Content-Length: 4803
-KC
Edited by: 799459 on Apr 8, 2011 5:36 AM
Edited by: 799459 on Apr 8, 2011 7:02 AM
Edited by: 799459 on Apr 8, 2011 7:13 AM
Edited by: 799459 on Apr 8, 2011 7:14 AMHTTP content-type header has the following limitation as per osb doc.
Oracle Service Bus run time may overwrite these headers in the binding layer when preparing the message for dispatch. If these headers are modified, $inbound and $outbound are updated accordingly. So what you are seeing may be working as designed. Cant the remote service accept the multi part related content type set up by osb ? -
Assigning External content type field column value using Client Object Model
I have a problem assinging External column value to ListItem object with client object model-based application I'm developing. To be precise, I am able to retrieve data related to external content type by reading external list created from this content type
but I don't know how to properly use it to assign value to this field. By doing some research on my own I concluded that BDC ID column from external list is the way to go since it uniquely defines selected row from external list but that doesn't
tell me much since I don't know what to do with it. Currently I ended up with partial solution - to assign plain string value of picker column but that makes this value visible only in "View Properties" option on Sharepoint and not in "Edit Properties"
which pritty much makes sence since it isn't properly related to rest of the data in specific row. Does someone have a better solution for this?
Igor S.I think I understand your problem.
In my example I have an external data column "Beneficiary Name", using a Beneficiary external content type (accessing a table of beneficiaries in a SQL table).
I want to set the "Beneficiary Name" property using the client object model. I know the name of the beneficiary but not the ID value.
It is a fairly simple solution. You just need to identify the name of the property SharePoint assigns to the ID field, in my case it is called "Beneficiary_ID". Then set the two properties as follows:
thisItem["Beneficiary_Name"] = "Charitable Trust";
thisItem["Beneficiary_ID"] = -1;
thisItem.Update();
Setting the ID property to -1 causes the server to do an automatic lookup for the ID from the value assigned to the item. -
How can I change the default Applications content type, currently it point to Adobe Acrobat 7.0 the correct content type should be Adobe Acrobat Document.
See the [[managing file types]] article, in particular the section on changing download actions. You may need to select "Use other" and browse to the application if it is not listed as one of the default options.
-
Max number of content types per list/library
What is the maximum number of content types for a list or library?
I read a thread on this forum where they talk about a maximum of 2000 content types per library for SP 2013:
http://social.msdn.microsoft.com/Forums/en-US/c53df140-8ed6-4438-8a49-95cdc6ac5fd5/number-of-content-types-per-library?forum=sharepointgeneral
Is this also true for lists in SP 2010?
Thanks for your help!
ThorstenHello Thorsten,
I don't see a hard limit in the capacity management article on Technet:
http://technet.microsoft.com/en-us/library/cc262787(v=office.14).aspx#ListLibrary
But I do see limits to number of columns, which of course has a correlation to content types.
- Dennis | Netherlands | Blog |
Twitter -
I know this is a bit of a strange question, but i have seen people using the smileys on face book, but every time i try to get them they dont work, i was just wondering if any one knew how, i thought i would put it on here as i have got a lot of helpful tips on here for alot of problems and you guys know what you are talking about,,,
not 100% sure what you mean
smileys are a sequence of chars like ;-¶ which the internet site or program like a chat program replace with an image typically a small gif image
is your problem that you want to save those images to your harddisk?
is your problem that you wish some other program then facebook to replace the smiley chars with the images that facebook use?
is your problem that when you type on facebook your smileys are not replaced with the same images as others (in which case you should prob as which signs they type)
Maybe you are looking for
-
Hi everyone I am really sad about Apple's iOS 7, which I am really angry about some bugs. I'm using iOS 7.0.4 on my iPhone 5S 64 GB, and I had 2 big issues: 1- When I go to Voice Memos, it takes about 10 seconds to load, and when it loads, when you t
-
Caseid 4670247907 worst customer support ever seen
caseid 4670247907 today was 15 day of my camplain log i have been provided with replacenet of defective part 2 times but both them self required replacement. this is the worst service support i have seen
-
How to set up multiple email accounts?
I need to set up additional email accounts on my iphone and can't figure out how to do that. I set up an AOL account but want to add one from my personal website. All it show is my AOL account and doesn't give me an option to add another email addr
-
My 10 year old son has a ton of photos on his ipod that I cannot risk losing (they are of our pet bunny that recently died). Help? I cannot update his ipod software either. I got all the way to the last part of the process and "Unknown error" (6) pop
-
Hi, i have a BB Pearl 8120 and it has a problem! I can send BB messages, but i can't receive them if I don't have wifi connection! (but i do send without wifi connection) Sometimes I can connect with internet (browser icon) sometimes I can't I alread