Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SearchableHelpInterface.php

interface SearchableHelpInterface

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

Hierarchy

  • interface \Drupal\help\SearchableHelpInterface

Expanded class hierarchy of SearchableHelpInterface

All classes that implement SearchableHelpInterface

See also

\Drupal\help\HelpSectionPluginInterface

2 files declare their use of SearchableHelpInterface
HelpSearch.php in core/modules/help/src/Plugin/Search/HelpSearch.php
HelpTopicSection.php in core/modules/help/src/Plugin/HelpSection/HelpTopicSection.php

File

core/modules/help/src/SearchableHelpInterface.php, line 12

Namespace

Drupal\help
View source
interface SearchableHelpInterface {
    
    /**
     * Returns the IDs of topics that should be indexed for searching.
     *
     * @return string[]
     *   An array of topic IDs that should be searchable. IDs need to be
     *   unique within this HelpSection plugin.
     */
    public function listSearchableTopics();
    
    /**
     * Renders one topic for search indexing or search results.
     *
     * @param string $topic_id
     *   The ID of the topic to be indexed.
     * @param \Drupal\Core\Language\LanguageInterface $language
     *   The language to render the topic in.
     *
     * @return 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.
     */
    public function renderTopicForSearch($topic_id, LanguageInterface $language);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
SearchableHelpInterface::listSearchableTopics public function Returns the IDs of topics that should be indexed for searching. 1
SearchableHelpInterface::renderTopicForSearch public function Renders one topic for search indexing or search results. 1

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal