Posts: 33
Threads: 7
Joined: Jul 2020
I am trying to integrate Commentics into a flat file based blog using .md as the extension of the blog title. The posted blog has the following display:
https://domain/blogfolder/post/name-of-article
However, as noted above the article is posted to the content folder as name-of-article.md
I have been able to get the Commentics form to show up in the place I want it to (at the end of the article) and have been able to post a comment which is then displayed. The problem is that the same comment is displayed at the end of every article. I can't seem to figure out what identifier I should use.
The blog in question is HTMLy and while I really like the blog, their support is non existent. Any assistance would be much appreciated.
My Blog Location
Posts: 2,905
Threads: 59
Joined: Jun 2010
Have
you completed
the interview?
Posts: 2,905
Threads: 59
Joined: Jun 2010
Or extract only the last segment from the URI, e.g. 'computers-and-me'.
Have
you completed
the interview?
Posts: 33
Threads: 7
Joined: Jul 2020
How would I go about extracting only the last segment as trying your other suggestion did not work because the same comment is displayed at the end of each article.
Here is what I have and I am not positive the $cmtx_identifier is correct.
<?php
$cmtx_identifier = 'post/';
$cmtx_reference = $_SERVER['REQUEST_URI'];
$cmtx_folder = '/commentics/';
require($_SERVER['DOCUMENT_ROOT'] . $cmtx_folder . 'frontend/index.php');
?>
Posts: 2,905
Threads: 59
Joined: Jun 2010
Have
you completed
the interview?
Posts: 33
Threads: 7
Joined: Jul 2020
Interesting...I posted a comment to each of the articles I have on the blog and they were displayed at the end of the article, but when I went back to the blog and clicked on the article, the comment was not there, for either article. Nothing else has changed so no idea what could cause this. BTW, the two comments have been inserted into the database so the problem seems to be that they are not being displayed.
Posts: 33
Threads: 7
Joined: Jul 2020
Does using the
Code:
$_SERVER['REQUEST_URI'];
apply if I am using the iFrame method?
Posts: 2,905
Threads: 59
Joined: Jun 2010
Technically yes you could still use $_SERVER['REQUEST_URI'] for the iFrame method like this:
Code:
<script>
var commentics_config = {
'identifier': '<?php echo $_SERVER['REQUEST_URI']; ?>',
'reference' : 'Page One'
};
</script>
But it might be better to use JavaScript like this:
Code:
<script>
var commentics_config = {
'identifier': window.location.pathname,
'reference' : 'Page One'
};
</script>
Have
you completed
the interview?
Posts: 33
Threads: 7
Joined: Jul 2020
What other options are there for 'Page One', or is that the only option. What is the reference referring to?
Posts: 33
Threads: 7
Joined: Jul 2020
Good news and bad news...
The good news is that the comments are being posted, the bad news is that the same comment is being posted to all of the articles and it doesn't matter if I use the javascript method or the iFrame method. The same problem is still the problem...I can't figure out the identifier for the HTMLy flatbase blog system.