Comment Reply Threading / Linking on the WordPress Side

Hi, one major issue I’m having with the WP-Discourse plugin is that comment replies are unclear. When there is a comment reply in Discourse, the WordPress side does not show what it’s a reply to. It’s just a pure flat conversation.

It would be nice to either utilize WordPress’ threading capabilities (unlikely given Discourse’s stance), or at least state “This is a reply to comment #2” or something like that.

Is that possible?

Thanks!

It has been discussed before, so you might search for those conversations; I’d point you to a thread, but it is always mentioned in passing. Get yer search on! :slight_smile:

I couldn’t find it. Was using keywords such as threaded and reply but that’s obviously not helpful. Will try Google.

I’ll see if there is something that can be done with that.

Our standard embed script works this way. See Jeff’s blog for example:

https://blog.codinghorror.com/hacker-hack-thyself/

I like that - this could be acceptable. What’s “our standard embed script” though? What you have in WP-Discourse isn’t doing this for me (also tried in default theme, still nothing).

I believe he’s referring to Embedding Discourse Comments via Javascript.

Hi, I’m revisiting this issue. The JS embed isn’t working well enough for my liking, so I’m looking at going back to the comment sync.

Doing some tests, many of our conversations look plain awful without knowing who’s replying to whom. Is there a possibility of getting a bit more clarity with the replies?

Unfortunately, when you are doing the wp_remote_get inside of lib/discourse-comment.php, using the best=____ parameter strips out the reply information from your JSON!

Not sure if that’s on purpose or is a bug, but that’s a roadblock on its own.

Edit: Yet, if you remove the best parameter, it doesn’t work with /wordpress.json anymore. I can see the problems baked in here for wanting this ‘simple’ change.

Thanks!

Hello,

I did a search and even though it’s said in this thread this has been discussed elsewhere, I can’t find it. (I also looked at WP Discourse template customization and WP Discourse Plugin Tips and Tricks.)

I just launched Discourse comments on my Wordpress site, and I’m having the same issue as Berto—without the context of “This is a reply to…” (either name or comment), the comments are a bit challenging to follow. Since I am trying to sell my readership that Discourse is a superior experience to Disqus, and that they should give it a try, it’s not the best look for that.

@simon Did you come up with a solution to this? Do I need to use the the Javascript embedding? It’d be great if I could make the conversation flow more clearly like on Coding Horror’s blog. (But I’d really prefer to keep using WP-Discourse, which I love.)

Thanks for bringing this up. I think that improving the way that comments are displayed should be the next thing we focus on for the plugin.

That would be awesome, @simon.

You already have a super-solid integration with linking the comments between the sites. Having both references to replies (and even active links that move you through the conversation) on Wordpress, like @codinghorror uses on his blog, would be a big benefit. His site, I think, gives a good template to start from and, if necessary, you could tweak the UI from there.

Please let me know if you need any help testing things. I’m happy to offer whatever assistance I can. :slight_smile:

If improving the way comments are displayed is something you’re going to focus on, I might also ask for a cleaner presentation for when you are quoting previous content.

Quoting is something I’m trying to encourage now in order to have the comments on Wordpress make more sense. But currently the name quoted and the quote itself are separate and styled differently:

2019-04-17_11-50-22

I think it feels a little disconnected.

It’d be cool if it could match more like how it’s presented in Discourse:

I don’t know how hard that is to make happen, but my 2 cents anyway. :slight_smile:

@simon

我来跟进一下。我仍然希望在 WordPress 上能看到更清晰的回复、引用和评论展示。

你最近有时间研究一下这个问题吗?

如果你没时间,我当然完全理解,但我想让你知道,这确实是我非常希望看到改进的地方。我又收到了一些读者的反馈,说当前的格式让跟进对话变得很困惑。我觉得如果 WordPress 上的副本能更清晰一些,可能会鼓励更多人尝试在我的网站上使用 Discourse。

非常感谢你为这个插件付出的出色工作。真的很棒,也非常感谢。:slight_smile:

我正在研究可以采取哪些措施,要么明确标识某条评论是回复,要么在包含回复的评论下方添加“回复”链接。目前,Discourse 尚未将这些必要数据传递给 WordPress,但看起来只需对 Discourse 进行较小的修改即可实现。

是的,默认的样式效果并不理想。您可以通过将以下规则添加到您的主题 CSS 中来改善它们:

.comment-body .quote blockquote {
	margin-top: 0;
	margin-right: 0;
}

使用 WordPress 的 twentyninteen 主题,这将呈现类似以下的效果:

该插件的预期是,网站会自定义评论样式以匹配其主题,但启用“加载评论 CSS”选项时所应用的样式应能提供合理的起点。我很快就会将类似上述的 CSS 规则添加到插件中。

嘿,Simon,

不知怎么的我错过了这条消息。谢谢你的 CSS 技巧!加上它之后,我从:

变成了:

这确实是一个改进。但我的主题仍然在添加那个奇怪的边框。我尝试查看 CSS,但其中有很多关于“边框”的引用,我很难找出是哪个导致了这个问题。(我的 CSS 功底还不够强。)

你是否有任何建议,告诉我该在 CSS 中查找什么,以去除那个边框,从而更接近你在 twentynineteen 主题中所实现的效果?

如果你没有建议,我也完全理解。我会继续尝试解决这个问题。但非常感谢你到目前为止给我的帮助!:slight_smile:

在插件的下一个更新中,默认引用 CSS 将有所改进。

此更改应能修复您网站上 blockquote 及其标题的右对齐问题,同时也能解决边框问题。该 CSS 代码将在本周内添加到插件中,但如果您现在就将 CSS 添加到您的网站中,也不会造成任何不良影响:

.comment-body .quote blockquote {
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.comment-body .quote blockquote p:last-child {
	margin-bottom: 0;
}

非常感谢!太棒了!(而且我认为你将此功能添加到基础插件中是非常棒的。)

我添加了代码,结果如下:

总体而言,这是一个巨大的改进。非常感谢!

最后还有一个问题:有没有办法在日期下方添加一点空白,就像评论中那样,但不带白色的回复框?

我觉得在日期和白色框边缘之间留一点负空间,可能会让整体看起来更整洁。

是的,我认为这是您的主题存在的一个问题。尝试添加一条类似以下的 CSS 规则:

.comment .comment-content {
    margin: 22px;
}

您可能需要调整 22px 的值,以使边距与您的网站相匹配。

您的主题中还有另一个问题您可能需要修复。WordPress 使用有序列表来显示评论,但通过 CSS 移除了列表中的数字。如果您不想在评论旁边显示数字,可以尝试添加一条类似于 Twentyninteen 主题中的规则:

.comment-list {
    list-style: none;
}

太棒了!各方面都好了很多。那个 CSS 确实起作用了。

非常感谢你,@simon!一如既往,你太棒了!:smiley: