grav icon indicating copy to clipboard operation
grav copied to clipboard

category and tags in Flex Objects

Open phmg701 opened this issue 3 years ago • 10 comments

Hello,

while testing Flex Objects, I noticed some unexpected behaviours. First, here's relevant parts of my custom Flex Object definition:

    test_tags:
      type: selectize
      size: large
      label: Test Tags
      classes: fancy
      validate:
        type: commalist

    categories_and_tags:
      type: taxonomy
      label: Category and Tag
      multiple: true
      validate:
        type: array
    list:
      title: title
      fields:
        test_tags:
  • test_tags do not have the autocomplete function, otherwise found in taxonomy field type. This is very very helpful in creating a catalog or any other type of organized data.
  • test_tags results in ["Test1","Test2","Test3"] in list view, typical array/plain text representation.
  • test_tags cannot be searched when other text fields can. We could expect the field to be searchable, given its plain text representation.
  • no matter how I try to configure it, in list view, taxonomy never displays. However this way we have the autocomplete function.

I think I tried many combinations, if not every possible one, so I decided to open this issue.

Is there something else I can try?

As usual, thank you!

phmg701 avatar Mar 05 '21 20:03 phmg701

You need to implement support for the taxonomy for your type, it's not automated (yet). For now, taxonomy works only for pages and only by using the default field.

mahagr avatar Mar 08 '21 07:03 mahagr

Thank you, that explains

  • no matter how I try to configure it, in list view, taxonomy never displays. However this way we have the autocomplete function.

So, creating

test_tags:
      type: selectize
      size: large
      label: Test Tags
      classes: fancy
      validate:
        type: commalist

and

test_category:
      type: selectize
      size: large
      label: Test Category
      classes: fancy
      validate:
        type: commalist

would be a way to achieve data organization, mimicking Category and Tags, right? That leads to the other part of the strange behaviour:

  • test_tags do not have the autocomplete function, otherwise found in taxonomy field type. This is very very helpful in creating a catalog or any other type of organized data.
  • test_tags results in ["Test1","Test2","Test3"] in list view, typical array/plain text representation.
  • test_tags cannot be searched when other text fields can. We could expect the field to be searchable, given its plain text representation.

Am I doing something wrong in blueprint's field definition?

Thank you!

phmg701 avatar Mar 08 '21 08:03 phmg701

This probably should be opened up on Flex-Objects repo. I can't transfer it because that's under TrilbyMedia github user.

rhukster avatar Mar 08 '21 17:03 rhukster

This probably should be opened up on Flex-Objects repo. I can't transfer it because that's under TrilbyMedia github user.

https://github.com/trilbymedia/grav-plugin-flex-objects/issues/113

Done!

Thanks!

phmg701 avatar Mar 08 '21 19:03 phmg701

@mahagr I was wondering if there's a timeframe for this feature as well as for other enhancements to Flex Objects. Thanks!

phmg701 avatar May 09 '21 07:05 phmg701

There is no timeframe for this feature at this point; I have used tags in some custom projects, but basically, it is using custom code to do that.

mahagr avatar May 10 '21 07:05 mahagr

Hello, just wondering if any progress has been made on integrating tags and categories into flex-objects.

Or if there are any plans to insert such feature into Grav's roadmap. Other interesting features would be:

  • relations between objects
  • multi-language support as it exists for Pages

Thank you!

phmg701 avatar May 09 '22 08:05 phmg701

No progress on tags or language support (out of the box), but we have done some work towards object relationships as it's required in our upcoming API.

Both tags and language support can be added to your objects even now (as pages do), but they require some coding to be done.

mahagr avatar May 11 '22 12:05 mahagr

No progress on tags or language support (out of the box), but we have done some work towards object relationships as it's required in our upcoming API.

Thanks! Hope it will be documented on Grav Learn.

Both tags and language support can be added to your objects even now (as pages do), but they require some coding to be done.

Thanks again, it's not the first time I read this, but I have absolutely no clue on where to find the related documentation and use it as a start. A recipe would be just perfect!

PS: I am sensing that 1.8 release is getting closer and can't wait for it!

Again, thanks for the awesome product!

phmg701 avatar May 12 '22 08:05 phmg701

Just take a look into Flex Pages, they have implemented both. That said, the current implementation tries to mimic the old pages (which are still in use in frontend).

mahagr avatar May 13 '22 06:05 mahagr