Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I have a problem similar to what was described in this post. In short: I have a commentable template to which comments cannot be posted.

And I think I know why this is. On our site I wanted to distinguish the blog items (news template) from the regular pages (index.php template) and display them in a seperate list in the admin UI: 'News'. News is clonable and commentable. On index.php I test if we are on the home page, if we are I then display the pages of masterpage 'News'. Index.php is clonable but not commentable.

When I dump values (on the home page when viewing news) I see that 'is_commentable' is true. However, what I think happens is that the comments are not posted to the master page for which they are being made but to the page from which they are actually called, which is index.php and which is not commentable. Hence the error that comments cannot be posted !

How to solve this?
I value the news items having their own list (the news maintainers are not very tech-savvy). I also migrated the content of the old site to the new one already, which was quite some work. Simply backporting all to index.php is not desired and does not seem possible without rework. Making index.php commentable has the undesired side effect that all my regular pages (about us, etc) will become commentable which is not what I want. What to do? How can I make comments work?
"I have never tried that before, so I think I should definitely be able to do that" - Pippi Longstocking
Hi,

Comments are supposed to be posted on the 'page_view' of any clonable template (i.e. while visiting a single cloned page of the template).

So if you are displaying the 'news' items on index.php, to comment on any particular news item you'll have to first make the visitor reach the 'page_view' of news.php (else you'd be trying to post the comment to index.php itself which won't make sense).

Usually, while listing pages, we make their titles link to their page-view. The visitor clicks on the title to see the page in its full and can also comment on it.

If you absolutely must accept comments on the listing page then one way could be to use AJAX - make the comment form submit to the page-view of news.php in the background. I, however, don't think we have any sample code around for this approach so you'll have to manage it on your own.
I managed to solve it.

I changed my news.php page in such a way that the "leave a comment" link now does not expand the comments section anymore but instead redirects to the page view of the news item itself, and to the #comments id.

So in effect the news list on index.php is left by the user, and the page view of news.php is entered, displaying only one news item, precisely as you suggested. But the user experience is still quite good, as not much seems to change: the user is presented with the same news item, is being forwarded to the comments section right away and thus now can see the comments and a textarea to enter his or her own comments.
"I have never tried that before, so I think I should definitely be able to do that" - Pippi Longstocking
3 posts Page 1 of 1