You are here

public function BootstrapColumnShortcode::tips in Bootstrap 3 shortcodes 8

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

src/Plugin/Shortcode/BootstrapColumnShortcode.php, line 83
Adds shortcodes for all Bootstrap elements.

Class

BootstrapColumnShortcode
@Shortcode( id = "bs_column", token = "column", title = @Translation("Column"), description = @Translation("Bootstrap 3 shortcode"), weight = 50 )

Namespace

Drupal\bs_shortcodes\Plugin\Shortcode

Code

public function tips($long = FALSE) {
  $output = array();
  if ($long) {
    $output[] = '<p><strong>[column</strong> xs="1-12" sm="1-12" md="1-12" lg="1-12" offset_xs="1-12" offset_sm="1-12" offset_md="1-12" offset_lg="1-12" pull_xs="1-12" pull_sm="1-12" pull_md="1-12" pull_lg="1-12" push_xs="1-12" push_sm="1-12" push_md="1-12" push_lg="1-12" xclass="any text" data="any text" <strong>]</strong>  ... <strong>[/column]</strong>';
    $output[] = t('More info about this shortcode <a href=":url" target="_blank">here</a>', array(
      ':url' => 'https://github.com/MWDelaney/bootstrap-3-shortcodes#column-parameters',
    )) . '.</p>';
  }
  else {
    $output[] = '<p><strong>[column</strong> sm="1-12"]</strong>  ... <strong>[/column]</strong>';
    $output[] = t('More info <a href=":url" target="_blank">here</a>', array(
      ':url' => 'https://github.com/MWDelaney/bootstrap-3-shortcodes#column-parameters',
    )) . '.</p>';
  }
  return implode(' ', $output);
}