Wix Login User

Login Wix User

To create your own member area using Code | Help Center We' re showing in this tutorial how to build a member page for each of the members of your website who are logged in.... When a user first signs in to your site, information for the dynamically updated page is generated.

The user can see and refresh his own individual account at any moment.

Please note: The user login and logout feature on your website only works when your posted website is displayed. Do not be able to fully test your member profiles pages in previews only. In order to generate our member profiles pages, we create: in which we save all member information.

Since we want to limit members' ability to see and upgrade only their own elements, we change the Member Library privileges to Custom Usage and select the following: Your membership information can be stored in the library. Next, we will build a page to show user profile.

It' a site with dynamical elements, which is linked to the members?collection. Since we are building a page with dynamical elements, we need to select a box to be added to the address bar that each member clearly identified. Since we use this page only to view information, we change the record's write-protected state.

The page privileges are also defined for Members Only via the Privileges page in the page settings, so that only registered members can access the page. This page is equipped with items for viewing information in a user's personal profiles. This example shows text items that are linked to the member list via the page's dynamical record.

Lastly, we insert a badge item. Once we have created the updating page, we associate the icon links to the updating page for the actual user. If members review their profiles, they'll see something like this: Updating page is very similar to profiles page.

There is also a page with dynamical elements that is associated with the members area. But since we can't have two pages with the same page on our site, we update the page so that it looks like this: Since we display information on this page and allow our visitors to process their information, we change the reading and writing modes of the dynamical record to reflect this.

Again, we are setting the page privileges to Members Only from the Privileges page in the page settings, so that only registered members can access the page. The page this turn is decorated with items for viewing and manipulating information in a user's profiles. Each of these items is linked to the Member Base via the page's own dynamical record.

Lastly, we are adding a badge item to transmit processed information. Associate the Send key with the button Send to Date as follows: If members see their updates pages, they'll see something like this: Now that we have set up the refresh page, we can go back to the profiles page to set a refresh icon.

Associate the Refresh key with the connect to Data key as follows: Hint: Since we have a committed login page, we will append the following source to the page of the source page. However, if you display the items on all pages, you must include the following on the Site page of the Site Codes pane.

Our login page is very easy to use. Use the first icon to either log in or log out, whether the user is already signed in or not. Use the second pushbutton to browse to a member's profiles page. This is only displayed for those who are already registered.

There are four parts to the login code: One login badge onClick eventhandler for both: Use the following APIs: wix-users - to get information about the actual user and to login and logout the user. wix-data - to query and insert into the members compilation.

Our imported source looks like this: we want to create our own badges when the login page is loaded. When the user is signed in, we want the login badge to be labeled Logout and we want to display the My Profile badge. When the user is not registered, we want the login badge to be labeled Login and we want to disable the My Profile badge.

Our onReady() is like this: "LoginButton" "Logout" ; "ProfileButton" ). show(); "LoginButton" "Login" ; "ProfileButton" ). hide(); } Hint: See the attachment below to find out how to optimise the above source tree. Much of the logics on our site is included in the onClick login key eventsandler.

We want to do a few things in the Events Handler: Deregister the user. Conceal the My Profile icon. Ask the user to login. Queries the Members Pool to see if an element is available for the currently active user. When there is no element for the actual user, make an element.

Modify the name of the icon to Login. Display the My Profile icon. Let's append an events handlers by choosing the Login buttons, and we'll use the Properties window to append a handlers for the onClick events. Then, we append the eventhandler that looks like this: "LoginButton" "Login" ; "ProfileButton" ). hide(); }

Show(); . log(err); }; "#loginButton" "Logout" ; "#profileButton" ). If you click on the Profil link, we use an events handlers to direct members to their own profiles page.

Let's append an events handlers by choosing the Profiles pushbutton and use the Properties window to append a handlers for the onClick events. Then, we append the eventhandler that looks like this: Optimise your coding so that you do not need to do unnecessary work more than once.

However, the optimizable part of the script in this Tutorial is the onReady() command on the login page. This is the optimised part of the text for this tutorial: {\a6}[}"wix-users" ; 'wix-window' ; "#loginButton" "Logout" ; "#profileButton" ). show(); "#loginButton" "Login" ; "#profileButton" ). hide(); } To retrieve information about the actual user and logs on and off the user. wix-data - For query and insertion into collection. wix-location - For navigating.

Mehr zum Thema