Using metadata for categorising and searching


(Fiona) #1

I am creating an events calendar where anybody can add an event either free or paid. When adding an event, the user can select a category for their event (E.g. meditation, retreat, yoga, etc). Events can then be searched via categories.

 

I wish the free events to be restricted to only one category and paid events up to five.

 

I am using metadata to assign a category to an event. Specifically the “Metadata selection field”.

 

My questions – how do you allow some events to have one category and others up to five? Plus, how do you then have a calendar events search page where people can filter events by the category as a drop-down list?

 

I have tried creating two metadata fields both using the “Metadata selection field” - one not allowing multiple selections and the other one allowing multiple selections. Then in the calendar events search page, I created a search field which drew on both of these metadata values, however the search field was free text instead of a drop-down. If I removed the metadata field that allowed multiple selections, it became a drop-down.

 

So for now, I have used the same metadata field for all events which is a metadata selection field that does not allow multiple selections. This works fine if all events only have one category, however I would like to allow multiple selections for the paid events.

 

Not sure if this makes sense, but any tips on how to get it to work? (if it is possible?)


(Amurray) #2

I'm needing something like this too, you're listing by presentation value in not raw value yep?


(Fiona) #3

I am using the Calendar Events Search Page to search/filter by the category.. not sure you can select presentation value or raw for this.

 

the category is a metadata selection field and has the Frontend Part set to key (rather than value) and the Calendar Event Search Page seems to use this to display the category options.

 

BTW I have not found a solution and decided instead to allow up to five options to be selected with instructions to only select one if entering a free event, or one will be chosen. In this case I thought a manual solution might be easier than trying to technically limit it.


(Amurray) #4

Ahh a Search page. We have %asset_metadata_<metadata schema metadata selection field name>_value% listing all so far, then thought a JS filter might be the next setup to only show certain values.
Glad you found a solution for the moment!