Add Keywords to Images to Filter Them?

Is there a way to add keywords to images so the images can be filtered using those keywords? I suspect I could add text fields in a flex and hide those fields, but if I can add the keywords to the image, that would be easier.

Most Elements components have a Tags property, where you can set a tag and then filter on that tag. An image does not have the Tags property but if it is in a Flex or Container they do have tags so you could use them there. You would not need to create hidden fields.

I tried that and it does not work. I think I have it set correctly. My image is inside this container.

It is all going to depend on how you are handling the filtering. Are you trying to use the Filter component or the Filter Tags component? The tags component allows you to create buttons that will allow you to filter on the tags you have created.

For example, I use this for a catalog on my site where the user can filter based on tags that have been setup for the various categories of parts in the catalog.

I also use a Filter field but it does a keyword search based on the text entered in the field. So it does not use the tags.

You can try this out here - GB24 Catalog

I’m using the filter component.

Hey @bruce,

Dan shows how to use filter tags in this Dev Diary. He demonstrates some examples and discusses the finer details. I highly recommend watching it if you haven’t seen it already.

Thanks @tpbradley. I watched that video before. I need to use a Filter component, not the Filter Tag component. There will be too many possible filter selections on my page. That is why. So far the hidden text field is my solution. It works, it’s just a bit more clumsy than if I could add the keywords to the image.

My suggestion here would be to use the Text component to add a title and/or description for each Image — as you’ve already done.

At the moment, the Filter component searches all text content inside each Container. So if your keywords are in a Text component, they’ll be included in the search results.

I’m not entirely sure how adding “keywords to Images” would differ from adding Tags to the Container. If you’re using the Filter Tags component, you’d need to apply tags manually anyway. Are you thinking it would be useful for the main Filter component to also search through those tags — so visitors could free text search and match against tag values too?

Let me know — just trying to understand the use case more clearly :slight_smile: