Is it possible to put comments on a separate tab when viewing the node? Or, even, automatically putting them into a forum topic? I know there is the comment mover module, but this module does not appear to automatically move comments from a node to the forum. It seems that it has to be done by hand.

Comments

djorn’s picture

What I have in mind is similar to the "talk" page you often see on wikipedia. I'm trying to implement a wiki-style system in drupal using revisions, but would prefer that any discussion about the page appear on a different one rather than below the node itself. Any suggestions on how to do this?

Anonymous’s picture

I'm looking for the same thing. Did you found a solution on how to do this ?

Thanks.

toemaz’s picture

Hi guys,

I'm looking for the same thing. Did you look already in the CVS if there is a project out there or did anyone started coding yet?

What about the idea that comments are tagged with a link to the revision. This means you can have a comment list (the way you see it in mailinglists) which you can filter on a specific revision which might be useful.

Let me know if you are still looking for a solution, so I can have some help when I start coding.

Anonymous’s picture

I didn't find any solution, the way comments are displayed is my only problem with Drupal :-/
I'd like to find a way to display all the comments in the forum but it's impossible with Drupal.

toemaz’s picture

What do you mean with display all the comments in the forum? The title for this topic is 'Putting comments on a separate tab when viewing node'. Are you looking for the same tab solution?

Perhaps the your request can be combined with the original request: the tab is loading a thread from the forum.

Anonymous’s picture

Yes Toemaz :)

I'm looking for the same tab solution but I also have another thread about putting ''All the website comments in the forum'' I've explained it here http://drupal.org/node/122839

toemaz’s picture

Bumathan, this is an interesting idea. But I'm thinking what would be the advantage of that, so it is simply separated right?
So the tab solution would be good for you as well? It just needs to be a separated page if I understand it well.

Anonymous’s picture

Exactly Toemaz. It just needs to be a separate page. I don't want the comments to be displayed under the article.

I hope you will succeed in developing something for that :)

Good luck.
Matt

toemaz’s picture

I just created a test module for comments in a tab: displayed under the tab 'dicussion'. Because this requires modifications on the core comment module, I will now create a test module for your 'forum' idea.

toemaz’s picture

I created a module for testing the comments in a tab feature. Its for 4.7.x. You can download it here
http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/toemaz/commen...

Installation instructions
----
Download to a comment_tab directory and enable the module.
Under admin > settings > content type: select the content type you would like a discussion tab for and check the 'Show comments in a separate tab' checkbox.

You will see that the comments will still appear under the node. Thats bc the comment module needs to be patched. But this is just a proof of concept.

Anonymous’s picture

I can't believe you did this and you're gonna work on my idea too ! Great !
I'm gonna try it right now ;)

Thank you very much.
Matt

EDIT /// hum, I just saw it's for 4.7 but I use Drupal 5, I can't test it.

toemaz’s picture

toemaz’s picture

I just upgraded the test module so that the comments are not shown under the node, but just under the discussion tab. There is just one more thing to do: make sure that after you add a comment, you are not redirected to the node page, but to the discussion tab. I don't have a clue yet how to fix this.

Anonymous’s picture

Thank you for the Drupal 5 version.
I think it's not a big problem for the redirection.

Oh, by the way, is it possible to display the number of comments under the node ?

toemaz’s picture

display the number of comments under the node
Thats a theming decision. You can get it via $node->comment_count

toemaz’s picture

I added a fix for redirecting to the comment tab.
Any suggestion whether this is a good name for this module?

Anonymous’s picture

Cool !
Yes I think it's a good name, quite understandable for the users looking for such a module in the repository.

Anonymous’s picture

I've tried to install the module for Druapl 5. I've uploaded the file in a comment_tab directory. Now I want to enable it but the module is not displayed in the module list of the administration panel. Do you know what can be wrong ?

Anonymous’s picture

I remember why I needed to display all the comments in the forum : It's a design problem.
The forum doesn't have the same width that the others nodes and it wouldn't be easy enough to have two different submission forms etc...

That was the reason :)

B.T.W I've tried many possibility with the module but it doesn't work for me...

toemaz’s picture

I moved the comment_tab module for 5 into the sub dir comment_tab under
http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/toemaz/

Download the 2 files (.module and .info) and install them under a subdir in Durpal 5.

The single file comment_tab was the older 4.7 version. You were probably using that one.

Anonymous’s picture

OK, now I've installed it and made the configuration.
Did you test it on Drupal 5 already ? because the old comments (before module) are still displayed under the nodes. On the nodes that don't already have comments, the "Post comment" link is not displayed anymore.
Maybe I've got the wrong file again, I'll check this and let you know Toemaz ;)

toemaz’s picture

Besides these problems, there is one major problem that came up: All links to comments in a Drupal website are build like node/$nid#comment-$cid. In fact this should become node/$nid/discussion#comment-$cid. I don't know whether I will find a URL rewriter in Drupal for doing something like this.

toemaz’s picture

I think I will abandon the 'comment_tab' module due to this persistent 'comment url' problem. With php you can't catch the url fragment #comment-cid# because its not being sent to the server, it's stays at the client side.

There are 2 solutions for this issue

  1. rewrite all comment url's for the node types you want the comment tab for: ugly hack
  2. perform at the client side a redirect with javascript, or change the url in advance with javascript: even more ugly

I think I will stop developing this module unles someone comes up with a better idea.

Anonymous’s picture

Too bad, but if there si no other solution...

I suppose you'll stop the developement of the comment_forum module too ? Maybe you'll have the same problem, no ?

toemaz’s picture

Maybe I was to fast with posing to stop on it. The solution might be simple but a little confusing.

Just because default blocks/views for recent comments are linking to node/nid#comment-cid, doesn't mean this module is worthless. No, it just has to define it's own block/views with the right links node/nid/dicussion#comment-cid.

What do you think about this?

Anonymous’s picture

In fact, this module is not wothless at all, it can improve many Drupal websites.

Your solution may be a possible one but I'm not sure to understand it well because I consider the problem differently.

On my website, in fact I don't use the tabs, I've found other solutions ---> for the edit link, I did it like this for example :

<h3><?php if (user_access('administer nodes')): ?>
<a href="<?php global $base_url; print $base_url;?>/node/<?php print $node->nid ?>/edit" title="
<?php print t('Edit') ?>"><?php endif; ?><?php print $title; ?><?php if (user_access('administer nodes')): ?></a><?php endif; ?></h3>

With your module, I would try to write something like that at the bottom of the node :

<span><a href="CORRECT LINK TO DISCUSION PAGE"><?php print $node->comment_count; ?> commentaire(s)</a></span>

Could you explain the solution in other words please ?

toemaz’s picture

I can explain the issue very easily via the 'recent comments' block. Just enable it and click on one of the comments which is directing to a node type for which the comment tab is enabled.

You will see the comment title in the block is linking to: node/nid#comment-cid
But the comments are moved to: node/nid/discussion#comment-cid
So we have a problem here.

My proposal was to create a view or a block for this specific module. There is no other solution according to me. Only this way, the module will be useable out of the box.

toemaz’s picture

The post comment link is moved under the comment tab.

Concerning the comments displying under the node, I can't reproduce that but I guess it all depends what code is performed first:
$node->comment = 0 or comments_render in the node_show function.

Can you try on a different drupal 5 installation perhaps?

Anonymous’s picture

Regarding the url rewriter problem, I use a module called "pathauto". It automaticaly rewrites the url, maybe it's a stupid proposal, I don't know....

I'll try to install a new Drupal 5 on my server tonight...

Good luck Toemaz !
Matt

EDIT //// Au fait, on peut peut-être parler en français aussi ? ça sera toujours meilleur que mon anglais non ? Bref, si tu as besoin d'aide...

toemaz’s picture

Alors, vous parlez français? Je ne savais pas qu'on parle Français à Cambodja. You can continue in French, I prefer English because everyone can understand me.

The pathauto is not an option. The solution is posed on: http://drupal.org/node/102379#comment-208458

Anonymous’s picture

Effectivement, je parle français, la Cambodge, c'était pour brouiller les pistes quand je me suis inscrit à Drupal il y a un an...

So, you're right it's better to speak english for the others ;)

Well, i've installed a new Drupal 5 on my server to test the module, here are the final results :

- "Discussion" tab is displayed fine.

- Clicking on this tab redirects to the correct page but no submit form or button are displayed.

Anonymous’s picture

Works like a charm with the latest version ! Great job Toemaz :)

toemaz’s picture

Ok, thx for testing!

Anonymous’s picture

I'm gonna install it on my production website, wainting for the forum_comment_module (If you still plan to work on it).

How would you write the link to the discussion tab ?

toemaz’s picture

Since I might have a reasonable solution, the forum_comment.module is not in my mind anymore.

How would you write the link to the discussion tab ?
Euh, can you translate in French? ;-)

Anonymous’s picture

Yes sorry,
Quel serait le lien générique à écrire pour envoyer vers la page de discussion ?
Plus haut, je disais , que je n'utilise pas les "Tabs" sur mon site mais plutôt des liens textuels. Je voudrais afficher le nombre de commentaires en bas de page et quand on clique dessus, on est redirigé vers la page de discussions pour poster un commentaire.

J'espère qu'une solution ou un début d'idée viendra un jour pour le comment_forum_module, mais en tous cas, très beau travail pour le comment_tabs module :)

Merci :)

toemaz’s picture

  • I guess you can use 'node/$nid/discussion' for you links.
  • Concerning the number of comments: you may want to look for the php function in comment.module that gives you back the number of comments.

The comment_forum.module as you described is far far away now.

Anonymous’s picture

<a href="/node/<?php print $nid; ?>/discussion"><?php print $node->comment_count; ?> comment(s)</a>

Thanks.

toemaz’s picture

I just found a duplicate module: http://groups.drupal.org/node/2931
It seems this rötzi has it developed a little more. I'm cursing myself now that I didn't look any further.

Anonymous’s picture

Indeed.
But if the module is not in the main repository, we can't guess it exists. The Drupal with Drupal contribs. Maybe a forum module exists too, I'll have a look :)

toemaz’s picture

Because rötzi is really pushing the wiki for Drupal, I will abandon my module and help him out. This is the end ;-(

mohamadaliakbari’s picture

is there any module like this for drupal 6?