For developers¶
Tagify exposes these extension points:
| Extension point | Use it to |
|---|---|
hook_tagify_autocomplete_match_alter() |
Change or drop the label and info label of each tag, in suggestions, default values, and the formatter. |
hook_tagify_ai_suggestions_prompt_alter() |
Change the instructions Tagify AI Suggestions sends to the model. |
entity_autocomplete_tagify form element |
Add an autocomplete Tagify input to a custom form. |
select_tagify form element |
Add an options based Tagify input to a custom form. |
tagify-formatter.html.twig |
Override the markup of the Tagify formatter in a theme. |
| Services | Reuse or decorate the autocomplete matcher and helpers. |
Services¶
| Service | Interface | Purpose |
|---|---|---|
tagify.autocomplete_matcher |
TagifyEntityAutocompleteMatcherInterface, TagifyMatchBuilderInterface |
Builds the autocomplete results and the tag data of each entity. |
tagify.hierarchical_term_manager |
TagifyHierarchicalTermManagerInterface |
Reads taxonomy trees, parents, and parent names. |
tagify.theme_resolver |
TagifyThemeResolverInterface |
Tells whether Gin or Claro (or a sub-theme) is active. |
tagify_ai_suggestions.suggester |
TagifyAiSuggesterInterface |
Calls the AI provider and ranks the answer. |
tagify_ai_suggestions.context_builder |
TagifyAiContextBuilderInterface |
Renders the content and collects the candidates. |
tagify_ai_suggestions.candidate_ranker |
TagifyAiCandidateRankerInterface |
Narrows large vocabularies to the ceiling. |
tagify_ai_suggestions.suggest_handler |
TagifyAiSuggestHandlerInterface |
Handles the button request: access, flood control, and the response. |
Autocomplete flow¶
sequenceDiagram
participant JS as tagify.js
participant C as TagifyEntityAutocompleteController
participant M as tagify.autocomplete_matcher
participant H as Selection handler
participant A as Alter hook
JS->>C: GET /tagify_autocomplete/{type}/{handler}/{key}?q=...
C->>C: Load selection settings by key, verify HMAC
C->>M: getMatches()
M->>H: getReferenceableEntities()
loop each entity
M->>A: hook_tagify_autocomplete_match_alter()
end
M-->>C: Tag items
C-->>JS: JSON
Template¶
The formatter renders tagify-formatter.html.twig (theme hook
tagify_formatter) with the variables attributes and tags. Each tag has
title, label, entity_id, avatar, info_label, and
info_label_is_image. Copy the template from the module's templates/
folder into a theme to override it.