Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Use actual Canto tags #28

Closed
wants to merge 14 commits into from

Conversation

danielkestler
Copy link

Info, this is based on the PHP8-compatible PR from @markusguenther.

This PR adds the feature to use actual Canto tags instead of custom fields to use in the media browser. I don't know if you need/want this, or if there were any reasons to omit this feature and use custom fields in the first place.

It is configurable, similar to the custom fields mapping:

Flownative:
  Canto:
    # At the moment, this is "either or", so use custom fields or tags for mapping, not both
    mapping:
      # map "Custom Fields" from Canto to Neos
      customFields: []
      # map "Tags" from Canto to Neos
      tags:
        field: 'tags'
        limit: 20
        include: []
        exclude: ['Untagged']

Asset count per tag is cached for performance reasons for one hour.

A new CLI command "importtags" can be used to import the tags first, then they are shown in the media browser.

@kdambekalns
Copy link
Member

Thanks, I'll have a look!

I don't know if you need/want this, or if there were any reasons to omit this feature and use custom fields in the first place.

Yes, the first sponsor of this package didn't use tags, but custom fields… 😎

@kdambekalns
Copy link
Member

BTW, this was planned to be done eventually, see #17

@danielkestler
Copy link
Author

danielkestler commented Sep 6, 2022

Thank you. By the way, my implementation should cover different use cases, by setting the "field" property in the configuration above, one could also use the Canto "keywords" for example.

(TBH, I also thought about a general solution where one could configure the custom fields here, so one place to configure where tags (and maybe asset collections) are fed from.)

We now use the Guzzle Utils directly and have the support for guzzle 8, when the deprecations will be removed.
In Neos 8 the interface has been changed and therefore we need to countByTag method as well.
@markusguenther
Copy link
Contributor

BTW: I updated the PHP 8 PR because there were some issues left.
So maybe this needs a rebase ;)

@danielkestler
Copy link
Author

Thank you, merged the changes.

@kdambekalns
Copy link
Member

@danielkestler The "base PR" is now merged and a few changes followed. Maybe you could rebase this PR, so we can get a fresh look? Thanks!

@kdambekalns kdambekalns self-requested a review September 7, 2022 16:18
@danielkestler
Copy link
Author

Thank you. As I am always having problems rebasing, and I saw there is a lot of things now in the main branch including caching, I have rewritten it on the current main branch and made a new PR here: #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants