mrkhan

PW front end user profile

Recommended Posts

Hello,

i have managed to login and logout and change password for user from PW front end with the help of 

https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/

many thanks to @ryan

but now i need it little advance

1. i want to have option for login users to save some pages as FAV and can see in their profile.

how exactly i can do that ?

do i need to create some fields in users Template , how login users can press button on page to put as FAV & if he is not logged in it goto LOGIN Page.

2. and User Name and Phone Number and Pic in user profile.

Thanks

Share this post


Link to post
Share on other sites

In your template list, there's a collapsed filterform on the top, there you can enable the visibility of system templates. Then you can add fields to the user template. If you need to show those fields in the profile site of the admin backend you can enable them in the settings of the ProcessProfile module. To use them on the frontend there's no need to do that. 

As for the actual saving of the faves, you could use a page field, where you store the faved pages. 

  • Like 1

Share this post


Link to post
Share on other sites

Hello LostKobrakai,

thanks for your reply and i totally understand. but the only issue i am getting now is how to use AJAX to save page to page field.

i am trying but its not working.

can you help me some little code for link or button to use AJAX to save that page ID in pagefield of user profile?

Thanks

Share this post


Link to post
Share on other sites

You can call all the pages you normally use via ajax. In the corresponding templates php file you can check for ajax requests like this: 

if($config->ajax){
  //AJAX
}else{
  //Not AJAX
}

Everything else is business as usual.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By louisstephens
      So, I really don't know where to begin with this. I have the thought in my head (the basics), but not really sure how to set it up.
      The desired effect:
      The homepage is set up with a foreach loop that outputs all the child pages (basically just a bunch of pages with pdfs, docs etc stored in a file field). When A user is actually logged in, they can "star" an item or drag and drop (using Dragula) the page to a sidebar. Also, they would be able to reorder the pages in the sidebar.
      The question(s):
      I guess I have multiple questions regarding how to achieve this.
      Would it be best to create a page field in the user template to save the page(s)? How would you actually save the page state (sidebar output, reordering, etc) once the drag and drop has been used? Thanks in advance for any help! A lot of this was just what was in my head, so it might not make full sense. However, I will update this if I can actually wrap my head around everything.
    • By webhoes
      Hello,
      I am working of a site for a sport organisation.
      All affiliated gyms can edit their profile. I have used the advaced mode so that if you create a new page under location the gym can login and edit their profile.
      i also want that they can add instructors as child of their profile and also are able to edit those instructors.
      I can not get passed the able to edit all subpaged or none.
      How should this be done? Or is this not possible?
    • By benbyf
      Sure this has been asked a million times but cant find a simple answer.
      Trying to set the page to redirect to after login in the front end - i.e. not on the admin login page.
      some reason this works for super users but not normal users redirecting to a page which is viewable by members not guest role users.
       
      $showLoginError = false; if($input->post->user && $input->post->pass) { $username = $sanitizer->username($input->post->user); $pass = $input->post->pass; try { $session->login($username, $pass); // redirect user $session->redirect("/events/"); } catch (\Exception $e) { $showLoginError = true; } }  
    • By Eunico Cornelius
      Hi, I am new to process wire and I've been trying to change the date time format in my webpage according to its language selection(example: English 'd/m/y' , Deutsch: 'd.m.y'). I know that using 
      $datetime->getDateFormats(); we can achieve the type of formats in the shape of indexes. Also, by using 
      $user->language->id we can know which language we are using. How do I combine this two functions so that when I select English/Deutsch, the date will be adjusted accordingly?
      Is there a specific function that can do this or is there any provided index in the $user->language somewhere. Thanks in advance :).
    • By benbyf
      Strange question but I was wondering if it was possible to have more than one user with the same user name - or put in another way, allow the user to login with the same name but different passwords...?