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
Why doesn't s9y "jump" to a previewed comment?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Why doesn't s9y "jump" to a previewed comment?
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
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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Why doesn't s9y "jump" to a previewed comment?
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: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.
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 ...garvinhicking wrote:Thus, even though I like the idea of jumping to the comment instead of the form, it can introduce unwanted side-effects.
YL
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Why doesn't s9y "jump" to a previewed comment?
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.
Regards,
Garvin
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.
Do you have an example URL?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 ...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Why doesn't s9y "jump" to a previewed comment?
So why not put the comment preview "below" that id in the output code?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.
Try any commentform at snookerblog.degarvinhicking wrote:Do you have an example URL?
YL
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Why doesn't s9y "jump" to a previewed comment?
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
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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Why doesn't s9y "jump" to a previewed comment?
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).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!?
How about a structure like this:
Code: Select all
<a id="feedback"></a>
[Feedback messages]
[Preview of the comment]YL
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Why doesn't s9y "jump" to a previewed comment?
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...
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
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]Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/