search by genre and/or mood

dm
@dm
7 years ago
37 posts
I am using the beatslinger skin. What code do I use to search by genre and/or mood via select options dropdown?

Thanks in advance!
updated by @dm: 11/10/17 07:42:09PM
michael
@michael
7 years ago
7,714 posts
not totally clear on the question. Are you wanting to create a list of items that contain a certain genre (not sure what a mood is).

Whats the goal?
dm
@dm
7 years ago
37 posts
When a user uploads a track they have to choose the genre and mood. This has been implemented using the form designer (image attached) What I want is two drop down option fields/select fields on the index page for customers to search the tracks by either mood, genre or both. Hope this makes sense.
gm.jpg
gm.jpg  •  55KB

michael
@michael
7 years ago
7,714 posts
Sure you can do that.

You'll need to setup a structure that submits the settings available, so you'll need a list of all possible moods and all possible genres in 2 dropdown lists inside a form. When the form is submitted put the values into the URL so it comes out like
site.com/genre=rock/mood=mellow

Then in your jrCore_list call, check for each of those:
{if isset($_post.mood) && isset($_post.genre)}
   {jrCore_list module="jrAudio" search1="audio_mood = `$_post.mood`" search2="audio_genre = `$_post.genre`"}
{/if}

Docs: "jrCore_list"
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-developers-guide/89/jrcore-list

Tags