I want my default category on my forum to be General, but I also want a separate category for all the blog comments.
- 5 replies
This can be done. The blog comment discussions get created in whichever category has its external ID set to
If you created a blog comments Talkyard site, there'll be just one category, named Blog Comments, and with its external ID set to
embedded_comments. But you cannot see it — by default, categories are hidden, when you create a blog comments site. But if you enable forum features (in the Features settings page, see below), and thereafter create a General category, then, the blog comment will still get created in the Blog Comments category and things should work like you want.
If you created a forum, (which you did, if you can see any categories, which seems to be the case, since you mentioned the General category)
then, you can enable the API in the admin area, and then create a Blog Comments category yourself, and give it the
embedded_commentexternal ID — as folllows:
Go to the Features settings page: Click your username to the upper right, then click Admin, then, in the menu to the left, click Features. (Here's a URL:
https:// talkyard /-/admin/settings/features)
Tick the Enable API checkbox, then Save at the bottom (otherwise the External ID setting won't appear).
Go to the categories page:
https:// talkyard /categories
Click Create Category.
At the bottom of the new category dialog, click External ID (optional): None, and copy-paste:
embedded_comments. Click Create, to create the category.
(I forgot) Edit the embedding HTML code in your blog: Add:
data-category="extid:embedded_comments"so it looks like:
<div class="talkyard-comments" ... data-category="extid:embedded_comments" />
Now, discussions for new blog posts, should get created in that embedded comments category.
Please let me know how it goes?
It didn't work for me. Enable API was already enabled, and I changed the external ID of my existing blog category to
embedded_comments. The topics are still being created in General. I also tried changing the external ID of General to something else (
general) but that didn't help.
Oops sorry. You'll need to add this to the embedding HTML pages:
data-category="extid:embedded_comments"— otherwise the embedded discussions get created in the default* category.
(* What's the default category? In the edit category dialog, there's a checkbox:
[ ] Set as default categorywhich: "Places new topics in this category, if no other category selected".)
So, the embedding HTML snippet would look something like:
<div class="talkyard-comments" data-discussion-id="..." data-category="extid:embedded_comments"/>
data-category="extid:abcdtells Talkyard to place the comments in the category with external id "
(And, as you might have noticed, if you have many blogs, you could have comments from each blog, end up in its own category — by using different
extid:...for different blogs of yours.)
( Probably not, but If you'd like to look at an end-to-end test, there is one: https://github.com/debiki/talkyard/blob/main/tests/e2e/specs/embedded-comments-category-refs.2browsers.test.ts )ReplySolution