Tags and flex objects: no auto-complete? how do I best organise the tags? no tag cloud?

Hello everybody,

I am currently looking into the feasibility of doing a larger project with Grav. One of the stumbling blocks I’ve found so far is that tags do not seem to play as nicely with flex objects as I’m used to with pages.

The idea is to have several hundred (but no more than maybe a thousand) flex entries that feature a name, a location with geo coordinations, and some tags. I guesstimate that over those several hundred entries there may be 30 to 60 tags, possibly even more. I expect these to develop gradually along with the entries being added. I have noticed however that the tags do no autocomplete when I enter the beginning of an existing one. A quick check shows me that this definitely works in Grav 1.6 with categories for pages, but it does not work for categories or tags for either pages or flex objects in Grav 1.7, so I’m unsure whether it’s due to the flex objects or the latest Grav version, or possibly both. Does anybody know more about this?

Another thing I’m coming up short on (and I feel I MUST be overlooking something?!) is: how do I manage dozens of tags for hundreds of entries? If I have used one of these tags on 95 entries and I need to change it, how do I do that without editing every single one of those entries? Like… there must be an easier solution? But I can’t seem to find a plugin or anything. What am I missing?

Lastly it seems that the tag cloud plugin only grabs tags from pages, not from flex objects. I’m posting an issue for that in the plugin repository, but I think this may be related to the other points mentioned, so this may be interesting information.

So yeah, ideally I would have:

  1. autocomplete for tags in flex objects,
  2. a way to edit or delete a tag and have it update everywhere it is used,
  3. a tag cloud for tags on flex objects.

I’m super grateful for any ideas on how to accomplish this!

Hi Netzhexe!

I am an utter neophyte at Grav (and web dev more generally) but I have been thrown in the deep end on a project and have been wrestling with Flex Objects as well.

So I can’t answer your first question at all, although I have been able to use the default search to find objects with specific tags.

But as for bulk replace on tags – doesn’t flex just store this info back into the JSON file? My project’s objects are read-only, so I haven’t tested the CRUD stuff, but I thought that was the point of flex-objects.

So theoretically you should be able to load up the JSON file and do a simple search / replace to apply bulk changes to tag values. IDK though - let me know if this works. I’m curious.

Hey there, thanks for chiming in! I would just like to say that for one thing, that particular project has been scrapped, and also I am super busy right now after moving house, so I’m going to try to get on top of all my other things and just leave this issue lying around as a loose end. Maybe the question comes up again sometime, or your ideas might be helpful to someone else! :upside_down_face:

Hi! Just to keep the discussion alive: support for Taxonomies for Flex Objects still has to be implemented.

Another way could be using a selectize field, but still no autocomplete function/option exists. And it is rendered as [“Tag1”,“Tag2”,“TagX”] in Flex Object list (and cannot be searched).

I was investigating upon the use of such solution, but came across many dead ends by many others, even in the past :confused:

EDIT: category and tags in Flex Objects · Issue #3257 · getgrav/grav · GitHub
I just noticed that 2 days ago a “feature” flag has been added to the issue I opened.
Hope this helps!

Hey, thanks for letting me know! Funnily enough, the scrapped project has now firmly landed on my desk again, albeit with slightly altered requirements. I’m still going to use flex objects for it, but for the time being the data will be imported from another database and not edited in Grav. I expect that to change though… so yes, I’ll keep an eye on your Github issue too! :slight_smile:

1 Like