Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-01-16 14:03:31
- cabes
- Member
- Registered: 2008-01-01
- Posts: 28
Adjusting behavior for the comment submit button?
I was wondering if there is a way to set up the comments so that, when you write a comment and press submit, it forwards the user to another section of the site that then displays a list of all the comments, with maybe just the article title at the top.
I have it set up right now so that the comment form is automatically displayed next to the article, but want it so when you click the submit button, it sends you to the comments section; a different page on the site.
I think I might be close to figuring it out, maybe just by creating my own submit form or something, but im definitely confused, and was hoping I might could save some time and effort.
Thanks a bunch!
Caleb
Offline
Re: Adjusting behavior for the comment submit button?
Try this at top of your pagetemplate, right at the top:
<txp:php>
if(gps(commented) == 1) {
$path = site_url().'mysection-or-path'; // Your path here
header("HTTP/1.x 301 Moved Permanently");
header("Status: 301");
header("Location: ".$path);
header("Connection: close");
}
</txp:php>
It will redirect you to your desired path when comment is submitted. Change the $path
at the code to fit your needs.
Cheers!
Offline
#3 2008-01-17 14:44:21
- cabes
- Member
- Registered: 2008-01-01
- Posts: 28
Re: Adjusting behavior for the comment submit button?
nice! thanks, i appreciate it.
Offline