toddle dynamic path

  • uunicode-1335321215727829116

    unicodes

    7 days ago

    I have two pages: one named 'Company' and the other named 'User.' If I set the same first path param on both pages (like "profile") (both pages has the path like in this screen.), how does Toddle know whether to navigate to the 'Company' page or the 'User' page? Since both pages use the same parameter value, how is the distinction made? Like company page has first path = profile and user page has the first path = profile. Thank you! 🙏
    1335321587536101468-Screenshot_2025-02-01_at_20.50.35.png
  • lucasg-1335330677167755285

    Lucas G

    7 days ago

    How about doing /company/param and /user/param
  • This seems like it's setting yourself up for potential errors
  • uunicode-1335334957651984387

    unicodes

    7 days ago

    I did this, but I'm curious how Toddle interprets it and whether there are errors. It works, but it's unclear if that's expected or if it might cause issues.
  • lucasg-1335339335888932916

    Lucas G

    7 days ago

    I'd still say it is not recommended. Pages have unique ids and names and those are used when a page is rendered but since there's no unique path to differentiate the pages it's likely you'll have issues if for example there's never a path set.
    🙏1
  • uunicode-1335339632048472156

    unicodes

    7 days ago

    Thank you, I will not do this 🥰, was just a curiosity.
  • lucasg-1335340219381321919

    Lucas G

    7 days ago

    It would also cause issues for web crawlers if this was a site you'd want to be indexed
  • Since this is likely an app behind a login, it's not the case (I assume)
  • It would still be interesting to hear from the toddle team on this though
  • uunicode-1335343020568084490

    unicodes

    7 days ago

    You are right; it's an app behind a login. I'm not interested in indexing the pages. It would make sense if Toddle could automatically determine the correct path, allowing you to have just website.com/profile instead of website.com/company/profile. In the case of /company/profile, you would need to add redirects to a 404 page for users, but if Toddle automatically resolves the correct path, those redirects wouldn't be necessary because in background you set the context of "company" to profile, not the context of "user" to profile. And if toddle just gets it right then there should not be issues and would be impossible for user to set context of other pages.
  • lucasg-1335343540477366423

    Lucas G

    7 days ago

    We can only guess so much based on the DOM structure and testing things ourselves.
  • Team toddle would have to tell us more about how the runtime determines paths, etc
    🔥1
  • andreasmoller-1335345404962934927

    Andreas Møller

    7 days ago

    It looks like there might be a bug when you try that exact scenario. It does the routing correctly but in my example cant seem to set the correct path param.

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.