PricingDocsAcademy
Bluesky ...
Wed, Dec 11, 10:04 PM

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

  • Armand

    28 days 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

    28 days ago

    Hi @Armand! Do you have some screenshots of your setup? 😊
  • /attachments/1306211014806736916/1306217777593585716/Screenshot_2567-11-13_at_18.21.08.png

    Armand

    28 days ago

    Here are two sets of screenshots of the values I use for the buttons and how the page path parameters are set up
    Screenshot_2567-11-13_at_18.21.08.png
    Screenshot_2567-11-13_at_18.22.03.png
    Screenshot_2567-11-13_at_18.20.35.png
    Screenshot_2567-11-13_at_18.20.45.png
  • Lucas G

    28 days 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
  • Armand

    27 days 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 πŸ™
  • Lucas G

    27 days 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
  • Armand

    27 days 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

    27 days ago

    @Lucas G is the man πŸ’ͺ🏼
  • Armand

    27 days 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?
  • /attachments/1306211014806736916/1306549682293702697/Screenshot_2567-11-14_at_16.13.24.png

    Armand

    27 days ago

    Screenshot_2567-11-14_at_16.13.24.png
    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.