Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated data-isso-id t use uri for confluence that resolves correctly to the page from admin approve/disapprove email

...

I've been after a commenting system that balances the need for moderating comments before exposing them publicly - while also providing a privacy policy and framework I'm comfortable with.  You might have noticed (if you visited previously) that I had integrated disqus into my confluence pages (I'll do a writeup on how to do this at some pointif you really want to use disquss see this article I wrote).  However, I'm not that comfortable with disqus' privacy and data collection (and use) policies (plus many people have somewhat of a disdain for disqus... disdainqus?).

...

Once we have configured isso, we can run it simply by pointing isso the to our config file and using the run option

...

Running the above every time you want to start up isso is not the most efficient approach (i.e. you'll have to remember to run isso every time you start / restart your server).  Let's setup isso as a service to make it start automatically.  The below example assumes your distro is using systemd.

Warning

You'll need to log out of the "isso" account back into your normal account (that as has sudo privileges).

Log out of the "isso" account (usually by typing "exit" in the terminal) to get back to the account you usually use.  Let's create a isso.service file.

...

Code Block
languagejs
linenumberstrue
<script type="text/javascript">

AJS.toInit(function(){

        // place after comments section
        AJS.$('#comments-section').after('<section id="isso-thread" data-title="' + AJS.params.pageTitle + '" data-isso-id="pageId_/pages/viewpage.action?pageId=' + AJS.params.pageId + '" style="margin-top:22px"></section>');

        (function() {
            var d = document, s = d.createElement('script');
            s.type = 'text/javascript'; s.async = true;
            s.src = 'https://isso.example.com/js/embed.min.js';
            s.setAttribute('data-isso', 'https://isso.example.com');
            (d.head || d.body).appendChild(s);
        })();
});
</script>
<noscript>Please enable JavaScript to view comments.</noscript>

...

So what's going on here?  The above does two things: injects the required <section id="isso-thread"></section> after the native confluence comments, which should be disabled for anonymous users (via your space permission permissions by only given giving 'Anonymous Access' the 'View" permission).  Hence for anonymous (public) users, they will not see the native commenting system - , only isso.

You'll notice in the isso section tag, we're explicitly defining both data-title and data-isso-id attributes.  This is important for confluence (especially the data-iso-id attribute) as confluence provides two url formats for each page: a user-friendly format (like https://confluence.jaytaala.com/display/TKB/Responsive+embedded+videos+in+confluence) and pageId format (like https://confluence.jaytaala.com/pages/viewpage.action?pageId=1343551).  It's important that isso can identify the page regardless of what url format users visit or else comments won't show on one of the page url formats.

To do this we instead identify the isso id for the page as via it's pageId.  This is what data-isso-id="pageId_/pages/viewpage.action?pageId=' + AJS.params.pageId + '" does (AJS.params.pageId return the unique page id to isso).

...