url and identifier not making a difference, all comment boxes are the same
See original GitHub issueOn my page, I render a list of posts with a “SHOW COMMENTS” button that reveals the DiscussionEmbed
element:
const postObjects = posts.map((p,index)=>{
return (
<div className="Post">
<ReactMarkdown children={p.md}/>
<button
onClick={()=>{
showComments(p.filename);
}}
>
SHOW COMMENTS
</button>
{ currentPost == p.filename &&
<DiscussionEmbed
shortname={MY_DISQUS_SHORTNAME}
config={
{
url: `${MY_URL}#!${p.filename}`,
identifier: p.filename,
title: p.filename,
}
}
/>
}
</div>
)
});
here is the showComments
function, which fires when the button is pressed, reset DISQUS from its window object and sets currentPost
which then shows the DiscussionEmbed
component that matches:
const showComments = (filename) => {
if (window.DISQUS) window.DISQUS.reset({
reload: true,
config: function () {
console.log(this);
this.page.identifier = filename;
this.page.url = `${MY_URL}#!${p.filename}`;
}
});
setCurrentPost(filename);
}
Anyway, all the comment blocks are the same / have the same comments. If I click the links to the comments contained in they have:
MY_URL
instead of
`MY_URL#!filename
What am I doing wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Disqus showing same comments on all pages with unique ...
I viewed disqus admin page and it showed http://127.0.0.1:8000/post as the thread url, editing it gave me an error about invalid url format....
Read more >Why are the same comments showing up on multiple pages?
This is known as identifier conflict because, even though each page will have a unique Disqus identifier, the pages share the same thread...
Read more >Unable to set Identifier (Entity ID) or Reply URL for Azure ...
I have the same problem as @CarolineLu-1373 : "When I try to set the Identifier (Entity ID) or Reply URL for a new...
Read more >NetLogo 6.3.0 User Manual: Programming Guide
This section describes the NetLogo programming language in detail. The Code Example models mentioned throughout can be found in the Code Examples section...
Read more >Failed to register bundle identifi… | Apple Developer Forums
Im getting the error "Failed to register bundle identifier. ... Add a Comment ... I was working fine this morning and got the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same problem using the DiscussionEmbed example. The fix mentioned earlier didn’t work, but I was able to get it working by using setState and useEffect, and a loading prop.
const [disqusConfig, setDisqusConfig] = useState({});
…setDisqusConfig({ url: "https://mywebsite.com/" + post.slug, identifier: post.id, title: post.title });
…<DiscussionEmbed shortname="my-web-site" config={disqusConfig} />
Clue:
test_post_0
works, buttest-post_0
does not. It appears these strings are character restricted.