function SearchableHelpInterface::renderTopicForSearch
Same name in other branches
- 9 core/modules/help_topics/src/SearchableHelpInterface.php \Drupal\help_topics\SearchableHelpInterface::renderTopicForSearch()
- 8.9.x core/modules/help_topics/src/SearchableHelpInterface.php \Drupal\help_topics\SearchableHelpInterface::renderTopicForSearch()
- 10 core/modules/help/src/SearchableHelpInterface.php \Drupal\help\SearchableHelpInterface::renderTopicForSearch()
Renders one topic for search indexing or search results.
Parameters
string $topic_id: The ID of the topic to be indexed.
\Drupal\Core\Language\LanguageInterface $language: The language to render the topic in.
Return value
array An array of information about the topic, with elements:
- title: The title of the topic in this language.
- text: The text of the topic in this language.
- url: The URL of the topic as a \Drupal\Core\Url object.
- cacheable_metadata: (optional) An object to add as a cache dependency if this topic is shown in search results.
2 methods override SearchableHelpInterface::renderTopicForSearch()
- HelpTopicSection::renderTopicForSearch in core/
modules/ help/ src/ Plugin/ HelpSection/ HelpTopicSection.php - Renders one topic for search indexing or search results.
- TestHelpSection::renderTopicForSearch in core/
modules/ help/ tests/ modules/ help_topics_test/ src/ Plugin/ HelpSection/ TestHelpSection.php - Renders one topic for search indexing or search results.
File
-
core/
modules/ help/ src/ SearchableHelpInterface.php, line 39
Class
- SearchableHelpInterface
- Provides an interface for a HelpSection plugin that also supports search.
Namespace
Drupal\helpCode
public function renderTopicForSearch($topic_id, LanguageInterface $language);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.