top of page

Forum Posts

dragos
Nov 17, 2018
In Coding with Velo
I have a custom Login script that linked to the generic wix member login lightbox. I set it so that if a user didn't have an account they would click Sign Up and it would take them to my custom sign up page. Recently i've found that when someone clicks Login it takes them straight to my custom user sign up page. Definitely not what it's suppose t do. I looked and noticed that now Wix no longer lets you link to a custom sign up page but rather a sign up lightbox. This completely ruined a perfectly good login in / signup process i had set up. Anyone else experiencing this? or suggest a workaround?
2
3
174
dragos
Aug 27, 2018
In Coding with Velo
I'm currently using the standard wix login lightbox with a custom Login/Logout button.The problem i'm experiencing is once someone successfully logs in, the logon lightbox disappears and nothing happens after that. The user is logged in, but the page doesn't refresh therefore the user doesn't realize they're actually logged in because the button still says Login. It's only when the user hits refresh or clicks on a new link tab that the button changes to Logout. Any ideas? Anyone else having this issue? Thanks. Here's the code i'm using: Might be important to mention I have this code as a site code not just a page code so it can show up on every page. import wixUsers from 'wix-users'; import wixData from 'wix-data'; import wixLocation from 'wix-location'; $w.onReady( () => { if(wixUsers.currentUser.loggedIn) { $w("#loginbutton").label = "Logout"; // $w("#profilebutton").show(); } else { $w("#loginbutton").label = "Login"; // $w("#profilebutton").hide(); } } ); export function loginbutton_click() { // user is logged in if(wixUsers.currentUser.loggedIn) { // log the user out wixUsers.logout(); wixLocation.to("/") .then( () => { // update buttons accordingly $w("#loginbutton").label = "Login"; // $w("#profilebutton").hide(); } ); } // user is logged out else { let userId; let userEmail; // prompt the user to log in wixUsers.promptLogin( {"mode": "login"} ) .then( (user) => { userId = user.id; return user.getEmail(); } ) .then( (email) => { // check if there is an item for the user in the collection userEmail = email; return wixData.query("Profile") .eq("_id", userId) .find(); } ) .then( (results) => { // if an item for the user is not found if (results.items.length === 0) { // create an item const toInsert = { "_id": userId, "email": userEmail }; // add the item to the collection wixData.insert("Profile", toInsert) .catch( (err) => { console.log(err); } ); } // update buttons accordingly $w("#loginbutton").label = "Logout"; // $w("#profilebutton").show(); } ) .catch( (err) => { console.log(err); } ); } }
Login / Sign In troubleshooting content media
0
1
49
dragos
Aug 23, 2018
In Coding with Velo
I'm trying to have a message, "no results found" for example, when someone does a search and there aren't any results. So far I've been playing with this code but it does the strangest thing. It shows the message on page load and upon searching and getting no results, the message disappears. The opposite of what I want it to do. Any help much appreciated. Thanks. import wixData from "wix-data"; export function button4_click(event, $w) { if (wixData.filter() === 0) { $w('#noResText').show(); } else { $w('#noResText').hide(); } console.log($w('#searchBar').value); filter($w('#searchBar').value); } function filter() { $w('#dataset1').setFilter( wixData.filter() .contains("title", $w("#searchBar").value) .and( wixData.filter() .contains("color", $w("#dropdown1").value) ) ); }
0
5
1k
dragos
Aug 12, 2018
In Coding with Velo
I'm using a repeater connected to my database. I have a search bar and am using code from the video on "how to create a search for your database". The problem I have is i want to be able to search for two elements from my database not just one. It can be one or the other not both together. For example, search 'title', or search a 'category'. Here's my code which only allows me to search for 'title' but not 'category'. Thanks. import wixData from "wix-data"; export function searchBar_keyPress(event, $w) { console.log($w('#searchBar').value); filter($w('#searchBar').value); } function filter() { $w('#dataset1').setFilter(wixData.filter() .contains("title", $w("#searchBar").value)); }
0
25
3k

dragos

More actions
bottom of page