Help - Search - Members - Calendar
Full Version: line breaks in comments
Movable Type Community Forum > Using Movable Type > Commenting System
kindle9
I searched through a lot of past posts about this and tried various fixes but I've been unable to find a solution.

What I would like in my comments section is for the "Posted by" information to be directly underneath the comment text. I tried removing the feature in the blog config to convert line breaks *but* I do want line breaks automatically converted in the actual comment text!

Ex:

commentcommentcommentcomment

commentcommentcommentcommmentcomment
posted by so-and-so

newcommentnewcommentnewcomment
posted by whatshername

How do I get this:
CODE
    <MTEntryIfAllowComments>
    <MTComments>
    <div class="comments-body">
    <$MTCommentBody$>
<span class="comments-post">Posted by <$MTCommentAuthorLink spam_protect="1"$>  - <$MTCommentDate format="%B %e, %l.%M %p"></span>
    </div>
    </MTComments>
    </MTEntryIfAllowComments>


to do what I want?
mutedgirl
I want this too! I had it great with before I upgraded to mt3.0 and turned on dynamic templates.. when I did that, the FormatBreaks plugin didn't work anymore (along with 90% of my plugin-goodness I have come to love about MT...grr!) So now I'm stuck with either an ugly space under each comment (if I turned on 'Convert Line Breaks') or no line breaks in any comments (if 'Convert Line Breaks' is turned off)

Are there any alternatives or fixes for this?
bruce21
Not sure what you mean here or what version/stylesheet. If the issue is the border and version 3x default style, (the line before posted by, it is in the stylesheet:
CODE
.content p.posted {
    color: #999999;
    font-family: Verdana, Arial, sans-serif;
    font-size: x-small;
    border-top: 1px solid #999999;
    text-align: left;
    margin-bottom: 25px;
    line-height: normal;
    padding: 3px;
    }

You can change border-top to border-bottom or remove it, and margin-bottom is set to 25px, make it as small as you like to close the gap.

This what you meant?

Edited: Your template references comments-post and comments-body. Check references to both in stylesheet to change margins/padding.
mutedgirl
hrm.. I have a completely different stylesheet that I created myself, so I'm not sure that would work with how my site is structured.... Also, I tried another suggestion I found here at the forums, which was to add this to my styles:

CODE
p { margin:0px; }


And it worked- but too well! It set all the margins for the p's to zero, so that there were no longer spaces within the entries or anywhere else. I'm thinking that maybe your idea would do the same thing?
bruce21
The changes have to be specific to comments. I believe that if you have popup comments in templates for comments the default has:
CODE
<$MTCommentBody$>
<p class="posted">
in stylesheet put:
.posted p {margin:0px} or 2 or 10 etc...use margin-top or margin-bottom perhaps instead of just margin...but if you changed the code in comments listing template or in individual entry, you will have to view source of comments to see what classes/id's are there. Does that make sense? lol

the.posted p {etc makes it specific to the "p" within the posted class so that it won't effect the rest of the page. This works within the default templates, as posted by...is affected by the class "posted" and that was the question above. The space there could be affected either by the class="comments-body" or by the class="comments-post" in Kindles code ...looking at the template and stylesheet will show margins or padding there that affects spacing specific to comments.

If you are using a stylesheet with no reference to comments, check code in template and add corresponding to stylesheet.

If your template shows no classes for comments, add them to it. Use two, one for comments body, and one for the posted by... etc at the bottom. Make comment body a class, and posted by...another class. Then style in margins/padding as you wish. Sorry to be so long, but there are a lot of stylesheet/template variables with you two ;-)

Another way would be to set a class in stylesheet. ie: .posted (margin:0px}
Then in template use for posted by...
CODE
<p class="posted">
Posted by etc etc this would call the class only on that p
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.