Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-26 23:49:01

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Comment Preview page position niggle

Hi all,

I’ve been struggling with a little problem for a while now and – although I’m sure the solution is obvious – it ain’t coming, so…

I use the following comments_form arrangement (basically a more or less direct copy of Example 1 here):

<txp:if_comments_allowed>
<txp:comments_form  />
<txp:else />
</txp:if_comments_allowed>

And it does exactly as you’d expect, except that on pressing Preview, instead of the refreshed page going to the previewed text, it goes right to the very top of the page – a bit of a pain when my articles might well contain half a dozen large images, a fair bit of text and a number of previous comments.

OK, it’s only a matter of scrolling back down to the preview to then Submit it, but there must be a way for the page to open in the “right” place automatically, and I can’t figure it out.

Any help out there, please?


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#2 2009-07-27 12:36:14

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Comment Preview page position niggle

Doesn’t it show #cpreview at the end of the URL after pressing the preview button? Are you perhaps using an outdated version?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2009-07-27 16:24:35

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: Comment Preview page position niggle

uli wrote:

Doesn’t it show #cpreview at the end of the URL after pressing the preview button?

Oh yeah, it does append that to the URL, Uli – but it seems to anchor to the top of the page rather than the previewed comment, which is not what I’d expect.

The only instance of “#cpreview” in the source is associated with the comment input form – but I notice that the previewed comment itself has the anchor “#c0”, and putting that in the URL instead of “#cpreview” does indeed go straight to the previewed comment.

That’s food for thought.

Thanks for your input so far – any flashes of inspiration on your part will be gratefully received!

(The Txp version is OK, incidentally).


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#4 2009-07-28 23:00:47

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: Comment Preview page position niggle

Anybody?


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#5 2009-07-28 23:12:46

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Re: Comment Preview page position niggle

Checking out my comment preview, it is my “this is a preview” notice that has the id of #cpreview:

<p id="cpreview">!! This is a preview. Click Submit to post your comment.</p>

So make sure you have something like this in your comment form, and you should be good to go!

Offline

#6 2009-07-28 23:23:09

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: Comment Preview page position niggle

Thanks Nora, I’ll look into that.

I’ve just noticed though, that the same behaviour I’m seeing happens on Textpattern.org too.

Here’s a longish post, and previewing a comment on it takes you to the top of the page, just like what’s happening on my site

Maybe I need to modify my expectations!

Last edited by keith (2009-07-28 23:23:26)


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#7 2009-07-28 23:33:43

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: Comment Preview page position niggle

Hugs and kisses, Nora – adding id =#cpreview to the <p> surrounding the comment_preview tag fixed the problem perfectly.

Very, very, very grateful!


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

Board footer

Powered by FluxBB