We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

SL Comment Redirect : version 1.0.0

Development and Programming

Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Version 1.0.0 : 15th July, 2009

* Initial release.

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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Sounds a bit like the extension I made a while back 😉

Comment Redirect Extension

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

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
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

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
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.

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

       
JulesWebb's avatar
JulesWebb
271 posts
15 years ago
JulesWebb's avatar JulesWebb

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

       
JulesWebb's avatar
JulesWebb
271 posts
15 years ago
JulesWebb's avatar JulesWebb

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

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
15 years ago
Stephen Lewis's avatar Stephen Lewis

Jules,

According to the docs, the {exp:weblog:entries} tag doesn’t support a {comment_id} variable.

Cheers, Stephen

       
JulesWebb's avatar
JulesWebb
271 posts
15 years ago
JulesWebb's avatar JulesWebb

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

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.