Streaming live at 10am (PST)

Canonical URL variable + unique identifier variable


#1

Hello :slight_smile:

I would love to know how to find the following variable for a given Webflow page that would have been created through my Webflow CMS (most likely the CMS page’s template)

  1. Webflow page’s canonical URL variable
  2. Webflow page’s unique identifier variable

I am using the disqus pluggin to allow people to comment ony ma pages.
It seems really promising but need to add those two variables into the embed code as required below:

  /**
    *  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
    *  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
    /*
    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
    };
    */

Any ideas ?
Thank youf very much ! :hugs:
Anthony


#2

Hello,

I am wondering if there was ever an answer to this? I am having the same issue.

I saw on an earlier discussion board that it wasn’t necessary to change any of the Disqus code. However, on the site I’m working on, the Disqus code doesn’t seem to work on the dynamic content page (e.g. blog posts). (It does seem to work on the static pages). I think this may be because I need the same variables mentioned above (unless I am misunderstanding something).

Thanks for you help.
Lakis


#3

Hi @Lakis,

I think there is indeed nothing to change really.
At least everything is working fine on the project I’m working on.
I also have dynamic blog post like pages and the discus comments appears to stick to their respective blog post. I think you just need to register an account on discus and insert your site url into the discus custom code.

Mine looks like this.

<div id="disqus_thread"></div>
<script>

/**
*  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
*  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
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
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'YOU NEED TO PUT YOUR SITE DISCUS ADRESS EMBED HERE/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

#4

Okay, thanks so much @anthonysalamin. Good to know that it’s working for you – so at least that’s not problem on my site! I’ll keep trying to figure it out.

Lakis