Closed mjalindahl closed 6 years ago
@mjalindahl Thanks for using.
Try only by passing the shortname.
<vue-disqus shortname="my_shortname_disqus" />
I think this is caused by the component not responsive to identifier change...
Hi @ktquez, I tried that, but still same comments on each page.
@alijaya I thought so too, but when you hover over the "Sort By Best" section, you can see the URL is being built from my variables. Is there any other way to be absolutely certain Disqus is getting the right identifier and URL and it's not somehow being replaced later after being mounted()
or something? I tried the other recommendation of doing a v-if
once the identifier
is set, but that didn't seem to work either.
The t_i
in the URL is the identifier, and the t_u
is the URL that I'm sending. It seems like it's getting both of these on their end.
Thanks for the help so far.
Even after removing everything except for the shortname, the same comments still load. It's as if Disqus has already made up its mind how to associate the posts with the pages. Absolutely nothing changes if I put in random characters for the identifier and URL.
Maybe this helps?
@mjalindahl Can you put some preview online?
@mjalindahl : hey... I have found the solution for this... basically, Disqus doesn't support "hash" mode in url like #/
, but they support hashbang mode #!/
(which is doesn't exist in Vue 2, there's a workaround about that)
So... the best way is... to make your router.mode in "history", and reset your disqus site (like deleting and make new).
So for detailed problem, maybe it's better if we know how Disqus search link the page with the thread:
identifier
, if it's defined, it will search based on identifierurl
to search, if it's defined, it will search based on urlwindow.location
as url
, and this is where disqus will play some trick, it will ignore all after #
, so https://example.com/test
will have same url
as https://example.com/test#somehash
, and because of this if you are in hash
mode, https://example.com/
will have same url
as https://example.com/#/test
. Except if it's hashbang #!
, it won't be ignoredidentifier
, it will search the thread with suitable identifier
, some caveat here, a thread can have multiple identifier
. If it finds, it returns the threadurl
, url is unique to a thread, if it finds, it returns it.Example:
You have identifier
of foo
with url
of https://example.com/#/foo
.
It searches the database, it doesn't have any entry yet, so it creates new one with:
[
{
identifiers: [ 'foo' ],
url: 'https://example.com'
}
]
Then you have another page with identifier
of baz
and url
of https://example.com/#/baz
.
It searches for baz
, not found. Then search the and found https://example.com/
(remember that it ignores the hash
?), it returns it. So the database becomes this:
[
{
identifiers: [ 'foo', 'baz' ]
url: 'https://example.com'
}
]
So the two pages refers to the same thread. Which is annoying.
And if you now want to change it to history
mode, so foo
page will have url
of https://example.com/foo
.
But remember that it searches first for foo
identifier? And it matches the one and only thread that we have.
The same with the baz
.
So you need to clear up all the database first (thus delete and create new), and then don't forget to use history
mode.
@alijaya Thank you so much for your input. I'll do that and check in later today. This sounds promising.
@alijaya Awesome, I had not noticed the hash in the URL, thanks.
@alijaya That did, in fact, work. Great job finding that.
@ktquez you may want to add this to your notes/readme. "Must use History Mode in order for this plugin to work, if you have multiple pages that require Disqus."
Thanks for the help, everyone.
@mjalindahl I'll add yes, thank you
cool :D... great to hear that :D
I have gotten vue-disqus to show up, but each page has different results on whether or not it's going to show old comments or blank comments.
I have tried:
<vue-disqus shortname="name" :identifier="$route.params.id"></vue-disqus>
Nothing seems to be working. Is this a good way to do it? Basing it off the url? You can see the
identifier
andurl
are being set.Thanks in advance.