Free-Conversant Support / Control Redirects on Message Form Submission
 Home   About Conversant   Free Sites   Hosting   Support   XML-RPC 

Search



Documentation >> Misc. >> Control Redirects on Message Form Submission

Redirect the Browser After Submitting a Message Form

One of the weaknesses in Conversant's ability to mimic a flat discussion group (bulletin board) used to be that when you submited a __NewThread__, /reply, or /edit form, you ended up on the message page rather than the fullThread page that's usually used for a flat board.

We've solved that problem by allowing you to tell Conversant where the browser should go after a form is submitted.

(This is useful for more than just flat messageboards, of course, but we expect this will be the most common use.)

You do this by adding hidden fields to your message forms (you can even put these fields in the Message Edit template).

There are three message forms: one for creating new threads, one for replying to messages, and one for editing messages. Each of them supports at least two hidden fields, as follows.

Message Forms & Hidden Fields for Redirects

  • __NewThread__ Forms
    • hidden field: redirectOnNewThreadSuccess
      • where should the browser be sent after the new thread is created successfully?

      • special variable: #newMsgNum is replaced with the number of the newly created message

      • The following example would redirect the browser to the fullThread page for the newly created message, after the form is submitted.

        <input
         type="hidden"
         name="redirectOnNewThreadSuccess"
         value="<!--#siteUrl-->fullThread$msgNum=#newMsgNum"
        />


    • hidden field: redirectOnNewThreadCancel
      • where should the browser be sent if the form is cancelled?

      • supports no special variables

      • The following example would redirect the browser to the home page if the form is cancelled.

        <input
         type="hidden"
         name="redirectOnNewThreadCancel"
         value="<!--#siteUrl-->"
        />


  • /reply Forms
    • hidden field: redirectOnReplySuccess
      • where should the browser be sent after the reply has been posted successfully?

      • special variable: #newMsgNum is replaced with the number of the newly created message

      • The following example would redirect the browser to the fullThread page for the newly created message, after the form is submitted.

        <input
         type="hidden"
         name="redirectOnReplySuccess"
         value="<!--#siteUrl-->fullThread$msgNum=#newMsgNum"
        />


    • hidden field: redirectDefault
      • where should the browser be sent if the reply form is cancelled?

      • supports no special variables

      • The following example would redirect the browser to the message that was originally being replied to, if the reply form's cancel button is clicked

        <input
         type="hidden"
         name="redirectDefault"
         value="<!--#siteUrl--><!--#msgNum-->"
        />


  • /edit Forms
    • hidden field: redirectOnEditSuccess
      • where should the browser be sent after a message has been successfully edited?

      • supports no special variables

      • The following example would redirect the browser to the fullThread page for the message that was edited, immediately after the form is submitted

        <input
         type="hidden"
         name="redirectOnEditSuccess"
         value="<!--#siteUrl-->fullThread$msgNum=<!--#msgNum-->"
        />


    • hidden field: redirectOnDeleteSuccess
      • where should the browser be sent after a message has been deleted?

      • supports no special variables

      • In the following example, if the message that's being deleted is the top of its discussion thread (it's not a response to another message), then deleting the message redirects the browser to the discussion group's message center (a DG Calendar page). Otherwise, the browser is sent "up" the thread to the message it was originally responding to. In either case, the redirect happens after the form is submitted and the message has been deleted.

        <input
         type="hidden"
         name="redirectOnDeleteSuccess"
         <!--#if condition="msg.isTopOfThread"-->
          value="<!--#siteUrl-->messages"
         <!--#else-->
          value="<!--#siteUrl--><!--#msgInResponseTo-->"
         <!--#endif-->
        />


    • hidden field: redirectDefault
      • where should the browser be sent if the edit form is cancelled?

      • supports no special variables

      • The following example would redirect the browser to the fullThread page for the message whose editing was cancelled, after the form is submitted.

        <input
         type="hidden"
         name="redirectDefault"
         value="<!--#siteUrl-->fullThread$msgNum=<!--#msgNum-->"
        />


View in DG


This site managed with Conversant, © Copyright 2008 Macrobyte Resources