Skip to main content
Inspiring
May 14, 2020
Question

Embed 3rd-Party Disqus Comment Script in RH Masterpage Footer: PAGE_URL + PAGE_IDENTIFIER Variables?

  • May 14, 2020
  • 4 replies
  • 1001 views

Environment

  • RoboHelp 2019 (new, update 12)
  • Generating HTML5 Frameless output

 

Goal

  • Provide comments section at the bottom of each topic. Specifically, provide a Disqus (disqus.com) commenting section/functionality at the bottom of each of my RoboHelp topics, by inserting the Disqus service's code in the footer of my RoboHelp masterpages.

 

Problem

  • For each topic (webpage) the Disqus script in the footer of each topic requires 2 unique pieces of information: the PAGE_URL and a PAGE_IDENTIFIER. Actual script provided below, additional info/details from Disqus here: https://help.disqus.com/en/articles/1717084-javascript-configuration-variables
  • Hardcoding/manually entering this information for every topic would be both an implementation and a maintenance nightmare.

 

var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable

 

The Big Ask

  • Are there RoboHelp or (more likely) agnostic, standalone scripts (Java, PHP, etc.) that could generate and serve up this information? WordPress and other popular web development and hosting solutions apparently can do something similar via their custom-developed Disqus plugins. That might be easier for them since they're also the hosting service provider.

 

This may be a candidate for a feature/enhancement request, but I thought I'd see if anyone in the community had a solution first.

This topic has been closed for replies.

4 replies

RoboFanAuthor
Inspiring
July 14, 2021

We never implemented the automated scripting side of this. However, I did get it working as a proof-of-concept. We're currently making changes to our hosting environment - completely different enviro. Once the dust settles from that effort, I'd like to revisit this, as we received positive feedback from our test audience.

RoboFanAuthor
Inspiring
May 15, 2020

Amebr,

 

Thank you for the response - the map ID suggestion sounds promising. I think I have enough info I can take this to one of our developers for help with scripting. I'll post updates back here as I have them. 

Known Participant
July 14, 2021

Did that work?

Community Expert
May 15, 2020

You could set this.page.url = location.origin + location.pathname, which should set it to the full path without query strings or hash (bookmarks). 

 

And the page identifier sounds a lot like a map number. So if you set up a map file, perhaps a friendly developer could write a script to plug the map number into your discus script. 

RoboFanAuthor
Inspiring
May 14, 2020

For context, here are 2 examples of how other platforms (Hubspot and WordPress) provide/generate the PAGE_URL and PAGE_IDENTIFIER information.