Peter Ward Posted July 26, 2018 at 08:02 PM Share Posted July 26, 2018 at 08:02 PM (edited) I wanted my users to go straight to the edit form for their user profile from the main menu, rather than go via the profile preview page (and then via their profile details page --> too many clicks!). I'm using the Submit Profile menu item type so that new and current users use the same link on the menu. To do this create a custom override SITE_ROOT/templates/jreviews_overrides/controllers/userprofiles_profiles_controller.php from SITE_ROOT/components/com_jreviews_addons/userprofiles/controllers/userprofiles_profiles_controller.php. Change lines 41 - 46 from if($profilePreview = $this->UserprofilesProfile->renderProfilePreview($this->auth->id)) { $this->set('profilePreview', $profilePreview); return $this->render('profiles', 'create_profile_exists'); } To this: if($profilePreview = $this->UserprofilesProfile->renderProfilePreview($this->auth->id)) { $listing = $this->UserprofilesProfile->getProfileListing($this->auth->id); $Routes = ClassRegistry::getClass('RoutesHelper'); $editUrl = $Routes->listingEdit('', $listing, ['return_url'=>true]); cmsFramework::setSessionVar('referrer', cmsFramework::getCurrentUrl(), 'jreviews.userprofiles'); cmsFramework::redirect($editUrl, 302); } Edited July 26, 2018 at 08:03 PM by Peter Ward plethoraonline-1492071863 and IvorJ 2 Link to comment
Recommended Posts