In the Drupal comments/ signature system, there is a usability problem with the signature.
The main problem is that, when adding a comment, the signature appears in the same line as the textarea that you are writing the content of your post. When you begin typing, your new text actually appears AFTER the signature (at least in Konqueror 3.2).
This makes it incredibly annoying for users because you have to go to the beginning of the textarea before you can type your data.
A corrolary to this problem is that, when quoting (using the quote module), the signature is included by default in the quote, which should not be the default behaviour.
It appears that the signature is being added to the actual body text of the comment, as opposed to being retrieved from the user's profile when the page is rendered.
--
From an engineering/design perspective, one possible way to fix this is instead of adding the signature text to the comment, instead retrieve the signature dynamically from the user's profile when the page is rendered. If you do this, not only do you avoid the above problems, but you also improve the flexibility of signatures (for example, changing it once will cause the signature to change in every comment you make). You can also use this design change to give the users a choice of when to display their signature (for example, by using a checkbox on the node that says, "Display your signature with this post").
--
Thank you.
Comment | File | Size | Author |
---|---|---|---|
#15 | signature-4.6.0.zip | 28.01 KB | ultraBoy |
#1 | signature_load_on_render-20050204.patch | 1.62 KB | irwin |
Comments
Comment #1
irwin CreditAttribution: irwin commentedIncluded: patch.
Changes explanation:
"theme_comment_form": the code to autoinsert the signature into the textarea is removed.
"theme_comment_view": code added to insert signature at the end of the $comment->comment data structure. I encase the comment in [p class="signature"] [/p] (with the correct brackets of course) so that a CSS theme can change the appearance of signatures.
Caveat: the sig still appears in the [div class="body"] of the comment theme.
Added function _comment_get_signature($uid), which gets a signature, given a user ID.
Caveat: this requires an additional query to the "users" table with every user comment.
Tested with:
- User without signature
- User with signature
- Anonymous poster
- Previewing
- Positng
- Editing a signature: expected result is that all signatures are changed to reflect the new signature.
Please let me know of any problems.
Comment #2
irwin CreditAttribution: irwin commentedReducing severity to "minor" because that's what it is.
Comment #3
Bart Jansens CreditAttribution: Bart Jansens commentedThe extra queries aren't necessary, the queries that are used to retrieve the comments already join the users table, just add u.signature to the select clause there.
I'm not sure if adding the signature to the comment body is the best approach, if you just keep it in a different field, themes can decide where to place it.
Note that usually admins will want to be able to use a different filter for signatures. Eg, allow bbcode in the comment body, but not in the signature.
I am using a similar patch on my own site (although it really needs to be updated), it never made it into core because it is difficult or almost impossible to create an upgrade path. I hope this can be discussed again, or at least made into an option for new sites, i'm surprised there haven't been more complaints about this ;)
Comment #4
irwin CreditAttribution: irwin commentedI realised as I was going to bed last night that the extra query was extraneous. :)
As for adding the comment to the comment body, the reason I would want to do that is for the signature to "appear" to be a part of the... well, comment body. That will avoid potential issues with some themes that aren't designed to handle signatures at all - for instance, a theme might put a border around the "body" part of the signature, and if it doesn't explicitly handle the signature, things can look very ugly and strange.
But I can see what you mean about Input Filtering. Do you have suggestions on how to improve that? I had one idea, and that was to add the signature as an argument to the theme, but that would require theme modifications fir signatures to be displayed.
If this patch is of interest I'll keep working on it and posting updates.
Comment #5
Steven CreditAttribution: Steven commentedHave you considered that not everyone might want retroactive signatures? It depends on the preference of the site owner I guess.
Comment #6
Steven CreditAttribution: Steven commentedBy the way, the comments are currently fetched with a single query. You could easily extend it to get the signature with a JOIN instead of doing a query per comment.
Comment #7
Bèr Kessels CreditAttribution: Bèr Kessels commentedPlease, no. Not a config optin for this. Choose the best default and optimise that. We must get /less/ options instead of more.
Another option (hehe) would be to make two tiny modules with signature-code in them, and remove all the signature code from user and comment.module.
one module would be: signature_static.module. That one would add signatures to nodes and comments like we do it now: concanate it to the $node->body on insert in the DB.
signature_dynamic.module would concenate on output, and not store the data in the DB with every comment and node.
Bèr
Comment #8
andremolnar CreditAttribution: andremolnar commented+1 to any approach that removes code from user.module. I've realized lately that user.module does too many things that might be better done as seperate modules that extend the core user module. In other words anything that makes user.module more modular is a great idea!
andre
Comment #9
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedRefactoring to pull the signature functio out if comment module (or make the standard overridable) is probably the way to go.
Comment #10
jakeg CreditAttribution: jakeg commentedWhat's the status of this?
My users badly want signatures to work so that when they chanage their signature it changes it on every one of there posts, such as in existing forum software.
Also, it means they don't have the comments box prefilled with their signature every time the post a comment, which is extremely annoying, especially when also using quote.module.
Comment #11
ultraBoy CreditAttribution: ultraBoy commentedI'm going to write a 'signature' module, to pull out signature functions from comments module. Now it's really annoying and not usable at all!
Comment #12
beginner CreditAttribution: beginner commentedAlso, any way to add some extra html, like
so that it can be styled differently from the post.
and what about attaching the signature in a new thread?
(by the way, I tried to preview this post, but when I click the button 'preview', the page reloads, but there is no preview at the top nor at the bottom of the post. My only option is to post without previewing)
B.
Comment #13
Marandb CreditAttribution: Marandb commentedI am also wondering if there is any update here.
I have been unable to locate a "Signature" module. Is there one in the works? Anything I can do to help out. (other than coding ;) )
This feature will be huge in making my site alot more user friendly.
Thanks,
-- Marand
Comment #14
Hosting Geek CreditAttribution: Hosting Geek commentedYea alot of people are going to be wondering as you have been PlanetSoCed: http://www.planetsoc.com/node/171
Comment #15
ultraBoy CreditAttribution: ultraBoy commentedmodule is ready - http://drupal.org/node/32777
Comment #16
(not verified) CreditAttribution: commentedComment #17
neablo CreditAttribution: neablo commentedHow can I make this module function with phptemplate??
Comment #18
Julien PHAM CreditAttribution: Julien PHAM commentedI should add too... will you create a cvs version of signature too?
Comment #19
ultraBoy CreditAttribution: ultraBoy commentedComment #20
ultraBoy CreditAttribution: ultraBoy commentedComment #21
ultraBoy CreditAttribution: ultraBoy commentedhttp://drupal.org/node/10938
Comment #22
apaderno