Next Page After Saving

What options do we have after saving a new item, the right next page depends on the type of the content that we are adding.

On every Action in KAS, VIEW, ADD, EDIT or DELETE, after the action is completed, we need to send the user to the next page. In order to determine best next page, we need to think about the reducing steps for the user and making KAS more efficient:

The variable to use for the next page is called $nexturl and it has the following format:

A) Relaod itself after submtting the form with $self_url

//$self_url is a predefined variable that contains the current url
$nexturl = $self_url;

 

B) KAS url structure:

<?php
//$KMID, $KSMID, $KSMOID ARE PREDEFINED VARIABLES OF THE CURRENT PAGE!!!
/******* VIEW PAGES / ADD PAGES  *****/

//THESE PAGES DON'T NEED AN ID AND THE OPTION TYPE IS ALREADY SETUP IN THE DATABASE
//$nexturl = "op_".FILE~NAME."-".KAS_MENU_ID."-".KAS_SUBMENU_ID."-".KAS_SUBMENU_OPTION_ID.".kas";
$nexturl = "op_".ADD~ITEM~PAGE."-".$KMID."-".$KSMID."-".$KSMOID.".kas";

/******* EDIT PAGES  *****/

//EDIT PAGES NEED AN ID AND AN OPTION TYPE (TO EDIT A NEWLY ADDED ITEM THAT DOENS'T HAVE AN ID YET, USE "self_edit"
//$nexturl = "op_".FILE~NAME."-".KAS_MENU_ID."-".KAS_SUBMENU_ID."-".PLACEHOLDER."_".ITEM_ID."_".OPTION_TYPES.".kas";
$nexturl = "op_".EDIT~PAGE."-".$KMID."-".$KSMID."-".$KSMOID."_1234_".FUSWP.".kas";

//THE PLACEHOLDER IS USUALLY THE KAS_SUBMENU_OPTION_ID OF THE PREVIOUS PAGE (FOR EXAMPLE THE PREVIOUS VIEW PAGE BEFORE GOING TO THE EDIT PAGE)

?>

 

To go to another section in kas that does not share the same $kmid, $ksmid, $ksmoid use the getpath() function

<?php

//$nexturl = getPath('MENU SECTION','SUBMENU SECTION','FILE NAME');
$nexturl = getPath('CONTENT','BANNERS','VIEW BANNERS');

//IF YOU NEED TO SE SEND AN ID AND OPTION TYPE

//$nexturl = getPath('MENU SECTION','SUBMENU SECTION','FILE NAME','OPTION TYPES','ID VALUE');
$nexturl = getPath('CONTENT','BANNERS','EDIT BANNER',52,'FUS');

?>


 

You can also append variables at the of any $next_url if necessary

<?php

​$nexturl = "op_".EDIT~PAGE."-".$KMID."-".$KSMID."-".$KSMOID."_1234_".FUSWP.".kas?FOO=VAR";

$nexturl = getPath('CONTENT','BANNERS','EDIT BANNER',52,'FUS')."?FOO=VAR";

?>

 

 

C) A String separated with colons (:) where the first value is self_edit or edit, self_edit will get the ID_VALUE of the newly added item and go from an add page to an edit page with the new ID_VALUE

 

<?php 
/***** SELF EDIT *****/

// USE SELF EDIT WHEN WE NEED TO CONTINUE EDITING THE NEWLY ADDED CONTENT 

//$nexturl = "self_edit:".FILE_NAME.":".KAS_MENU_NAME.":".KAS_SUBMENU_NAME.":".PLACEHOLDER.":OPTION_TYPES.".kas?FOO=VAR";  
//SINCE THE EDIT PAGE DOESN'T HAVE A SUBMENU OPTION NAME THE PLACEHOLDER CAN BE THE ANY SUBMENU OPTION OF THE SUBMENU, 
$nexturl = "self_edit:EDIT CLEINT:BILLING:CLIENTS:VIEW CLIENTS:FUSWC.kas?FOO=VAR";

//.kas?FOO=VAR is optional in case we need to send other variables 

/***** EDIT *****/

// WE USE EDIT WHEN WE WANT TO GO TO ANOTHER EDIT PAGE WITH A DIFFERENT ID VALUE, IN SUCH CASE WE NEED TO SPECIFY THE ID VALUE

$nexturl = "edit:PAGE NAME:MENU:SUBMENU:$idvalue:$editoptiontype.kas?FOO=VAR"; 
$nexturl = "edit:EDIT ITEM:BILLING:CLIENTS:VIEW CLIENTS:12345:FUSWP.kas?FOO=VAR";   //(FOO=VAR optional)

//.kas?FOO=VAR is optional in case we need to send other variables 
?>

 

 

 

 

Get a Quote

Get a Quote