On the blog site template, I am trying to modify the Post content type so that it requires content in the body, a category to be chosen and the "Published" date to be hidden (they're "optional" by default). When I modify the content type, the site will not load any new posts.
-
could you please give more details, i.e include the screen shot etc.– Waqas Sarwar MVP ♦Commented May 19, 2014 at 18:43
-
Unfortunately there isnt much to show. If I simply create a site and use the Blog site template and click "create a post" it will pop up a form. Only one of those fields are "required". Once it's filled out, it automatically posts to the page. This is fine; however, when I go to change the OOTB Post content type to make the fields required then save it and create a new post, it no longer renders the post to the thread. For some reason, simply changing the content type columns to "required" affect whether or not the post renders on the page.– JackieCommented May 19, 2014 at 19:15
2 Answers
PublishedDate
field Required
property is set to True in Post
content type, from another hand it's value automatically initialized while a new Post is being created.
Setting PublishedDate
field property to Hidden
making it's value to be set to null and this is the reason why posts with PublishedDate=NULL
are not displayed in Blogs front page.
Hence you should consider another options for hiding PublishedDate
field from NewForm page, below is demonstrated how to hide PublishedDate
field row on the client-side:
function hidePublishedRow() {
var fieldPublishedControl = $('[id ^=PublishedDate_][id $=DateTimeFieldTopTable]');
var rowPublishedDate = fieldPublishedControl.closest('tr');
rowPublishedDate.hide();
}
Not sure why it's like this but I figured out that editing the content type in SP will cause an error and my post wouldnt render. However, if I do it in SP Designer, it works fine.
Update: I can modify all of the other fields on the post but modifying the published field to either "Hidden" will keep the post from posting.