Hello everyone,
I’m on my blog page, I have a dropdown list with values like categories, and onChange() I want to display the posts from the selected category. I inserted the values on the dropdown manually because I don’t want to display all my categories, but how can I display the posts with the category in the dropdown list?
So far I was able to retrieve the value and insert it into a query as the code shows:
export function dropdown2_change(event) {
wixData.query( “Blog/Posts” )
.eq( “categories” , $w( “#dropdown2” ).value)
.find()
.then( (post) => {
//What do I do here to display the post that matches the dropdown value?
// I want to display 3 posts as selected in the blog element.
})
}
Thank you for your time,
Marcelo de Souza.