Version 1.0.0 : 15th July, 2009
Rather annoyingly, ExpressionEngine doesn’t allow you to specify which page you’d like a visitor to see after he has submitted a comment.
Working around this limitation generally involves manually recreating the comment form, and hoping nothing breaks the next time you upgrade EE.
SL Comment Redirect removes the requirement for ugly hacks, making it easy to specify a redirect URL with a single hidden form field, as follows:
{exp:comment:form}
<!-- Other form fields -->
<input type="hidden" name="sl_comment_redirect" value="http://target-url.com/">
{/exp:comment:form}
Read the full documentation and download the extension from my site.
Cheers, Stephen
Sounds a bit like the extension I made a while back 😉
I’m sure from looking at yours though that it probably works a lot better or does something that mine doesn’t.
Best wishes,
Mark
Sounds a bit like the extension I made a while back
Bloody hell Mark, you could’ve told me before I wasted those 5 minutes building it. As you may have gathered from that statement, it’s very simple, so I doubt very much it does anything extra / better than yours.
Cheers, Stephen
Sounds a bit like the extension I made a while backBloody hell Mark, you could’ve told me before I wasted those 5 minutes building it.
Well if you’d asked I might have. As it stood I had no idea you were writing one, I’m not psychic you know. Well not yet anyway. I’d really like to be a truth wizard though as I believe I already do that in life anyway 😉
Took me at least 6 minutes for mine so yours is better already! 😉
Best wishes,
Mark
Hi Guys
I’m using Mark’s Comment Redirect and it works great. I do have one question I’m hoping one of you will be able to help me with.
I would like to redirect to an anchor in the page.
This:
<input type="hidden" name="sl_comment_redirect" value="{exp:weblog:entries weblog="equine-news" limit="1" status="Open" disable="member_data|comments|trackbacks|pagination" }{title_permalink="equine-news/read#reader-comments"}{/exp:weblog:entries}">
Gives me this: http://www.mysite.com/equine-news/read/#reader-comments/new-horse-owners-guide/
It does work without the anchor, but it would be a nice touch if the page loaded down by the comments. I’m still pretty much a newbie and am unsure how to formulate the link.
Appreciate the help, Cheers! Jules
Within the comment li tag I’ve added an anchor
<a name="comment{comment_id}"></a>
And updated my hidden redirect field to:
<input type="hidden" name="sl_comment_redirect" value="{exp:weblog:entries weblog="equine-news" limit="1" status="Open" disable="member_data|trackbacks|pagination" }{url_title_path=equine-news/read}#comment{comment_id}{/exp:weblog:entries}">
This is what I get http://www.mysite.com/equine-news/read/new-horse-owners-guide/#comment{comment_id}
I don’t understand why the ee code {comment_id} isn’t rendering. Any ideas?
Cheers! Jules
Jules,
According to the docs, the {exp:weblog:entries} tag doesn’t support a {comment_id} variable.
Cheers, Stephen
Hi Stephan
Thanks for the heads up. I did a lot of reading today and still couldn’t find a way to map directly to the comment. I’ve settled for just redirecting back to the article page, but if you happen to know how get the mapping correct I’d really appreciate the info.
I spent a lot of time going back and forth trying to figure it out on this thread: http://ellislab.com/forums/viewthread/159679/
Cheers! Jules
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.