{"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"],"_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}]}}