Can I link comments to a collection like articles?

Topic summary

A user asks whether comments can be linked to a collection in the same way articles are associated with collections.

Proposed Solution:

  • Use a tagging system with a specific prefix (e.g., β€œar:test”) applied to both the collection and related articles
  • Create an AJAX search template (with layout=none) that queries articles by tag and displays their comments using Liquid code
  • Use JavaScript to call the AJAX search URL (e.g., /search?q=ar:test&type=article) and display results on the collection page
  • Parse collection tags with the β€œar:” prefix to determine which articles to retrieve

Status:
The original poster plans to test this approach and report back. The discussion remains open pending implementation results.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

I am wondering if I can connect an array of comments to a collection much like articles has comments.

Hi @ewelsh

You try add a tag to collection and the article. After that base on this tags to get all articles and all comments to show on collection. May it will have a little complex. I just suggest a solution here for you.

EX: Test collection β†’ add tag (ar:test)

A article β†’ add tag (ar:test)

B article β†’ add tag (ar:test)

C article β†’ add tag (ar:test)

  1. In the collection page. Foreach tags if tag has a prefix = ar: after that get this tag

  2. create a search ajax template with layout=none β†’ base on results write liquid code to show comments here.

  3. Use javascript to call ajax search page-> URL: /search?q=ar:test&type=article ( replace ar:test = tag thay you found in step 1)

  4. Show result of ajax on collection page.

1 Like

I will give this a go and report back, thank you!