Formatting Blog Comments

Topics: Writing themes
Jul 18, 2013 at 5:33 PM
Last question for awhile, I promise. Again, I've been digging around, and I'm about 4 hours deep on this, and I just don't quite understand it.

I'm finally getting the hang of placement, and I'm starting to figure it out, however, when I'm trying to format comments, I can't seem to separate any of it! For some reason when using the Developer tool, it gives me the names of the sections (i.e. CommentAuthor, CommentMetadata), but I want to place the time below the comment text. However, there doesn't appear to be a way to do this using just placement, everytime I try to reference one of the Parts, it does absolutely nothing, even if I just place it in the root <Placement>here</Placement> area. Am I missing something?
Coordinator
Jul 19, 2013 at 12:58 AM
The list of comments is displayed as a List shape, so there shouldn't be anything too special about this. What did you try?
Jul 19, 2013 at 4:17 AM
I basically tried something along the lines of <Place CommentAuthor="Header:1" CommentMetadata="Footer:1"/>
Developer
Jul 19, 2013 at 3:59 PM
CommentAuthor and CommentMetadata, are those shapes?
Jul 20, 2013 at 2:14 AM
If you click on them inside the Developer tool, they show that they are a shape.
Jul 21, 2013 at 2:25 AM
Random observation, built into Orchard is a file called ListOfComments.cshtml. Why can't I override that inside my theme? Any reason? It's inside the views section of the site.
Developer
Jul 21, 2013 at 1:45 PM
Sure, but placement.info only applies to shapes being returned as part of a DriverResult, e.g. "Parts_ListOfComments", "Parts_CommentForm", "Parts_Comments_Count" and "Parts_Comments_Count_SummaryAdmin".
Developer
Jul 21, 2013 at 1:46 PM
Did you mean a file called "Parts.ListOfComments.cshtml"? You can most definitely override that one.
Jul 25, 2013 at 6:10 PM
Are you on 1.6 or are you running 1.7RC? The Comment shapes have changed just a bit with the functionality being split out into a couple different shapes handling different functions.

If you're looking to move the Comment metadata shapes in 1.7, have a look at overriding Parts.Comment.cshtml. There are 2 items that render the partials for Metadata and Author contained within this shape. You may be able to adjust your placement simply by formatting this shape a bit. Look for
@Display.CommentMetadata(ContentPart: comment)
and
@Display.CommentAuthor(ContentPart: comment)
You can see an example of what's possible with overriding the Comment shapes on my site: HERE