interface TourTipPluginInterface implements TipPluginInterface (View source)

Defines an interface for tour items.

move all methods to TipPluginInterface and deprecate this interface in https://drupal.org/node/3195193

Methods

string
id()

Returns id of the tip.

string
getLabel()

Returns label of the tip.

string
getWeight()

Returns weight of the tip.

array
getAttributes() deprecated

Returns an array of attributes for the tip wrapper.

string
get($key)

Used for returning values by key.

set($key, $value)

Used for returning values by key.

array
getOutput() deprecated

Returns a renderable array.

string|null
getSelector()

Returns the selector the tour tip will attach to.

array
getBody()

Returns the body content of the tooltip.

string|null
getLocation()

Returns the configured placement of the tip relative to the element.

Details

string id()

Returns id of the tip.

Return Value

string

The id of the tip.

string getLabel()

Returns label of the tip.

Return Value

string

The label of the tip.

string getWeight()

Returns weight of the tip.

Return Value

string

The weight of the tip.

array getAttributes() deprecated

deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. The attributes property is no longer used.

Returns an array of attributes for the tip wrapper.

Return Value

array

An array of classes and values.

See also

https://www.drupal.org/node/3204093

string get($key)

Used for returning values by key.

Parameters

$key

Return Value

string

Value of the key.

set($key, $value)

Used for returning values by key.

Parameters

$key
$value

array getOutput() deprecated

deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use getBody() instead, and do not include the tip label in the returned output.

Returns a renderable array.

Return Value

array

A renderable array.

See also

https://www.drupal.org/node/3195234

string|null getSelector()

Returns the selector the tour tip will attach to.

This typically maps to the Shepherd Step options attachTo.element property.

Return Value

string|null

A selector string, or null for an unattached tip.

See also

https://shepherdjs.dev/docs/Step.html

array getBody()

Returns the body content of the tooltip.

This typically maps to the Shepherd Step options text property.

Return Value

array

A render array.

See also

https://shepherdjs.dev/docs/Step.html

string|null getLocation()

Returns the configured placement of the tip relative to the element.

If null, the tip will automatically determine the best position based on the element's position in the viewport.

This typically maps to the Shepherd Step options attachTo.on property.

Return Value

string|null

The tip placement relative to the element.

See also

https://shepherdjs.dev/docs/Step.html