psychobunny / nodebb-plugin-blog-comments

Lets NodeBB act as a comments engine/widget for your blog
BSD 2-Clause "Simplified" License
101 stars 55 forks source link

Request Craft CMS support. #38

Open William-Owen opened 8 years ago

William-Owen commented 8 years ago

https://craftcms.com/

theunknownartisthour commented 8 years ago

Craft CMS works with php so

<a id="nodebb-comments"></a>
<script type="text/javascript">
var nodeBBURL = '//your.nodebb.com',
    wordpressURL = '<?php get_site_url(); ?>',
    articleID = '<?php echo the_ID(); ?>',
    categoryID = 1; // OPTIONAL. Forces a Category ID in NodeBB.
                     //  Omit it to fallback to specified IDs in the admin panel.

(function() {
var nbb = document.createElement('script'); nbb.type = 'text/javascript'; nbb.async = true;
nbb.src = nodeBBURL + '/plugins/nodebb-plugin-blog-comments/lib/wordpress.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(nbb);
})();
</script>
<noscript>Please enable JavaScript to view comments</noscript>

and a little bit of https://craftcms.com/docs/ Is probably where I'll start~

theunknownartisthour commented 8 years ago

I don't have an instance of craft to test this on, please let me know if this plugin works for you. https://github.com/theunknownartisthour/nodebb-comments-craftcms