FreedomSoft - "the future is freedom"
Template Before - Another Page

On occassion, it may be necessary to direct the user to a different Template; for example if the current user should not be allowed to see the current Template, or if data to be output needs to be displayed on a different Template.

Please note, however, that security can be applied on Templates, and this is the preferred method for preventing users from seeing Templates that they should not see. Under normal circumstances, the Another Page option would only be used when the Custom Code is able to determine that the data to be displayed is better displayed via another Template.

To output another page, the Template Before Code can all the other Template Code directly, which will return the new page in the Response parameter. The Template Before Code can then set the last six characters of the data returned in Response to RETURN.

Freedombase will check if the last six characters of Response are RETURN, and if so, will remove those last six characters, and will return the remaining contents of Response to the browser, bypassing the Template, and bypassing any Template After Code.

Sample code is:

     SUBROUTINE Login_HTM_BEFORE(Command,User,DatabaseeClassList,KeyList,InstanceList,ErrorMessageList,SequenceList,NoUpdateFlagList,SearchFlag,Response,Error,MetaErrorFlag)

$INSERT FREEDOMBASE_DEFINITION

     BEGIN CASE
        CASE Command = 'Go Contactus.htm'
           CALL CONTACTUS_HTM(Command,User,DatabaseeClassList,KeyList,InstanceList,ErrorMessageList,SequenceList,NoUpdateFlagList,SearchFlag,Response,Error,MetaErrorFlag)
           Response := 'RETURN'
        CASE Command = 'Go Supportlink.htm'
           CALL SUPPORTLINK_HTM
Command,User,DatabaseeClassList,KeyList,InstanceList,ErrorMessageList,SequenceList,NoUpdateFlagList,SearchFlag,Response,Error,MetaErrorFlag)
           Response := 'RETURN'
     END CASE

     RETURN

  END

previousnext
123456789101112131415161718192021222324252627