You are here

public function ClearShortcode::tips in Shortcode 2.0.x

Same name and namespace in other branches
  1. 8 shortcode_basic_tags/src/Plugin/Shortcode/ClearShortcode.php \Drupal\shortcode_basic_tags\Plugin\Shortcode\ClearShortcode::tips()

Generates a filter's tip.

A filter's tips should be informative and to the point. Short tips are preferably one-liners.

@todo Split into getSummaryItem() and buildGuidelines().

Parameters

bool $long: Whether this callback should return a short tip to display in a form (FALSE), or whether a more elaborate filter tips should be returned for template_preprocess_filter_tips() (TRUE).

Return value

string|null Translated text to display as a tip, or NULL if this filter has no tip.

Overrides ShortcodeBase::tips

File

shortcode_basic_tags/src/Plugin/Shortcode/ClearShortcode.php, line 75

Class

ClearShortcode
Insert div or span around the text with some css classes.

Namespace

Drupal\shortcode_basic_tags\Plugin\Shortcode

Code

public function tips($long = FALSE) {
  $output = [];
  $output[] = '<p><strong>' . $this
    ->t('[clear (class="additional class"|id=item id|type=div,d,span,s)]text[/clear]') . '</strong>';
  if ($long) {
    $output[] = $this
      ->t('Inserts a float-clearing html item (type parameter = div or span) around the given text. Use the simple [clear /].') . '</p>';
    $output[] = '<p>' . $this
      ->t('Additional class names can be added by the <em>class</em> parameter. The id parameter gives the html an unique css id.') . '</p>';
  }
  else {
    $output[] = $this
      ->t('Inserts a float-clearing html item (div or span) around the given text. Use the simple [clear /].') . '</p>';
  }
  return implode(' ', $output);
}