Annotate from a Panel

asak - October 2, 2008 - 23:21
Project:Annotate
Version:6.x-1.x-dev
Component:annotate (private)
Category:feature request
Priority:normal
Assigned:clemens.tolboom
Status:postponed (maintainer needs more info)
Description

I tried the code from here but it doesn't work in panels.

Any idea how this can be accomplished? maybe adding as a block 1st...?

#1

asak - October 6, 2008 - 20:08
Title:Panels integration» Annotation in a block

Still trying to get the annotation part of a node into a block to place it into panels...

I tried with a PHP block, using the code mentioned on http://drupal.org/node/181658 and on http://drupal.org/node/176114.
I tried as a custom PHP content on panels, and tried inserting the code as a cck field - none seem to work.

I wish annotation provided a block... hint hint ;)

Thanks !

#2

asak - October 6, 2008 - 22:01

(a little later...)

Ok.. so to get the form to display, it's possible to use the following code:

<?php
print drupal_get_form('annotate_private_entry_form',$node);
?>

BUT - When i place this in the body of a node, after writing some text and clicking 'update' - i get the empty textbox again!
I do get a "Your annotation was saved." msg. - but it doesn't display the text and i see no 'annotations' tabs.

This is the same for nodes which i allow annotations and node which i don't allow.

Some help please... thanks!!!

#3

clemens.tolboom - October 7, 2008 - 14:42

Using

<?php
print drupal_get_form('annotate_private_entry_form',$node);
?>

in a block will not help you. Which node is there for the block to display? The block is page related not node.

When in the 'body of a node' the $node could still be empty so won't display the 'right' content.
(submitting the form should have given an error I guess due to an empty node-id but did not :-( )

So what is it what you want to accomplish? Using annotations with panels? Have a themed annotation form?

If you need this panels integration you could offer a bounty ;-)

#4

asak - October 7, 2008 - 20:16
Title:Annotation in a block» Annotate from a Panel

Ok... i'm getting a bit close...

Now i'm using the following code, to display the fieldset correctly, and even to save the annotaion with all correct fields (including UID and NID!) - BUT - the textblock refuses to show the annotation after submission (i can only see it in the database)

<?php
$node
= node_load(arg(1));
print
drupal_get_form('annotate_private_entry_form',$node);
?>

I'm now assuming (for no good reason really) that there are some $node->something in the code that since they were not supplied fail to retrace the correct form.

But i'm going to check into this (and give the "support request" feature a chance) before offering a bounty for now...

Any help - much appreciated!

Thanks !

#5

asak - October 8, 2008 - 09:10

and just to make sure:

Is drupal_get_form('annotate_private_entry_from') the correct form?
Is that the call a page does to get the annotation if existing?
Or is the the API i should be using?

#6

asak - October 16, 2008 - 21:00

Ok so i found i'm going the wrong way and got enough of this (i'm a stubborn bastard...).

Soo... what bounty should suffice this feature request?

#7

clemens.tolboom - October 17, 2008 - 15:57

In #3 (http://drupal.org/comment/reply/316477#comment-1047517) I asked you what you want to accomplish because it is still not clear to me.

What steps do I have to take to reproduce your site wish? Not your code :-)

If that's clear maybe your problem is easily solved. If not you can offer me a bounty through my contact page :-)

#8

asak - October 17, 2008 - 19:27

The problem: That code, placed in a custom php block, placed in a panel, will not pull an existing annotation into the textbox.

What i'm trying is to display the Annotations textbox for a page - inside a panel.
I'm overriding node/x with a panel page, and so need the form that is by default added to the bottom of the page of the selected content types to appear in a panel.

Using the above code, pasted into a custom block and placed in a panel, i'm able to present the form that panel, and have users save the annotations they write, BUT after a refresh the form is EMPTY. If i bypass the panel display after submitting an annotaion, and view the node without panels, i can see that the text written in the textbox from within the panel is saved correctly. Looking at the database records, i can see that the annotation was indeed saved correctly.

So, basically, the only problem is that when the form is displayed it doesn't show the current annotation for that user for that page. it displayes an empty form, which will only allow to overwrite the existing annotation.
That's not good ;)

Hope i'm clear...

You think this has an easy solution?

#9

clemens.tolboom - September 2, 2009 - 08:27

I guess we need a annotation block form?

#10

clemens.tolboom - September 2, 2009 - 08:30
Version:5.x-1.3» 6.x-1.x-dev

Not for 5.x

#11

clemens.tolboom - September 4, 2009 - 15:11
Category:support request» feature request
Assigned to:Anonymous» clemens.tolboom
Status:active» postponed (maintainer needs more info)

Hmmm ... with #222556: Multiple annotations per uid + nid it will be difficult what to place in a block when having multiple annotation available.

We do have more control over whether multiple is allowed. So I could create a block _only_ when no multiple is configured.

But this should mean to disable the form below the node when there is a block available. Can we do that? Or do we have to add a 'Suppress form per nodetype' admin configuration?

 
 

Drupal is a registered trademark of Dries Buytaert.