# Stacks4Stacks Comment stack question

**URL:** <https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424>\
**Category:** RapidWeaver Classic\
**Created:** [August 23, 2021, 2:15pm UTC](https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424 "2021-08-23T14:15:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dave/32/147_2.png) [@dave](https://forums.realmacsoftware.com/u/dave)\
**Post date:** [August 23, 2021, 2:15pm UTC](https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424/1 "2021-08-23T14:15:08Z")

</div>

I would like to add a @willwood CommentStack to a blog that I have behind a firewall. But, the only way that I can see it working is if there’s a way to give the stack some kind of ID so that a Permalink macro could be used. Otherwise, the same comment thread will appear across all blog posts. I’m wondering if this is possible, **or if someone has implemented some sort of simple commenting process on TCMS blogs** (I am not interested in anything someone has to log into, such as Fb or Discus, since this is an intranet of sorts and behind a firewall). Just a simple way to comment on the relevant blog post.

---

<div class="post-metadata">

**Author:** ![dripple](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dripple/32/20481_2.png) [@dripple](https://forums.realmacsoftware.com/u/dripple)\
**Post date:** [August 24, 2021, 2:17pm UTC](https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424/2 "2021-08-24T14:17:33Z")

</div>

The database name is the field that makes each commenting stack individual.

If you paste the following code into the **Database Name,** you can pass a name via browser / query parameter.

`'.$_GET['database'].'`

Note the single quotes!

![CleanShot 2021-08-24 at 16.13.43](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/e/6/e69dc4b5134c6d991f50c9990380184bd6f6ad29.png)

Check out this quick example:  
[https://kitchensink.heiko.codes/comments/?database=database-001](https://kitchensink.heiko.codes/comments/?database=database-001)  
[https://kitchensink.heiko.codes/comments/?database=database-002](https://kitchensink.heiko.codes/comments/?database=database-002)

The database name must be letters and numbers only, similar to a blog page / slug.

Does this help?

**[Update]** As I wasn’t very clear in my answer: the term “database” was a bad example. We’re looking for an attribute from the the query url that identifies the page. So, according to my answer, you have to look for a query attribute that’s unique for each url / page, like the `permalink` attribute or sometimes something like `article-id` or similar, e.g.:

`https://www.myawesomeblog.xyz/blog/?permalink=trip-to-las-vegas`

Replace “database” from `'.$_GET['database'].'` with “permalink”, now the stack creates for each page a commenting database file with the name of the permalink.

---

<div class="post-metadata">

**Author:** ![dave](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dave/32/147_2.png) [@dave](https://forums.realmacsoftware.com/u/dave)\
**Post date:** [August 24, 2021, 4:41pm UTC](https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424/3 "2021-08-24T16:41:00Z")

</div>

Thank you, @dripple. I created several duplicate databases on the server and then added the code (exactly as you show it) in the stack; republished and refreshed the blog page a couple of times. It found the first db - but so did all of the other blog pages. That is, I’m not able to differentiate between them. Obviously user-error. Maybe I’m missing a step?

---

<div class="post-metadata">

**Author:** ![dripple](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dripple/32/20481_2.png) [@dripple](https://forums.realmacsoftware.com/u/dripple)\
**Post date:** [August 24, 2021, 5:59pm UTC](https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424/4 "2021-08-24T17:59:42Z")

</div>

There’s one step missing: the blog usually uses a slug or anything that indicates the blog page to display. That’s the part we need.

If you don’t mind sharing a url so I can have a look if I find something useful?

---

<div class="post-metadata">

**Author:** ![dave](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dave/32/147_2.png) [@dave](https://forums.realmacsoftware.com/u/dave)\
**Post date:** [August 24, 2021, 6:48pm UTC](https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424/5 "2021-08-24T18:48:17Z")

</div>

Yes, absolutely. The site is password-protected, so I will send you a DM. Thank you!

---

<div class="post-metadata">

**Author:** ![dripple](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dripple/32/20481_2.png) [@dripple](https://forums.realmacsoftware.com/u/dripple)\
**Post date:** [August 25, 2021, 11:11am UTC](https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424/6 "2021-08-25T11:11:14Z")

</div>

Dave, I quickly checked your blog and will post the solution here so we have a complete thread in case someone else has a similar question:

The missing link is the “permalink” attribute, so the code should read:  
`'.$_GET['permalink'].'`

Looks like this:  
 ![CleanShot 2021-08-25 at 13.09.01](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/4/f/4f2e239908aa67abace2ae0244918dc7db0318e3.png)

This creates for each blog entry a database file for the CommentsStack with the name of the blog page (aka the permalink).

This should do the job.

/heiko

---

<div class="post-metadata">

**Author:** ![dave](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dave/32/147_2.png) [@dave](https://forums.realmacsoftware.com/u/dave)\
**Post date:** [August 25, 2021, 12:44pm UTC](https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424/7 "2021-08-25T12:44:08Z")

</div>

**YES, YES, YES!!!**

Many thanks, Heiko, this works perfectly! I really appreciate your taking the time to figure out the solution and sharing it with us. All the best, Dave

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [September 24, 2021, 10:44pm UTC](https://forums.realmacsoftware.com/t/stacks4stacks-comment-stack-question/40424/8 "2021-09-24T22:44:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
