Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-01-01 12:45:35
- TheUsability
- Member
- Registered: 2005-05-03
- Posts: 51
...style/edit the Numbered View of Comments
Where can I style / edit the numbered view of the comments? (Especially how the numbering is styled.) It seems that there’s been a paragraph inserted now (4.0.1 to 4.0.2/4.0.3) and I can’t get it out.
Offline
Re: ...style/edit the Numbered View of Comments
The paragraph was inserted at 4.0.2.
As to the styling, just find the right tag and use CSS. If you want alternating styles, then you can use the alternating styles plugin (ajw_comment_alt).
Eric
Offline
#3 2006-01-01 14:06:41
- TheUsability
- Member
- Registered: 2005-05-03
- Posts: 51
Re: ...style/edit the Numbered View of Comments
What about editing the HTML itself? Do I have to hack comments.php?
Offline
Re: ...style/edit the Numbered View of Comments
TheUsability,
in advanced preferences you have a choice between presenting comments as an ordered list, or alternatively as a series of divs. Additionally you can override this in your forms/templates by calling txp:comments with attributes break
and wraptag
. So the numbers next to the comments are rendered by the browser, if you want to change them you have the style the ol/li or simply use different tags to wrap the comments.
the p’s in the comments are wrapped around paragraphs. If a comment is one paragraph, it will be one p-block. If the comment is multiple paragrpahs there will be multiple p-blocks. It behaves as known from textile in articles. This was often requested and introduced in 4.0.2, prior to that a comment usually had lots and lots of br-tags which many users found to be less than ideal for marking up paragraphs.
Offline
Re: ...style/edit the Numbered View of Comments
Sencer, is there a quick way to re-textile the old comments so they use the p tags now? Or should I just make things look similar via CSS.
I have about 50 articles with a mix of old and new comments… I’d like them to look similar in format.
Eric
Offline
Re: ...style/edit the Numbered View of Comments
re-textile the old comments
I am afraid there’s no “ready” way to do that, because posts are saved as html. But you can try executing the following queries (backup your DB first! better yet, try it out on a testing system first). Make sure you do it in the same sequence as here (order is important). Also please report back how many rows are changed for each query (I am suspecting two queries will return 0).
http://pastebin.com/486413 (Remember to add your table-prefix in those queries…)
(The last two will clean up accidental double-brs for people that had been running 4.0.2)
Last edited by Sencer (2006-01-01 22:16:03)
Offline
Re: ...style/edit the Numbered View of Comments
Sencer wrote:
the p’s in the comments are wrapped around paragraphs.
This came as an unpleasant surprise for me, when updating to 4.0.3 (I think I skipped .2). Some time ago, I formatted displayed comments using break tags, and now I have to choose between having all older comments displayed without any space between the content and the commenter’s name (and new comments looking fine), or having a huge gap between content and name in new comments (and messing up a thousand old ones).
I would prefer the added paragraph tags to be optional.
Offline
Re: ...style/edit the Numbered View of Comments
Hiram, in the post you quote there is a solution to convert old comments.
If there is need, I can turn it into a plugin if that is easier to apply than using the queries directly.
Offline
Re: ...style/edit the Numbered View of Comments
Sencer wrote:
Hiram, in the post you quote there is a solution to convert old comments.
Thank you; I saw it. I now simply changed the order of items in displayed comments and added a div defining margins around the paragraphs, and all is well both in old comments and in new. Of course, updating Txp should not normally require such modifications to site layout. But I’m actually rather pleased with the new looks.
Offline