Multiple path tab setting -> go back

  • /attachments/1324090798442287206/1324092253035302912/image.png

    ssssadsadasd

    12 days ago

    When clicking a button I immediately set three url paths: tab1, tab2, tab3.
    When the user clicks the back button in the browser I want the user to go the page where the user was when the button was clicked.
    but the user is redirected to the tab1,tab2 url. [see video](https://vimeo.com/1043287886/ce6ed3573f?ts=0&share=copy)

    how can I go immediately to the original page (without refreshing the page)? see [test page](https://toddle.dev/projects/turquoise_o_en_lars_permanent_chicken/branches/start/components/test?leftpanel=design&canvas-width=800&canvas-height=800&rightpanel=events)
    thanks
    image.png
  • Andreas Møller

    11 days ago

    When you update part of the URL path you also update the browser’s history, when you update a quest param you do not.

    If you change the parameters that should not affect the path to be query parameters this won’t happen
  • ssssadsadasd

    9 days ago

    @Andreas Møller I am not sure I understand. why in [this ](https://vimeo.com/1043943801/235c69e4d7?ts=0&share=copy)case there are many path parameters changes but the history shows only one entry? I think the same is true in bubble: it only shows one entry in the history when you change multiple path parameters. thanks
  • Andreas Møller

    9 days ago

    You are using two actions to update the parameters, so it updates the history twice
  • You can use goToUrl to do a single update, but that will cause a page reload
  • ssssadsadasd

    9 days ago

    hmmm I am not sure how I can update parameters all at once. when I set param1=param1/param2 then it evaluates literally and thus parameter2=null
  • ssssadsadasd

    9 days ago

    but that is my concern. I want to upload multiple path parameters without reloading the page. can I achieve this in toddle rn? thanks
  • Andreas Møller

    9 days ago

    No that is not possible. The best option would be to change some of the parameters to be query parameters
  • ssssadsadasd

    9 days ago

    ok thanks. no, I want them to be path parameters.
  • Lucas G

    9 days ago

    Can you calculate the values before setting the parameters?
  • Andreas Møller

    9 days ago

    I would like to better understand you use case. Do you think you could record a short video explaining it?
  • ssssadsadasd

    9 days ago

    think of twitter. when I click a tweet from homw (https://x.com/home) I want to go directly to (https://x.com/elonmusk/status/1875538271746634165) such that when the user click back it redirects to https://x.com/home directly
  • ssssadsadasd

    9 days ago

    I am not sure I understand this. what do you mean with calculate?
  • Lucas G

    9 days ago

    Why are your paths reliant on another? param1=param2
  • ssssadsadasd

    9 days ago

    it is just a wrong naming convention sorry. should be param1=value1
  • Lucas G

    9 days ago

    If you want to set the entire URL at once, you'd have to concat the entire thing before setting it
  • Otherwise, it's as Andreas said, each action will cause a history update
  • ssssadsadasd

    9 days ago

    but concatenation -> go to url -> page reload, right?
  • Lucas G

    9 days ago

    The entire thing could be a single param if you're really against reloads
  • ssssadsadasd

    9 days ago

    so a single param (which would look like param1/param2/param3) and then I have some variables that say:
    var1=param1.... right?
  • Andreas Møller

    9 days ago

    Any particular reason why you are building this as an SPA instead of using seperate pages?
  • ssssadsadasd

    9 days ago

    I actually tried to build it in separate pages initially, but when I went from page to page, the tabs of the sidebar (a reusable) showed "null" for a split second and then it showed the values.
    and I am not sure how going back behavior from page to page (e.g. if the page is where it was left)
    and I think twitter and similar are built as spa
  • ssssadsadasd

    9 days ago

    @Andreas Møller it is just this behavior in [the dashy template](https://dashy_dashboard.toddle.site/) https://vimeo.com/1043948095/4734279e53?ts=0&share=copy
  • ssssadsadasd

    9 days ago

    but yeah, the flick on the sidebar can be solved simply by setting the values of the tabs in the component rather than as an attributes

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.