Textpattern Forum

You are not logged in. Register | Login | Help

#11 2008-03-30 14:31:45

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 251
Website

Re: [plugin] [ORPHAN] peg_nested_comments

Great, thanks for the replies. As soon as I get time, I’ll set it up :)

Offline

#12 2008-05-27 19:46:11

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: [plugin] [ORPHAN] peg_nested_comments

This looks neat, but I can’t get it to work. Also the “hidden field” is a text field that gets a number in it if you click “reply”… I set a css attribute to not display the field, but I would like to have there be some other indication that a comment is being posted as a reply. Right now if you’re already down at the bottom clicking on the link doesn’t visually change anything (doesn’t move to a new area of the page or anything) so people could get confused. Maybe if a line of text appears above the form that says “reply to [name]” or somethinig?

But anyway, I can’t get the nested thing to work so far. It still just shows the comments in order, all aligned to the left. I followed the instructions in the OP here, but the instructions in the Plugin help don’t display because the tags are not shown (you can see them in the source). Is there something more to it that I’m missing? I thought at first it might not be playing nice with sed_comment_pack but disabling that didn’t change anything.



WebKat

Offline

#13 2008-05-27 23:25:52

Egypt Urnash
Plugin Author
From: Boston
Registered: 2006-07-23
Posts: 19
Website

Re: [plugin] [ORPHAN] peg_nested_comments

Yeah, the docs are a mess because the plugin I wrote this on top of had screwed-up docs and I never got around to cleaning them up.

I was planning to replace the Javascript that I inherited from cha_comment_reply to make a new reply form appear beneath the comment you’re replying to, but I’ve been caught up in a major art project with no time for coding. Feel free to run it through a decompressor and enhance it, if you have the skills!

Things to do to get it working:

  • make sure that you’re using <txp:peg_nested_comments /> instead of <txp:comments ?>
  • make sure that your form for displaying a comment includes a call to <txp:peg_child_comments /> somewhere in it. This is the heart of how this plugin works.
  • make sure that your comments are being displayed in a UL or OL, not in some other method
  • make sure that your css isn’t killing the left margins of children of lists

Last edited by Egypt Urnash (2008-05-28 12:34:19)

Offline

#14 2008-05-28 04:47:28

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: [plugin] [ORPHAN] peg_nested_comments

I don’t have the skills. Like you, I am an artist … but I’m not a programmer. I can do HTML and that’s about it. Anyway I know all about getting caught up in art projects!

make sure that your comments are being displayed in a UL or OL, not in some other method
This may be where I’m having trouble. It has been a long time since I was deep enough in my code to remember how everything is, but looking at the html that is produced on a commented page, I don’t see any list tags. What form is it and can you give me a generic example?



WebKat

Offline

#15 2008-05-28 12:41:00

Egypt Urnash
Plugin Author
From: Boston
Registered: 2006-07-23
Posts: 19
Website

Re: [plugin] [ORPHAN] peg_nested_comments

It’s the “comments” form. Here’s an example, pulled from my templates:

<div class="header <txp:comment_name link="0" />"><txp:glx_gravatar class="userpic" />
	<span class="admin">
		<txp:comment_permlink>◉</txp:comment_permlink>
	</span>
	<txp:comment_name link="1" /><br /><txp:hide><txp:comment_time format="l, g:i A" /><br /><txp:comment_time format="F js, Y" /></txp:hide><txp:comment_time />
	<span class="commentlinks"><txp:peg_reply_link /></span>
</div>
<div class="body <txp:comment_name link="0" />">
<txp:comment_message />
</div>
<txp:peg_child_comments wraptag="ul" />

And the call to <txp:peg_nested_comments> is in the "comments_display" form. <txp:peg_comments wraptag="ul" /> is what I have.

Offline

#16 2008-05-28 13:57:53

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: [plugin] [ORPHAN] peg_nested_comments

Ok here are my forms now (still not working)…

comments:

<txp:zem_prblock><div class="<txp:sed_get_comment_class />">
<txp:comment_anchor />
<h5><span class="comment-no"><txp:comment_permlink> #<txp:sed_comment_number/></txp:comment_permlink></span> &middot;&nbsp;<txp:comment_name link="0" /><txp:sed_if_author_comment_string string=" (Author)" /></h5>
<txp:sed_comment_time class="comment-time" />
<txp:message /><txp:peg_reply_link /></div><txp:peg_child_comments wraptag="ul/>
</txp:zem_prblock>

comments_display:

<div id="ribbon-ends"><img src="/images/nav/ribbon-left.png" /></div>
<div id="ribbon"><h3 id="comment"><txp:comments_invite textonly="1" showalways="1" showcount="0" /></h3></div>
<div id="ribbon-ends"><img src="/images/nav/ribbon-right.png" /></div><br clear="all" />
<txp:peg_comments wraptag="ul" />
<txp:peg_nested_comments wraptag="ul" />
<txp:if_comments_preview>
<div id="cpreview">
<txp:comments_preview />
</div>
</txp:if_comments_preview>
<txp:if_comments_allowed>
<txp:comments_form />
<txp:else />
<p><txp:text item="comments_closed" /></p>
</txp:if_comments_allowed>

and here is an example of the source when I view a comment that’s been posted:

<div class="comment even author">
<a id="c000445"></a>
<h5><span class="comment-no"><a href="http://opalcat.com/Creative_Writing/on-cats-and-trust#c000445"> #4</a></span> ·&nbsp;OpalCat<span class="author-string"> (Author)</span></h5>
<span class="comment-time">05/27/2008 03:40 PM</span>
	<p>nesting test</p>
<a class="peg_replyto" href="#peg_replyto" onclick="peg_selectComment('000445');"> Reply </a></div>

I don’t understand why it’s wrapping with a p …



WebKat

Offline

#17 2008-05-28 23:06:50

Egypt Urnash
Plugin Author
From: Boston
Registered: 2006-07-23
Posts: 19
Website

Re: [plugin] [ORPHAN] peg_nested_comments

Hmm. Well, first, there’s no such tag as <txp:peg_comments>. So getting rid of that is a start.

Kill the css that hides the reply-to field and make sure it’s getting filled in when you reply to a comment.

(Do you have this live? I might be able to take a look at it.)

You shouldn’t see anything special in a comment that doesn’t have children.

You should be seeing something like this when you view a comment with a child comment:

<div class="comment even author">
<a id="c000445"></a>
<h5><span class="comment-no"><a href="http://opalcat.com/Creative_Writing/on-cats-and-trust#c000445"> #4</a></span> ·&nbsp;OpalCat<span class="author-string"> (Author)</span></h5>
<span class="comment-time">05/27/2008 03:40 PM</span>
	<p>nesting test</p>
<a class="peg_replyto" href="#peg_replyto" onclick="peg_selectComment('000445');"> Reply </a>
<ul>
<div class="comment odd author">
<a id="c000446"></a>
<h5><span class="comment-no"><a href="http://opalcat.com/Creative_Writing/on-cats-and-trust#c000446"> #4</a></span> ·&nbsp;OpalCat<span class="author-string"> (Author)</span></h5>
<span class="comment-time">05/27/2008 03:45 PM</span>
	<p>nesting test</p>
<a class="peg_replyto" href="#peg_replyto" onclick="peg_selectComment('000446');"> Reply </a>
</ul></div>

</div>

Offline

#18 2008-05-29 03:29:53

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: [plugin] [ORPHAN] peg_nested_comments

It’s live on every article page on my site. I’ve done a test where I replied to a comment, then replied to that comment, then replied to that comment, etc, here … it all just shows up in the nested order, but flush left with no indent (sorry it’s such a bummer of an article, it just happened to be what my most recent one was.).
The reply-to field is getting filled in—I saw that it was before I hid it, but I removed the hidden css to double check and it was fine. It behaves the exact same way whether it is hidden or not.

And I’m confused now because the original post in this thread says:

replace <txp:comments /> in your comments_display form with <txp:peg_comments /> – it takes the same syntax.


WebKat

Offline

#19 2008-05-29 13:42:37

Egypt Urnash
Plugin Author
From: Boston
Registered: 2006-07-23
Posts: 19
Website

Re: [plugin] [ORPHAN] peg_nested_comments

I’m not sure why it’s wrapping the child comments in a div, instead of a ul. Very weird. Oh, wait. I see now. Close your quotes in the comment form: <txp:peg_child_comments wraptag= “ul />

If that doesn’t work, you can work around this by doing this:

add some css along the lines of
.comment .comment {margin-left:2em}

and change
</div><txp:peg_child_comments wraptag=“ul/>
to
<txp:peg_child_comments wraptag=“ul/></div>

Also, ignore the part above where I talk about peg_nested_comments as I appear to have been smoking crack when I wrote that; I just looked through the source of the plugin and there’s no tag by that name. Sorry, it’s been quite a while since I hacked this up!

Last edited by Egypt Urnash (2008-05-29 13:43:03)

Offline

#20 2008-05-29 18:38:35

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: [plugin] [ORPHAN] peg_nested_comments

Yeah that crack smoking can mess with your code for sure ;)

I fixed the missing quote, added the css you suggested, moved the div, changed the comments tag back to the tag that actually exists…

…still not working :(



WebKat

Offline

Board footer

Powered by FluxBB