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

v1.16 Add filter for search titles #6947

Open
felixhahnweilheim opened this issue Apr 12, 2024 · 3 comments
Open

v1.16 Add filter for search titles #6947

felixhahnweilheim opened this issue Apr 12, 2024 · 3 comments

Comments

@felixhahnweilheim
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The Verified module adds an icon after the name of a verified user/space.
The new search dropdown does not allow to add this icon. There are no widgets to overwrite or other options to properly add the icon.

Describe the solution you'd like

Add an event to getTitle() in https://github.com/humhub/humhub/blob/develop/protected/humhub/modules/user/search/SearchRecord.php#L48 (and same for https://github.com/humhub/humhub/blob/develop/protected/humhub/modules/space/search/SearchRecord.php)
that allows to manipulate the title. In our usecase it would even be enough to add something after the title.

I did not test that yet. I first wanted to ask if you would be open to such a PR or what your thoughts are.

Describe alternatives you've considered

If you see alternatvies, please let me know.

@luke-
Copy link
Contributor

luke- commented Apr 13, 2024

If we extend UserSearchResult from Object and use Yii::configure() here,
https://github.com/humhub/humhub/blob/develop/protected/humhub/modules/user/search/UserSearchProvider.php#L72

the module could replace the SearchResult class, extend it and implement an own getTitle() method.

@yurabakhtin @felixhahnweilheim What do you think?

    'container' => [
        'definitions' => [
            \humhub\modules\user\search\SearchRecord::class => ['class' => \custom\SearchRecord]
        ]
    ] 

@felixhahnweilheim
Copy link
Contributor Author

That sounds good. @ArchBlood , do you agree?

@ArchBlood
Copy link
Contributor

That sounds good. @ArchBlood , do you agree?

Would make things easier, this would also add other possibilities as well.

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

No branches or pull requests

3 participants