<p>Try wrapping your entry.url in quotes so JS reads it as a string. </p>

<p><code>this.page.url = '{{entry.url}}</code></p>

CC BY-SA 3.0
2017-01-13T21:50:44.240Z
2017-01-13T21:50:44.240Z
Aaron Berkowitz
<p>Default Disqus embed code includes the following:</p>

<pre><code>var disqus_config = function () {
    this.page.url =   // Replace PAGE_URL with your page's canonical URL variable
    this.page.identifier = {{ entry.section }}-{{ entry.id }}; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
</code></pre>

<p>I am trying to use <code>this.page.url = {{ entry.url }}</code>.  This prints the url, but it includes the <code>http://</code> and the <code>:</code> is throwing an error preventing Disqus from loading.  Is there anyway to template the url without the http://????</p>

<p>Note that the config I am using is straight from Disqus.  The CraftCMS knowledge base article does not include <code>this-page</code>.</p>

<templating>
Templating - printing entry.url throws js error when trying to embed Disqus?
# Templating - printing entry.url throws js error when trying to embed Disqus?

(Asked by: username_0 on 2017-01-13)

Default Disqus embed code includes the following:
var disqus_config = function () {
    this.page.url =   // Replace PAGE_URL with your page's canonical URL variable
    this.page.identifier = {{ entry.section }}-{{ entry.id }}; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};

I am trying to use this.page.url = {{ entry.url }}.  This prints the url, but it includes the http:// and the : is throwing an error preventing Disqus from loading.  Is there anyway to template the url without the http://????
Note that the config I am using is straight from Disqus.  The CraftCMS knowledge base article does not include this-page.

**Tags:** templating

---

## 1 answers

### Answer by username_1 on 2017-01-13. Score: 1 | Accepted answer

Try wrapping your entry.url in quotes so JS reads it as a string.

`this.page.url = '{{entry.url}}`


---

