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 テーマでは、以下のような表示になります。

このプラグインでは、サイト側でコメントをテーマに合わせるようスタイルを設定することが想定されていますが、「Load Comment CSS」オプションを有効にした際に適用されるスタイルは、適切な出発点となるはずです。上記の CSS ルールに似たものを、まもなくプラグインに追加する予定です。

こんにちは、サイモンさん。

なんだかこれを見逃していました。CSS のヒントをありがとうございます!それを追加した結果、

から

へと変わり、明らかに改善されました。ただ、私のテーマがまだ奇妙な境界線を追加してしまっています。CSS を調べてみましたが、「borders」への参照が多数あり、何がその境界線を引き起こしているのか特定するのが難しいのです(私の CSS 力はあまり高くないので)。

twentynineteen テーマでサイモンさんが実現できたものに近づけるために、CSS で何を確認すればその境界線を消せるか、何かアドバイスはありますでしょうか?

もしお時間がなければ、無理はなさらないでください。引き続き自分で解決しようと思います。ここまで導いていただき、本当にありがとうございます!:slight_smile:

プラグインの次回のアップデートでは、デフォルトの引用 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: