interface SearchableHelpInterface (View source)

internal  Help Topics is currently experimental and should only be leveraged by experimental modules and development releases of contributed modules. See https://www.drupal.org/core/experimental for more information.
 

Provides an interface for a HelpSection plugin that also supports search.

Methods

string[]
listSearchableTopics()

Returns the IDs of topics that should be indexed for searching.

array
renderTopicForSearch(string $topic_id, LanguageInterface $language)

Renders one topic for search indexing or search results.

Details

string[] listSearchableTopics()

Returns the IDs of topics that should be indexed for searching.

Return Value

string[]

An array of topic IDs that should be searchable. IDs need to be unique within this HelpSection plugin.

array renderTopicForSearch(string $topic_id, LanguageInterface $language)

Renders one topic for search indexing or search results.

Parameters

string $topic_id

The ID of the topic to be indexed.

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.