Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
#3273159: Search API token field processor was added in Search API 1.30 which is great.
But I am not sure how to make it work ... The Search API Field Token module page says:
Configuration
- Navigate to Administration > Extend and enable the module.
- Navigate to Administration > Configuration > Search and Metadata > Search API > [Search Index to edit] > Fields.
- Add the token fields.
- Click update and save.
At the step "Add the token fields.", I am not sure what to do ... Do I need to add a "Custom value (custom_value)" field?
Perhaps someone can clarify, and we can add a page under the https://www.drupal.org/project/search_api documentation.
Steps to reproduce
Proposed resolution
- Add documentation: Index custom values via tokens
- Add help text, with link to Token help page
Remaining tasks
Comment | File | Size | Author |
---|---|---|---|
#4 | 3414348-4--custom_value_property_help.patch | 1.73 KB | drunken monkey |
Comments
Comment #2
drunken monkeyYes, exactly.
Comment #3
ressa CreditAttribution: ressa at Ardea commentedThanks for confirming. I just tried the feature, and it works really well.
After you click the "Custom value (custom_value)" button on the index page, this is the help text under the field:
Perhaps we can give a hint where to find the tokens, maybe by adding this sentence?
This would be quite helpful for inexperienced users.
I created a page in the documentation, and added a link under "Proposed resolution" in the Issue Summary.
Perhaps you can review it, and add it to the menu?
Feel free to add extra text about other methods to use this field (apart from using tokens) since I am not sure how that can be done.
Comment #4
drunken monkeyI’ve added your tutorial to the documentation, thanks!
Linking to
/admin/help/token
is also a good idea. However, that page is actually only available if you have both Token and Help installed. The attached patch adds a link in that case. Otherwise, do you know of any documentation page explaining the Token concept in general, as used in Core?Comment #5
ressa CreditAttribution: ressa at Ardea commentedThanks! The help text with link to Token help page in your patch works perfectly, and is only shown when both Help and Token modules are installed.
There is https://www.drupal.org/documentation/modules/token and sub-pages for Drupal 7, but the differences are probably too big to use in Drupal 10, and an updated version required.
Comment #7
drunken monkeyGood to hear, thanks!
Merged. Thanks again!