Is it possible to put links for “next” or “previous” onto a single page post from a database? Or breadcrumb style navigation That way I can have a gallery for the view to go back to, but they don’t have to every time if they don’t want to. I was looking to see if this is already available or if there is some Javascript required to make it happen.
Next and Prev actions are available when you connect a button to a Dataset. They allow to browse between the items of this dataset for display on the same page.
However (and here is where it starts to be confusing), they do not allow browsing between item pages.
Dynamic Pages create the relation url → filter → dataset . So a dynamic page with url
/{year}/{event}
is translated into a query
wixData.query('collection')
.eq('year', 'year value')
.eq('event', 'event value')
.find()
This query may return one or more elements - those are the elements of the dynamic dataset.
The next and prev operations (both APIs or the Dataset and the Button actions) are moving the dataset across those results of the query - if there is only one result, they will not have any effect.
So for each page - like /2017/ambassadors-summit, for instance, we have a single page, for which we find all the items in the collection with year 2017 and event ambassadors-summit. The dataset can show all those items on the page - like in a gallery.
The challenge with Dynamic Pages is that the definition, the url /{year}/{event} does not imply what is the ordering between the pages - what is the next page after /2017/ambassadors-summit? How do we expect to define this ordering? We are still thinking what is the best approach here.
Yes, this is exactly what I mean. So I realized the reason I was not able to add the previous and next options is because I did not add a button, I added a shape (an arrow) and tried to link it to the dataset.
For ordering as you mentioned Yoav, in WP it is done by date entered, but you can edit the date of entry for the purpose of reordering content pages. I do not like this method because it means adjusting entry dates down to the minute to ensure they are in the correct order. It is a very tedious method!
Hey Sarah … what if you add a hidden column … so you can add it to your “filter” … you can title the column something like “order” … and add a number … THEN maybe order from small to biggest number? This way you can simply add chronological #'s … 1, 2, 3, etc
That is a good idea! I can just update the numbers in that column if I want to reorder photos or items.