Passing page path parameters to a page: page loads twice/thrice

  • plusmin-1306211014806736916

    Armand

    2 months ago

    My setup:
    I have several menu buttons that are used for navigation to other pages. For two of these buttons I want to pass not just the (static) page name, but also one or more dynamic values for the page path parameters. I use a formula for that.
    Furthermore, once the target-page is loaded, these page path parameters are used in a GET API call (as parameters) to determine what to get from my table in the database.

    My issue:
    This works in the sense that I end up on the correct page and the correct data gets loaded from the API and rendered on the page. However, for some reason, on the target-pages where I send the extra page path parameters, the page loads two or three times. In terms of performance it is not really an issue, but it is weird user experience if I just come arrive on page B from page A and when I click the previous page button I stay on page A, because I'd have to click it two (or three) times.

    I know that when page path parameters change this always counts as a page visit in the browser history. But that's the thing, the value of the whole url doesn't change (except for a query, but that doesn't shouldn't make a difference).

    I have played around with turning off the auto-fetch on the API that uses the page path parameters for its GET call, but it doesn't seem to make a difference.

    So what am I missing here or is there something that I'm just doing plain wrong?

    Thanks in advance πŸ™
    βœ…1
  • max.kayr-1306216675690942495

    Max

    2 months ago

    Hi @Armand! Do you have some screenshots of your setup? 😊
  • plusmin-1306217778407280672

    Armand

    2 months ago

    Here are two sets of screenshots of the values I use for the buttons and how the page path parameters are set up
    1306217777593585716-Screenshot_2567-11-13_at_18.21.08.png
    1306217778117869600-Screenshot_2567-11-13_at_18.22.03.png
    1306217776624439377-Screenshot_2567-11-13_at_18.20.35.png
    1306217777077682186-Screenshot_2567-11-13_at_18.20.45.png
  • lucasg-1306284454062592050

    Lucas G

    2 months ago

    What does the final url look like? Spaces don’t work on URLs so you’ll have to encode them accordingly
  • The redirects might be the page updating/correcting the URL
  • plusmin-1306507024233660497

    Armand

    2 months ago

    Ah yes, ofc!

    I should make better notes, because I even thought of it potentially having an impact (although not this exactly) when I decided I wanted this string of text in the URL.

    Thanks @Lucas G πŸ™
  • lucasg-1306507995022360627

    Lucas G

    2 months ago

    Replace all node to replace ' ' with %20 would do it if that's the issue
  • Ideally though the strings should be created as a URL in mind so you don't have to replace anything
  • Less chances of stuff breaking that way
  • plusmin-1306509508092231680

    Armand

    2 months ago

    I just added a node to replace ' ' with '_' in the go-to URL actions, which for the URL I think is more aesthetically pleasing. I get that string from the table in my database as it is the trip name, so I use it in other places as normal text.
    For filtering I use the ID anyway, so this string is only because I think it looks nicer if it's added in the URL path after the ID number.
    πŸ‘1
  • max.kayr-1306514081582157874

    Max

    2 months ago

    @Lucas G is the man πŸ’ͺ🏼
  • plusmin-1306549321386168372

    Armand

    2 months ago

    In the same example I'm experiencing an issue in the editor. This is not an issue in preview.

    After page load inside the editor (like a refresh or coming from another page in the editor, so not in-editor navigation as that has been disabled) some time it seems like the page path parameter value "dissappears". And that then causes the data from the database to no longer be visible because I use that parameter an GET API.

    Is this expected behavior because the page URL in the editor shows the URL of the editor or is my intended URL being run in the background and am I doing something wrong?
  • plusmin-1306549682612338762

    Armand

    2 months ago

    1306549682293702697-Screenshot_2567-11-14_at_16.13.24.png
    1306549682658345011-Screenshot_2567-11-14_at_16.13.35.png

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.