This patch makes possible to show multiple tagging forms (for different nodes) on one page.

CommentFileSizeAuthor
#1 community_tags.patch1.63 KBavivalma

Comments

avivalma’s picture

StatusFileSize
new1.63 KB
patchak’s picture

I tested this patch, and it works really well, there is a noce popup form that appears and allows to tag nodes directly from the teaser.

I would really recommend to test this and commit it!!

Patchak

giorgio79’s picture

subs

bowenzbiz’s picture

Status: Active » Needs review

Doesn't work. Community Tags 6.x dev.

It shows nid undefined, in full node view.

var nid = $('input[@name=nid]', this.form).val();

I had changed code to

var nid = $('input[name=nid]', this.form).val();

It doesn't work, too.

There is no <input name=nid ../> element in the tag form.

bowenzbiz’s picture

Status: Needs review » Active

Doesn't work. Community Tags 6.x dev.

entrigan’s picture

After looking into the issue, the patch fails because the JS looks for the node id in the form, but it is not there. To make it work the form needs another element that includes the NID (right now it has an element of type="value" which does not reveal itself in the HTML. The following code placed in the function "community_tags_form()" in the file "community_tags.pages.inc" should make the patch work again:

<?php 	
$form['nid'] = array(
  '#type' => 'hidden',
  '#title' => t('NID'),
  '#value' => $edit['nid'],
);
?>

EDIT: Changed the code to something better

entrigan’s picture

Status: Needs review » Active

Note: this only allows for multiple ComTag forms on one page. To actually make them appear you need to add something like

$output=community_tags_node_view($node, TRUE);
print $output;

in a node template file.

entrigan’s picture

I feel like this solution is a bit hacky... (passing the nid in a hidden form item and then grabbing it with jquery. The issue is the js needs a unique way to identify each form. Ideas?

entrigan’s picture

Status: Active » Fixed

This problem has been fixed (using the techniques described above) in the newest dev release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.