Jump to content

Template:Callout: Difference between revisions

From Swarthmore Knowledge Base
Kwhiteb1 (talk | contribs)
Created page with "<includeonly> <div role="note" aria-label="{{{title|{{#switch:{{lc:{{{type|tip}}}}} |warning=Warning |important=Important |success=Success |note=Note |#default=Tip }}}}}" style=" border:1px solid {{#switch:{{lc:{{{type|tip}}}}} |warning=#d97706 |important=#b45309 |success=#15803d |note=#6b7280 |#default=#c7d8f5 }}; background:{{#switch:{{lc:{{{type|tip}}}}} |warning=#fff8e6 |important=#fff7ed |success=#f0fdf4 |note=#f9fafb |#default=#f8fbff }}; border-radi..."
 
Kwhiteb1 (talk | contribs)
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly><div role="note" aria-label="{{{title|{{#switch:{{lc:{{{type|tip}}}}}
<div role="note" aria-label="{{{title|{{#switch:{{lc:{{{type|tip}}}}}
  |warning=Warning
  |warning=Warning
  |important=Important
  |important=Important
Line 7: Line 6:
  |#default=Tip
  |#default=Tip
}}}}}" style="
}}}}}" style="
display:block;
width:100%;
max-width:48em;
box-sizing:border-box;
margin:1.5em 0;
padding:16px;
border-radius:8px;
border:1px solid {{#switch:{{lc:{{{type|tip}}}}}
border:1px solid {{#switch:{{lc:{{{type|tip}}}}}
  |warning=#d97706
  |warning=#d97706
Line 21: Line 27:
  |#default=#f8fbff
  |#default=#f8fbff
}};
}};
border-radius:8px;
padding:16px;
margin:1.5em 0;
">
">


Line 29: Line 32:
font-weight:bold;
font-weight:bold;
font-size:1.1em;
font-size:1.1em;
margin-bottom:.5em;
margin:0 0 .75em 0;
color:{{#switch:{{lc:{{{type|tip}}}}}
color:{{#switch:{{lc:{{{type|tip}}}}}
  |warning=#7c3f00
  |warning=#7c3f00
Line 47: Line 50:
</div>
</div>


<div style="border-top:1px solid rgba(0,0,0,.15); padding-top:.75em; line-height:1.5;">
<div style="
line-height:1.5;
">
{{{1|{{{content|}}}}}}
{{{1|{{{content|}}}}}}
</div>
</div>


</div>
</div></includeonly>
</includeonly>


<noinclude>
<noinclude>
== Callout Template ==
== Callout Template ==


Creates an accessible callout box for notes, tips, warnings, important messages, and success messages.
Creates a styled, accessible callout for documentation.


=== Preferred Usage ===
=== Usage ===
 
Use the first unnamed parameter for the body content:


<pre>
<pre>
Line 67: Line 70:
  | type=tip
  | type=tip
  |
  |
You’ll know you’ve successfully logged into Drupal when you see '''My Sites''' and your name in the black menu bar.
You'll know you've successfully logged into Drupal when you see '''My Sites''' and your username in the black menu bar.


{{Screenshot
{{Screenshot
  | DrupalMySites.png
  | DrupalMySites.png
  | 500px
  | 500px
  | Screenshot showing the My Sites menu
  | Screenshot showing the My Sites menu.
  | The Drupal toolbar after a successful login.
  | The Drupal toolbar after a successful login.
}}
}}
Line 78: Line 81:
</pre>
</pre>


=== Usage with Custom Title ===
=== Custom Title ===


<pre>
<pre>
{{Callout
{{Callout
  | type=important
  | type=important
  | title=Before you continue
  | title=Drupal Training
  |
  |
Never unpublish your homepage.
'''You must complete Drupal training before being given editing access to any website.'''
 
If you have questions about user permissions, contact [mailto:web-update@swarthmore.edu web-update@swarthmore.edu].
}}
}}
</pre>
</pre>


=== Supported Types ===
=== Types ===


* <code>tip</code>
* <code>tip</code> (default)
* <code>note</code>
* <code>note</code>
* <code>important</code>
* <code>important</code>
Line 99: Line 104:
=== Parameters ===
=== Parameters ===


# '''type''' — optional. Defaults to <code>tip</code>.
# '''type''' — Optional.
# '''title''' — optional. Overrides the default title.
# '''title''' — Optional.
# '''unnamed body content''' — required. May include text, links, lists, images, tables, and other templates.
# '''Body''' — The first unnamed parameter. Supports wiki markup, templates, images, tables, lists, links, and other standard MediaWiki content.


=== Legacy Usage ===
The template also supports <code>content=</code>, but unnamed body content is preferred:
<pre>
{{Callout
| type=note
| content=Profile data comes from both Drupal and MySwarthmore.
}}
</pre>
</noinclude>
</noinclude>

Revision as of 14:45, 9 July 2026



Callout Template

Creates a styled, accessible callout for documentation.

Usage

{{Callout
 | type=tip
 |
You'll know you've successfully logged into Drupal when you see '''My Sites''' and your username in the black menu bar.

{{Screenshot
 | DrupalMySites.png
 | 500px
 | Screenshot showing the My Sites menu.
 | The Drupal toolbar after a successful login.
}}
}}

Custom Title

{{Callout
 | type=important
 | title=Drupal Training
 |
'''You must complete Drupal training before being given editing access to any website.'''

If you have questions about user permissions, contact [mailto:web-update@swarthmore.edu web-update@swarthmore.edu].
}}

Types

  • tip (default)
  • note
  • important
  • warning
  • success

Parameters

  1. type — Optional.
  2. title — Optional.
  3. Body — The first unnamed parameter. Supports wiki markup, templates, images, tables, lists, links, and other standard MediaWiki content.