public function QuoteShortcode::tips in Shortcode 8
Same name and namespace in other branches
- 2.0.x shortcode_basic_tags/src/Plugin/Shortcode/QuoteShortcode.php \Drupal\shortcode_basic_tags\Plugin\Shortcode\QuoteShortcode::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/ QuoteShortcode.php, line 46
Class
- QuoteShortcode
- Replace the given text formatted like as a quote.
Namespace
Drupal\shortcode_basic_tags\Plugin\ShortcodeCode
public function tips($long = FALSE) {
$output = [];
$output[] = '<p><strong>' . $this
->t('[quote (class="additional class" | author="author name")]text[/quote]') . '</strong>';
if ($long) {
$output[] = $this
->t('Formats the text like as a quote.') . '</p>';
$output[] = '<p>' . $this
->t('Sample css:') . '</p>';
$output[] = '
<code>
.quote {
display:block;
float:left;
width:30%;
margin:20px;
margin-left:0;
padding:5px 0 5px 20px;
font-style:italic;
border-left:3px solid #E8E8E8;
line-heigh:1.5em;
font-size:14px;
letter-spacing: 1px;
word-spacing: 2px;
}
.quote.right{
float:right;
margin-right:0;
margin-left:20px;
}
</code><p></p>';
}
else {
$output[] = $this
->t('Formats the text like as a quote. Additional class names can be added by the <em>class</em> parameter.') . '</p>';
}
return implode(' ', $output);
}