You are here

public function BlockShortcode::tips in Shortcode 2.0.x

Same name and namespace in other branches
  1. 8 shortcode_basic_tags/src/Plugin/Shortcode/BlockShortcode.php \Drupal\shortcode_basic_tags\Plugin\Shortcode\BlockShortcode::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/BlockShortcode.php, line 103

Class

BlockShortcode
Insert a custom block to the text.

Namespace

Drupal\shortcode_basic_tags\Plugin\Shortcode

Code

public function tips($long = FALSE) {
  $output = [];
  $output[] = '<p><strong>' . $this
    ->t('[block id="1" (view="full") /]') . '</strong>';
  $output[] = $this
    ->t('Inserts a block.') . '</p>';
  if ($long) {
    $output[] = '<p>' . $this
      ->t('The block display view can be specified using the <em>view</em> parameter.') . '</p>';
  }
  return implode(' ', $output);
}