| 178 | Specifying the redirect page after comment post |
| 179 | ----------------------------------------------- |
| 180 | |
| 181 | To specify the page you want to redirect to after the comment has been |
| 182 | posted, you can include a hidden tag called ``next`` in your comment form:: |
| 183 | |
| 184 | <input type="hidden" name="next" value="page_to_redirect" /> |
| 185 | |
| 186 | Redirecting after a preview or error |
| 187 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 188 | |
| 189 | If you use the comment preview, or an error occurs in your comment post, |
| 190 | you will be taken to the template named ``comments/preview.html``. The value you specified for ``next`` |
| 191 | on your post page isn't automatically carried over to the preview page. |
| 192 | |
| 193 | You need to again specify the redirect page with a hidden form tag:: |
| 194 | |
| 195 | <input type="hidden" name="next" value="{{ data.next }}" /> |
| 196 | |
| 197 | ``data`` contains all of the posted values from the original comment post |
| 198 | page. ``data.next`` gives us the value of ``next``. |
| 199 | |