public function LinkShortcode::tips in Shortcode 8
Same name and namespace in other branches
- 2.0.x shortcode_basic_tags/src/Plugin/Shortcode/LinkShortcode.php \Drupal\shortcode_basic_tags\Plugin\Shortcode\LinkShortcode::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/ LinkShortcode.php, line 72
Class
- LinkShortcode
- Insert div or span around the text with some css classes.
Namespace
Drupal\shortcode_basic_tags\Plugin\ShortcodeCode
public function tips($long = FALSE) {
$output = [];
$output[] = '<p><strong>' . $this
->t('[link path="the drupal path" (title="link title"|class="additional class"|id="item id"|style="css style rules")]text[/link]') . '</strong>';
if ($long) {
$output[] = $this
->t('Inserts an aliased drupal path around the text. You can omit the text and the closing [/link], you get back the url only.') . '</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. In the <em>style</em> parameter you can use your own css definition.') . '</p>';
}
else {
$output[] = $this
->t('Inserts an aliased drupal path around the text. You can omit the text and the closing [/link], you get back the url only.') . '</p>';
}
return implode(' ', $output);
}