Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've gotten pretty good at editing OOB XSLT List View parts, but there's one section I'm not really sure how to edit. In my blog, I enabled comments. However, I think the default "Add Comment" web part is super-ugly. I tried removing to make a new one with a data form, but removing it seemed to kill the existing comments. So I suppose my question is, how do I style (and edit to remove an additional field I don't want) the part shown on the attached image below:

enter image description here

Thanks for any/all help.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

I haven't had any major issue to style the OOTB "Add Comments" WebPart, it's almost like styling any other built-in NewForm/EditForm WebPart.

So you need to provide more info what exactly you want to style/change via CSS (or JavaScript).

As for hiding a field: you could use PowerShell to set the field to hidden completely or hide it only on the NewForm/EditForm/DispForm pages. Check the SharePoint object model for the SPField properties hidden, ShowInNewForm, ShowInEditForm and ShowInDispForm for more info.

UPDATE: To hide a field on the Blog post "Add Comments" form you could also use jQuery or plain JavaScript if you don't want to/can't use PowerShell locally on your SharePoint server.

UPDATE 2: To style text of the OOTB "Add Comments" WebPart on a Blog post page you could use Firefox with Firebug or Internet Explorer with the IE Developer tools (just hit F12) to locate the HTML element you want to apply your custom style. No SharePoint Designer (SPD) required at all.

UPDATE 3: Don't get me wrong on this. SharePoint Designer (SPD) is a great tool for a lot of tasks, but you need to know where its limitations are. To me SPD has been a great help of understanding SharePoint better and I occasionally use it for some light tasks but I tend to stay away from it for many things like XSL, CSS or masterpage editing because the SPD code editor is the worst I've ever seen (and almost remained ugly and unchanged since FrontPage 2003 about 10 years ago) and it has been crashing (and loosing unsaved work) more than once.

Whenever possible for light tasks or quick demos I resort to CSS & JavaScript and inject it into SharePoint using a Content Editor WP linking to my custom CSS/script file and edit those files with Notepad++ (which is not only faster than SPD but also offers a superior code editor).

PS: I personally tend to always stick to the OOTB "Add Comments" WebPart because customizing Blog stuff can easily break internal things as you already discovered yourself.

share|improve this answer
    
So if I understand correctly, it's just pulling it from NewComment.aspx? I'm in there now, but the HTML is all blocked out -- do you know how to edit it? –  EHorodyski Mar 5 '12 at 20:05
    
Perhaps I want to create a new New Form .aspx page, but then how would I attach that to Post.aspx? –  EHorodyski Mar 5 '12 at 20:13
    
You don't need to touch NewComment.aspx as it is an internal page not used when a user wants to add a comment to an existing post, you also don't need to create a new aspx page. Please update your original post with more details hat you want to style and check the MSDN documentation on the SharePoint object model and PowerShell how to mark fields hidden. –  Sig Weber Mar 5 '12 at 20:41
    
It sounds like you are trying to use SharePoint Designer (SPD) to customize your blog. My general advise is to stay away from SPD for such tasks like changing Blog pages and WebParts and use it only for masterpage, CSS and JavaScript related modifications. Everything going beyond those tasks you'd better moving to C# and custom coding in Visual Studio. But again, it really depends on what exactly you want to accomplish beside of hiding a field. –  Sig Weber Mar 5 '12 at 20:49
1  
The biult-in SharePoint input forms don't use XSL but rather are implemented as server-side ASCX WebControl rendering templates, living in the ControlTemplate folder on the server. Changing them is possible but requires at least ASP.NET knowledge and advanced SharePoint knowledge if you want to change them globally for all Blogs on your SharePoint farm. Modifying them with SPD (by converting to XSL) can have a gazillion of unwanted side-effects hence I personally don't recommend doing so. But others might have a different point of view... –  Sig Weber Mar 5 '12 at 21:23
show 9 more comments

To keep some clutter away and resolve my own issue, I solved this by adding a DataFormWebPart and hid the default New Comment part. It's very simple to style and worked great. To automatically populate the Post Title field I needed (which links the comment to the post) I just used a Query parameter. This link: http://geekswithblogs.net/SoYouKnow/archive/2009/10/29/setting-sharepoint-form-fields-using-query-string-variables-without-using.aspx helped me comprehend what I needed to do.

Thanks again to Sig Weber for all his help.

share|improve this answer
    
Glad to hear you got it sorted out! And just to give you an idea how a customization without SPD could look like, check this out: i.imgur.com/fOixf.png –  Sig Weber Mar 7 '12 at 1:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.