Help - Search - Members - Calendar
Full Version: Comment Anchors
Movable Type Community Forum > Additional Resources > Tips and Tricks
captivator
I have comment anchors set up for my comments. I was wondering if after the user has submitted their post and they are taken back to the comment listings, if they can be taken directly down the page to their comment? I thought it might be a neat feature, if possible. Thanks!
girlie
You could specify a redirect URL in the comment form, but the problem I see with that is you'd need the Comment ID to create an anchor to that specific comment - and the Comment ID isn't assigned until after the comment is posted.

Hmmm.
captivator
I didn't think it was (easily) doable. Thanks, though!

If anyone else out there has any ideas, I'd be very interested!
markpasc
The most forthright way would be to play around with the post sub of lib/MT/App/Comments.pm to get it to do what you want. If the URL is right except the missing anchor (which is what it sounds like), you may merely need to change line 153 from

CODE
return $app->redirect($link_url);

to

CODE
return $app->redirect($link_url .'#'. $comment->id);

or however you have the anchor configured.

If this doesn't count because it's not easy, I guess that's a "no." wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.