We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    For some reason my "done" button on the "profile editor" never goes back to my profile home page.

    How do I force the profile done button/service to go back to a specific page? (ie: the users profile home page)?

    Here’s what I’ve done so far;

    Login page (ID: 11443)
    <!-- custom login form. Both after login and profile home are forced to go to my profile editor page -->
    [!WebLoginPE_131? &type=`simple` &loginFormTpl=`wlp_LoginFormTpl` &liHomeId=`11471` &profileHomeId=`11471`!]
    


    Profile editor page (ID: 11471)
    <!-- profile editor -->
    [!WebLoginPE_131? &type=`profile` &profileTpl=`wlp_ProfileEditor` &profileHomeId=`11471`!]
    


    Although I’m sending my "done" service back to the profile editor, my plan is to have a specific "profile home page" or "control panel" where you can choose to edit your profile, etc.

    But the "done" button never goes back to 11471.

    How do I force "done" to go to a specific page?
      • 32645
      • 377 Posts
      I’ve fixed it now.

      Currently the profile done button (or cancel) is handled in the snippet under line 170/172 as a &loHomeId.

      So, setting the &loHomeId parameter sets up the "done" button.

      But, this also resets the actual logout button too!

      I’ve made this change and believe the way "done" or "cancel" should be changed too!

      My change: Make &profileHomeId the parameter, instead of &loHomeId.

      // File: webloginpe.snippet.php
      // Change under else if ($type == 'profile') on line 170/172
      case 'cancel':
      	/*
      	if ($loHomeId == '') $loHomeId = $modx->config['site_start'];
      	$url = $modx->makeURL($loHomeId);
      	*/
      	if ($profileHomeId == '') {
      		if ($loHomeId == '') $loHomeId = $modx->config['site_start'];
      		$url = $modx->makeURL($loHomeId);
      	} else {
      		$url = $modx->makeURL($profileHomeId);
      	}
      	$modx->sendRedirect($url,0,'REDIRECT_REFRESH');
      	break;