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

avivalma - November 3, 2008 - 18:06
AttachmentSize
community_tags.patch 1.63 KB

#2

patchak - January 10, 2009 - 12:52

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

giorgio79 - March 29, 2009 - 05:13

subs

#4

bowenzbiz - July 15, 2009 - 06:08

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

bowenzbiz - July 15, 2009 - 04:20
Status:needs review» active

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

#6

entrigan - August 12, 2009 - 05:37

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

entrigan - August 12, 2009 - 00:18

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

entrigan - August 27, 2009 - 06:47

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

entrigan - August 29, 2009 - 17:33
Status:active» fixed

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

#10

System Message - September 12, 2009 - 17:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.