{"id":1053,"date":"2011-03-25T11:05:36","date_gmt":"2011-03-25T16:05:36","guid":{"rendered":"http:\/\/blogs.devhorizon.com\/reza\/?p=1053"},"modified":"2012-03-02T17:45:02","modified_gmt":"2012-03-02T22:45:02","slug":"adding-a-content-type-to-a-hub-using-a-feature","status":"publish","type":"post","link":"https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/","title":{"rendered":"Adding a Content Type to a Hub Using a Feature"},"content":{"rendered":"<p>The more I work with content types , the more I like to do everything programmatically rather than declaratively using features. Here is a funny thing that may make you scratch your head for a while:<\/p>\n<ol>\n<li>Create a feature that adds a content type to a content type hub.<\/li>\n<li>Publish the content type in the hub.<\/li>\n<li>Let the publishing\/subscribe timer jobs run (every hour or so) or manually execute them through Central Admin site.<\/li>\n<li>In a subscribe site collection, check the content type publishing error log.<\/li>\n<\/ol>\n<p>It errors out saying that you need to install the feature on the subscriber site collection. Although, you don&#8217;t need to activate the feature on the target subscriber , I still think the dependency on feature installation on the subscriber site collection is somehow odd!<\/p>\n<p>Whether this is by design or just a bug , I don&#8217;t know, but here is the resolution :<\/p>\n<p><strong>Resolution:<\/strong> Add the content type to the hub either through the browser, PowerShell or use a console application for what that matters!Using features to add content types is really not worth the headache.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The more I work with content types , the more I like to do everything programmatically rather than declaratively using features. Here is a funny thing that may make you scratch your head for a while: Create a feature that adds a content type to a content type hub. Publish the content type in the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-1053","post","type-post","status-publish","format-standard","hentry","category-sharepoint-2010"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Adding a Content Type to a Hub Using a Feature - Reza Alirezaei&#039;s Blog %<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reza Alirezaei\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2011\\\/03\\\/25\\\/adding-a-content-type-to-a-hub-using-a-feature\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2011\\\/03\\\/25\\\/adding-a-content-type-to-a-hub-using-a-feature\\\/\"},\"author\":{\"name\":\"Reza Alirezaei\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"headline\":\"Adding a Content Type to a Hub Using a Feature\",\"datePublished\":\"2011-03-25T16:05:36+00:00\",\"dateModified\":\"2012-03-02T22:45:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2011\\\/03\\\/25\\\/adding-a-content-type-to-a-hub-using-a-feature\\\/\"},\"wordCount\":193,\"commentCount\":2,\"articleSection\":[\"SharePoint 2010\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2011\\\/03\\\/25\\\/adding-a-content-type-to-a-hub-using-a-feature\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2011\\\/03\\\/25\\\/adding-a-content-type-to-a-hub-using-a-feature\\\/\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2011\\\/03\\\/25\\\/adding-a-content-type-to-a-hub-using-a-feature\\\/\",\"name\":\"Adding a Content Type to a Hub Using a Feature - Reza Alirezaei's Blog %\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\"},\"datePublished\":\"2011-03-25T16:05:36+00:00\",\"dateModified\":\"2012-03-02T22:45:02+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2011\\\/03\\\/25\\\/adding-a-content-type-to-a-hub-using-a-feature\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/\",\"name\":\"Reza Alirezaei's Blog\",\"description\":\"Blogging from the field!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\",\"name\":\"Reza Alirezaei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"caption\":\"Reza Alirezaei\"},\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/author\\\/rezaa\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adding a Content Type to a Hub Using a Feature - Reza Alirezaei's Blog %","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/","twitter_misc":{"Written by":"Reza Alirezaei","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/#article","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/"},"author":{"name":"Reza Alirezaei","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"headline":"Adding a Content Type to a Hub Using a Feature","datePublished":"2011-03-25T16:05:36+00:00","dateModified":"2012-03-02T22:45:02+00:00","mainEntityOfPage":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/"},"wordCount":193,"commentCount":2,"articleSection":["SharePoint 2010"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/","url":"https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/","name":"Adding a Content Type to a Hub Using a Feature - Reza Alirezaei's Blog %","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#website"},"datePublished":"2011-03-25T16:05:36+00:00","dateModified":"2012-03-02T22:45:02+00:00","author":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blogs.devhorizon.com\/reza\/2011\/03\/25\/adding-a-content-type-to-a-hub-using-a-feature\/"]}]},{"@type":"WebSite","@id":"https:\/\/blogs.devhorizon.com\/reza\/#website","url":"https:\/\/blogs.devhorizon.com\/reza\/","name":"Reza Alirezaei's Blog","description":"Blogging from the field!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blogs.devhorizon.com\/reza\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938","name":"Reza Alirezaei","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","caption":"Reza Alirezaei"},"url":"https:\/\/blogs.devhorizon.com\/reza\/author\/rezaa\/"}]}},"_links":{"self":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/1053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/comments?post=1053"}],"version-history":[{"count":1,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/1053\/revisions"}],"predecessor-version":[{"id":1198,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/1053\/revisions\/1198"}],"wp:attachment":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/media?parent=1053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/categories?post=1053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/tags?post=1053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}