2

i am creating a customer dashboard component in joomla 3.2, so i want to display user profile fields to my view and able to edit fields as well, i am displaying them manually using
$this->user = JFactory::getUser(); and <?php echo $this->user->name; ?>
now i have to add the functionality to edit as well, like password, profile image etc. how could i implement this functionality to my custom component.

  • I would suggest you look at how com_users does it ;) – Lodder Oct 15 '14 at 12:16
  • yes i had gone through com_users, but i think it is complicated, or in may be i am getting the flow correctly, is their any simple way of doing thing manually. like creating the form and posting it. – Ankit Balyan Oct 15 '14 at 17:07
2

Just an idea for a quick implementation: You could add a modal link to the com_users edit profile view in your component's view.

At the top of your view add:

JHTML::_('behavior.modal');

Then link like below:

<a class="modal" href="index.php?option=com_users&view=profile&layout=edit&tmpl=component?" rel="{handler: 'iframe', size: {x: 640, y: 540}}"> Edit Login Details</a>

This will open the edit profile layout in a modal window, without leaving your current page and have the com_users do the job, instead of re-creating the same functionality.

  • Thanks! @FFrewin, for now being im doing like this way only, displaying in popup modal. Additional, i have to remove basic settings fields from the com_user -> user profile as well. – Ankit Balyan Oct 16 '14 at 7:05
  • though i am just calling that functionality here in my component, but for later use what method would be better so that i will be completely free to edit as i want in user profile section. – Ankit Balyan Oct 16 '14 at 7:11
  • Note: To only retreive the profile values you can use: $profile = JUserHelper::getProfile($userid); – COBIZ webdevelopment Mar 3 '15 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.