I’m new to Weweb and with some “studying” I could already add a list of data (from Airtable) to a page.
Now, I want to create a “detail-page”, so I get more details of one item when clicking on it.
Indeed that youtube video is quite outdated, the correct way of creating dynamic pages is exactly as explained in the docs you shared.
There are 2 ways of binding the data of each row to a new page:
1- The simplest and fastest is creating a new variable and “On Click” passing the entire row object (data´[0] in your case) and then on the new page retrieving the indormation inside that Variable to populate the new info page.
2- Second method which is more reliable and better is to create a new collection that fetches only 1 row from your database, so this collection will be expecting an “ID” parameter that you will pass as soon as you click on a row
Thanks for the quick and clear answer. I will try.
Just to be sure: does the first way also display up-to-date information or just the second one as this retrieves the data from the backend after selecting an item.
As far as I understand the first way, the detail-information is the same as the data in the whole collection list. So in 99,99% this information is up-to-date. Correct?
Why is the second method more reliable? Because of the 100% up-to-date info or because of technical issues?
Hi Wim, both methods will reflect the updated row perfectly.
Using a collection (second method) is best practice because you have more flexibilit, reliability and more use cases, as an example:
You could create a dynamic page that can be accessed anywhere if someone has the link ex: yourapp.com/ID_Dynamic_Page where that ID will call down this new collection and populate the page.
With the first single variable method your dynamic pages will only be accessible if the user clicks on a row as a first step and only then the dynamic page would be created.
Hi @Agustin_Carozo ,
as my project will be deployed (and used) as a PWA, none of the users will access a dynamic page by URL.
And I could succesfully build the detail-page with the first method (thanks for the information), so my problem is solved