Page 1 of 1
Why doesn't s9y "jump" to a previewed comment?
Posted: Mon Apr 21, 2008 4:41 pm
by yellowled
Blogs powered by s9y (can) have a button in the comment form which displays a preview of the comment a user is about to submit. As far as I have been testing this with various templates, s9y does not "jump" to the generated temporary preview of the comment once the user hits "preview".
My question is: Why not? Currently, once a user hits "preview", the page is reloaded including the preview of the comment, but the part of the page the user gets to see is the comment form, which in my humble opinion is not the natural choice, the output a user would expect.
YL
Re: Why doesn't s9y "jump" to a previewed comment?
Posted: Mon Apr 21, 2008 4:52 pm
by garvinhicking
Hi!
Actually, simply because the ID "feedback" is the place where feedback happens to inform you of comment moderation etc. The preview simply jumps to the same place because 'preview' is just a modified version of 'submit'.
Technically it is impossible (without javascript) to divert a form action differently depending on the submit button you hit.
Thus, even though I like the idea of jumping to the comment instead of the form, it can introduce unwanted side-effects.
Regards,
Garvin
Re: Why doesn't s9y "jump" to a previewed comment?
Posted: Mon Apr 21, 2008 7:56 pm
by yellowled
garvinhicking wrote:The preview simply jumps to the same place because 'preview' is just a modified version of 'submit'.
Technically it is impossible (without javascript) to divert a form action differently depending on the submit button you hit.
Well, currently, every comment has a unique id, right? Even the previewed comment is assigned an id, although it is missing the {$comment.id} part. How about jumping to
that id instead of #feedback? Maybe I'm not completely getting this, but in this case it would only be a matter of placing #feedback and possible messages properly, right?
garvinhicking wrote:Thus, even though I like the idea of jumping to the comment instead of the form, it can introduce unwanted side-effects.
What kind of side-effects? I don't mean to be a pain in the rear end about such a small thing, but I've seen this work without javascript in Textpattern, so I'm assuming it can't be that hard to implement ...
YL
Re: Why doesn't s9y "jump" to a previewed comment?
Posted: Tue Apr 22, 2008 10:13 am
by garvinhicking
Hi!
But the #feedback is the target of the form independently from which submit button you hit. You cannot change that ID unless you also want to break the usual form submission notifications.
What kind of side-effects? I don't mean to be a pain in the rear end about such a small thing, but I've seen this work without javascript in Textpattern, so I'm assuming it can't be that hard to implement ...
Do you have an example URL?
Regards,
Garvin
Re: Why doesn't s9y "jump" to a previewed comment?
Posted: Tue Apr 22, 2008 11:28 am
by yellowled
garvinhicking wrote:But the #feedback is the target of the form independently from which submit button you hit. You cannot change that ID unless you also want to break the usual form submission notifications.
So why not put the comment preview "below" that id in the output code?
garvinhicking wrote:Do you have an example URL?
Try any commentform at snookerblog.de
YL
Re: Why doesn't s9y "jump" to a previewed comment?
Posted: Tue Apr 22, 2008 11:43 am
by garvinhicking
Hi!
Okay, that site alwys jumps to #cpreview. In that blog it's not so hard because #cpreview and #feedback (where errors occur) would basically lead to nearly the same place.
However that blog does not have such situations where a nested comment could occur, where your preview comment would be first in list and you'd have to scroll to get to the bottom. In that case you would see your comment when you submit and would not notice that there might have occured errors!?
Regards,
Garvin
Re: Why doesn't s9y "jump" to a previewed comment?
Posted: Tue Apr 22, 2008 1:29 pm
by yellowled
garvinhicking wrote:However that blog does not have such situations where a nested comment could occur, where your preview comment would be first in list and you'd have to scroll to get to the bottom. In that case you would see your comment when you submit and would not notice that there might have occured errors!?
Which is exactly why I was suggesting to put the previewed comment right below potential error messages. I don't think it is necessary to preview the comment at the very same place in the comment thread where it will be displayed eventually (although I agree that it would be
nice to place it there).
How about a structure like this:
Code: Select all
<a id="feedback"></a>
[Feedback messages]
[Preview of the comment]
This preview could even be
additional to the one in the comment thread (which I assume would be hard to suppress).
YL
Re: Why doesn't s9y "jump" to a previewed comment?
Posted: Tue Apr 22, 2008 2:08 pm
by garvinhicking
Hi!
Hm, I always preferred to see my comment indented/nested at exactly the place where it would go later...so I'm not really in favor of moving the previewed comment to the place where error messages are shown...
Code: Select all
<a id="feedback"></a>
[Feedback messages]
[Preview of the comment]
I'm not sure if this is possible with the current templates, that would need to be tried. The comments are added to a commenstack that currently is printed in entries.tpl, not comment(s/form).tpl...
Regards,
Garvin