Help with Button with A Drop Down List and previous and next function for a Dynamic Page

I have created dynamic page and dynamic collection for a website of artists. On a test page, I created a button which includes a dropdown list as well as previous dynamic page and next dynamic page functions. The button works great on my test page. However, once I copy that design to my dynamic page it does not allow for the dropdown function, but it does allow for the previous and next function. Pour quoi?

www.edmontonartclub.com

Ok, here we go…

Tu veut savoir pour-quoi?

Ok, i will try to help you. Did you use CODE in your project?

Thank you very much for your assistance. To answer your question, I did NOT use code in my project. My strength is design and build.

Bonjour madmoiselle! :grin:

Ok, let us have a look, normaly i would say you are in the wrong forum, cause you are NOT USING any CODE, but you are searching for CODE-SOLUTION, so in this case, we will not reject you.:wink:

Ok, what do we have?

  1. A dynamic page —> means we have also a dynamic —> dataset (O.K.)
  2. Dynamic-page means one data-value per curent page (O.K.)
  3. You have also 1x DropDown-List and 2xButton to switch data (previous/next)

Ok, i think there is also a solution without code possible, but not sure.

I can explain you why it is, like it is.

Your PREVIOUS & NEXT-BUTTON will work, because you have connected your dynamic-dataset to them.

Your DropDown will NOT work, because you probably also have connected it with the DYNAMIC-DATASET.
For the DropDown you have to create a second DATASET and connect it directly to the wished DATABASE. Also the LIST-VALUES of this DropDown should be connected with the same DATASET.
DO NOT CONNECT YOUR DROPDOWN TO —> DYNAMIC DATASET!!!

You can see here an EXAMPLE on thsi DYNAMIC-PAGE how the DROP-DOWN, works without any CODE…

https://russian-dima.wixsite.com/meinewebsite/dynamic-action

First ENTER the DYNAMIC-PAGE!

Okay. Great. I will give this a try, with thanks. Can I reconnect with you via this post, should I be in need of further assistance?

You will find me always on my site and here too, of course.

Thanks. And thanks again. Your advice totally worked.

Nice to hear that :grin:. You can like it if you liked it. :wink:

I have an issue with the button moving forward. From the dropdown list in the button, how can I enable to go to that page? (it is a dynamic page)

This time you will need some CODING, i think.
Do not know how to do it without CODING.

So, you will need something like this…

export function dropdown1_change(event) {
 let currentIndex = $w('#dropdown1').selectedIndex
    $w('#dataset8').setCurrentItemIndex(currentIndex)
 let currentItem = $w('#dataset8').getCurrentItem()
 
    console.log(currentItem)
    console.log(currentItem.title)
    let URL = "" //<---- modify to Dynamic-URL
    wixLocation.to(URL) 
}

This is just an example, you will have to modify this code.

  1. Changing the dataset.
  2. Modifiying the DYNAMIC-URL

This CODE goes to the dynamic page (Title).

Thanks. Again. I will give this a try. Many thanks.

Sure do that. The only tricky thing will be to implement the dynamic-URL.
But you will find a lot of stuff to that topic. Just use the Searchbar of this forum.

If you can’t get your goal, so you can come back for further informations :wink:

Hi. I’ve been trying and trying to get the code to work. After many attempts, I am experiencing a parsing error: unexpected token. Have no idea what that means. Can you determine from this image?

Even when I deleted the above }); the same error. What am I doing wrong?

Try this one…

$w.onReady(function () {
    $w('#dropdown1').onChange(()=>{
        $w("#dataset1").onReady(() => {
 let currentIndex = $w('#dropdown1').selectedIndex
            $w('#dataset1').setCurrentItemIndex(currentIndex)
 let currentItem = $w('#dataset1').getCurrentItem()
            console.log(currentItem)
            console.log(currentItem.title)
 //  let URL = "" //<---- modify to Dynamic-URL
            wixLocation.to(["memberprofiledata-1/{Title}"]) 
        })
    })
})