Navigating to dynamic pages Err404 - I'm missing something

This is probably a really stupid problem, but I’ve been at it the whole day so now I’m asking for help.

I’ve created two dynamic pages, one profile and one update page as per this link (Velo Tutorial: Building Your Own Members Area | Help Center | Wix.com), (this is something I’ve done before), but for some reason I can’t seem to access either of the pages.

I have checked permissions, set up links, coded links, pretty much everything I can think of. I did notice that every time I create a new site member, it doesn’t create the member in the database…, I assume this to be the reason the url is not working.

ANY advice?

1 Like

Login page code:

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_1(event) {
// user is logged in
if(wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w(“#loginButton”).label = “Login”;
$w(“#profileButton”).hide();
wixLocation.to(‘/’);
} );
}
// 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("Members") 
      .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("Members", toInsert) 
        .catch( (err) => { 
          console.log(err); 
        } ); 
    } 
    // update buttons accordingly 
    $w("#loginButton").label = "Logout"; 
    $w("#profileButton").show(); 
  } ) 
  .catch( (err) => { 
    console.log(err); 
  } ); 

}
}

export function profileButton_click_1(event) {
wixLocation.to(/Members/${wixUsers.currentUser.id});
}

Hey
Can you please give a link to the site you’re setting up now?

Are there any Wix Experts willing to take a look at this one?

I’ve gone as far as to create a new database from scratch, set up permissions again, link 3 different buttons 3 different ways, but I’m still experiencing the same problem, error 404…

Willing to share the link in private, however the client requested I not share the link on public forums.

connect me on facebook to send link in private. I would like to help you, but without site it’s really hard to do

BTW, this may help you

1 Like

Thank you Mikhail, link sent via fb

Having the same problem… created 2 dynamic pages with everything set as it supposed to but still getting 404 problem. (I have everything synced to live).
Any ideas?

Hi Faidda

The problem still persists on my side, I think the problem is accessing dynamic pages specifically. I can access normal pages when logged in, however the system doesn’t recognise dynamic pages for some reason. I have gone through the whole process again from scratch, step-by-step from the tutorials, with no other outcome. Funny thing is, the dynamic pages still work on a different website I did a while back, so this must be due to a recent change somewhere with the routing…

Best of luck, I will keep working on this with Mikhail and update once resolved.

1 Like

Alright thanks, hope you both find a solution for that. I’ll try to figure this out too

Hi Faidda,
Can you please describe the specific use case that is not working?

Liran.

Hi,
I created two dynamic pages one for a member profile and the other for updating the details.
The thing is when Im trying to click on my profile Im keep getting an 404 error. I have all the collection in live and also I can see in the web address that it has the collection name/user Id.

Hi Faidda,
In order for us to successfully review this matter further, and properly assist you, please send us a video of the issue using screencast . Simply recreate the issue while recording the steps. Add the screencast.com URL to your response. Moreover, please clarify to which pages you were referring so that we can have a look on our end.

Thank you in advance.

Hi,
thanks for your response.
I have two pages one’s URL is (MycollectionName)/UserId
and the other one is (MycollectionName)/Update/UserId.
Its happaning when Im trying to navigate to my profile page.
I cant get the screencast to work for some reason, but thats the scenario:

  1. Im logged in as a member and my details are exist in the collection.
  2. Im clicking the My Profile button:


Then Im keep getting the 404 Error but I can see that the web address is being shown as it supposed to:
(siteAddress)/(MycollectionName)/UserId:

doing it with a facebook…

i Have the same error as Tiaan, Mr. Mikhail Spirin,can you please help me to resolve this error, i already sent you my link in your facebook messanger and also check details mentioned below :

i have followed all your steps for creating custome member login page and done coding accordingly but it is not working showing some error, please help me…the below is the links

Page Link :

https://editor.wix.com/html/editor/web/renderer/edit/7b1a1493-bd68-433a-889f-7c382be000cc?metaSiteId=cc46de08-d072-4d32-896e-6612cf62d781&editorSessionId=FC3DE292-3B89-44DC-93A5-5C7A9CDDADEC

Error link: https://gdexindia.wixsite.com/gdexindia11/Member/Update/ID

My Wix Account Log in Link : https://www.wix.com/my-account/sites/cc46de08-d072-4d32-896e-6612cf62d781/site-settings/overview?referrer=site-home

my coding :

import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;

$w.onReady( () => {
if(wixUsers.currentUser.loggedIn) {
$w(“#button1”).label = “Logout”;
$w(“#button2”).show();
}
else {
$w(“#button1”).label = “Login”;
$w(“#button2”).hide();
}
} );

export function button1_onclick() {
// user is logged in
if(wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w(“#button1”).label = “Login”;
$w(“#button2”).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](http://user.id/) ; 
    return user.getEmail(); 
  } ) 
  .then( (email) => { 
    // check if there is an item for the user in the collection 
    userEmail = email; 
    return wixData.query("Member") 
      .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("Member", toInsert) 
        .catch( (err) => { 
          console.log(err); 
        } ); 
    } 
    // update buttons accordingly 
    $w("#button1").label = "Logout"; 
    $w("#button2").show(); 
  } ) 
  .catch( (err) => { 
    console.log(err); 
  } ); 

}
}

export function button2_onclick() {
wixLocation.to (/Member/Update/ID ${ [wixUsers.currentUser.id](http://wixusers.currentuser.id/) });
}

Note : I want to Add and Additional Accounting Area or Table through which my member can view their Balance and account statement (How to Add it i dont know) because i just follow your steps in coding and creating website…i am not technical and IT Person …but interested to create website according to my requirement

Request you to Please give or add coding for Basic account statement generation like Account No., Amount Deposit,Withdraw, Final Balance in Table form in the above mention code

So Please Help me as soon as possible

Hi all! We’re figuring out the problem right now, i will update later. And thanks for your patience

Hi Mikhail ,

Is this above Problem figure out now ?

Please do the needful as soon as possible

Regards
Rajesh Dudhat

Hi All
Guys, we’re investiagting the problem. But as for now i ask you all to change write permissions to Anyone on the collection - this should (probably) resolve the issue

I mean like here:
https://www.screencast.com/t/AX9mATG6

Hi Mikhail,
I’ve changed the permissions to anyone but it still doesn’t work. keep getting 404.