[nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget)
-
@psychobunny said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
anything related to publishing and commenting have changed since the
Any suggestion on how to debug it to eventually make it show up on the ghost posts?
-
Can I have any help on making this working again? I have done everything what it is in the documentation and it's not working since I have upgraded to v1.1.0 and I had to add
proxy_set_header X-Forwarded-Proto $scheme;
to the nginx. ` -
Any errors in the browser console?
-
@psychobunny said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
Any errors in the browser console?
No errors only this warning:
6/8 19:11 [19025] - warn: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.
- nodebb-plugin-blog-comments
-
Here is my posts.hbs related to this plugin on the ghost side:
74 <a id="nodebb/comments"></a> 75 <script type="text/javascript"> 76 var nbb = {}; 77 nbb.url = 'z0z0.me/comments'; // EDIT THIS 78 79 (function() { 80 nbb.articleID = '{{../post.id}}'; nbb.title = '{{../post.title}}'; 81 nbb.tags = [{{#../post.tags}}"{{name}}",{{/../post.tags}}]; 82 nbb.script = document.createElement('script'); nbb.script.type = 'text/javascript'; nbb.script.async = true; 83 nbb.script.src = nbb.url + '/plugins/nodebb-plugin-blog-comments/lib/ghost.js'; 84 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(nbb.script); 85 })(); 86 </script> 87 <script id="nbb-markdown" type="text/markdown">{{{../post.markdown}}}</script> 88 <noscript>Please enable JavaScript to view comments</noscript>
and here is the nginx config related to this:
location ^~ /comments { proxy_set_header X-Real_IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Nginx_Proxy true; proxy_pass http://comments_upstream; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
-
This line
nbb.url = 'z0z0.me/comments';
Make it
nbb.url = '//z0z0.me/comments';
I have no idea how this would have worked for you prior to the upgrade, unless you modified this line while trying to debug your code. This ought to fix it though.
-
@psychobunny said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
I have no idea how this would have worked for you prior to the upgrade, unless you modified this line while trying to debug your code. This ought to fix it though.
Actually this line was
nbb.url = 'https://z0z0.me/comments';
-
Yeah, that should work too. Any luck?
-
Did the change but no luck at all.
Here the comments should show up.
-
Aha. Change
<a id="nodebb/comments"></a>
to
<a id="nodebb-comments"></a>
For posterity, see
ghost.js
in this PR: https://github.com/psychobunny/nodebb-plugin-blog-comments/pull/52/files -
Bingo, that was it. Thanks a lot for your help
-
Apologies, I meant: https://github.com/psychobunny/nodebb-plugin-blog-comments/pull/48/files
And, it seems like in
ghost.js
that's the only thing you need to change anyways, so that's OK.EDIT: Awesome
-
said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
<span id="nodebb-comments-count"></span> Comments
also I have put into the partials/loop.hbs
<span id="nodebb-comments-count"></span> Comments
to show the number of comments in each posts but this is all I can see:
-
hey @Joykiller I'm quite certain this works with the latest version of NodeBB as we are using this currently on our forum: https://blog.nodebb.org/v1-5-0-a-long-awaited-release/
May not be up to date with the latest version of Ghost though, so that might be the issue here. It's come up pretty recently that we should consider upgrading our blog to latest, and when that happens I'll certainly make sure that the plugin works with it
-
I have a possibly unusual use case that shows I probably don't understand how NodeBB integration is working with this plugin. I'm on Wordpress.
Here's what I thought happened: the plugin uses the Wordpress article id to use to create a new NodeBB topic with that same id when the Publish button is pressed. Afterward, since the topic already exists, you see the posts and comment form instead of the Publish button.
My use case is that the topic already exists (it was created in NodeBB) and I'm trying to tie a Wordpress post to it. I'm using the general approach and setting nodebb.articleID to the NodeBB topic id.
What I expected was to see the comment box and current posts in that topic. What I'm seeing instead is the Publish button.
Am I misunderstanding how things should be working?
-
@psychobunny said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
hey @Joykiller I'm quite certain this works with the latest version of NodeBB as we are using this currently on our forum: https://blog.nodebb.org/v1-5-0-a-long-awaited-release/
May not be up to date with the latest version of Ghost though, so that might be the issue here. It's come up pretty recently that we should consider upgrading our blog to latest, and when that happens I'll certainly make sure that the plugin works with it
Cool, I'll be waiting there has been alot of changes in Ghost lately.
-
@jay-shaffstall said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
I have a possibly unusual use case that shows I probably don't understand how NodeBB integration is working with this plugin. I'm on Wordpress.
Here's what I thought happened: the plugin uses the Wordpress article id to use to create a new NodeBB topic with that same id when the Publish button is pressed. Afterward, since the topic already exists, you see the posts and comment form instead of the Publish button.
My use case is that the topic already exists (it was created in NodeBB) and I'm trying to tie a Wordpress post to it. I'm using the general approach and setting nodebb.articleID to the NodeBB topic id.
What I expected was to see the comment box and current posts in that topic. What I'm seeing instead is the Publish button.
Am I misunderstanding how things should be working?
You need to click the publish button before comment box shows up.
-
You need to click the publish button before comment box shows up.
What does the publish button do, exactly? I had been assuming it created the topic in NodeBB. But if the topic already exists, what does publish do?
-
I confirmed on a test site that clicking the button does create a new topic, so clearly I am not understanding what the Javascript articleId variable really is doing.
Can anyone shed any light on that? I can cope with the button creating the topic, but I do need to know what role the articleId plays in the process. I'm using this plugin to power comments on virtual pages, pages that don't actually exist as separate Wordpress pages, so I don't have a post id to use.
Does the articleId need to be a unique value? Must it be an integer? What's the legal range of it?
Edit: For anyone doing something similar to what I'm doing, here are the answers:
The articleId must be unique, the plugin establishes a mapping between it and a new topic id. There does not appear to be a way to tie a Wordpress article to an existing topic.
The articleId does not need to be an integer, as long as you use quotes it can be any string. It's solely used to find the topic id in NodeBB.
So if you're using it like I am, for virtual pages that don't actually exist in Wordpress, you can safely coexist with comments on normal Wordpress pages by using an alphanumeric unique id for the virtual articleIds.