Make possible to show more tagging form on a page
avivalma - November 3, 2008 - 18:03
| Project: | Community Tags |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
This patch makes possible to show multiple tagging forms (for different nodes) on one page.

#1
#2
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
#3
subs
#4
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.#5
Doesn't work. Community Tags 6.x dev.
#6
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
#7
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.
#8
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?
#9
This problem has been fixed (using the techniques described above) in the newest dev release.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.