Template:Blog: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
<noinclude>
<noinclude>
{{#default_form:BlogPost}}  <!-- Enables "Edit with form" tab -->
Uses [[Form:BlogPost]] to create and edit blog posts.


== Template parameters ==
{{#template_params:
|date (label=Date, type=date, display format=mdy)
|author (label=Author)
|tags (label=Tags, list=true)
|summary (label=Summary/Teaser, type=textarea)
}}
== Cargo declaration ==
{{#cargo_declare:_table=BlogPosts
{{#cargo_declare:_table=BlogPosts
|blog=Page                  <!-- Parent blog hub page -->
|blog=Page                  <!-- Parent blog hub (e.g., Catholic Online) -->
|title=String              <!-- Page name -->
|title=String              <!-- Page name -->
|date=Date                 <!-- YYYY-MM-DD for sorting -->
|date=Date
|author=String
|author=String
|tags=List (,) of String
|tags=List (,) of String
|summary=Wikitext           <!-- Optional teaser for listings -->
|summary=Wikitext
}}
}}
== Usage ==
Place {{Blog}} at the top of every blog post subpage.
Fill in date, author, tags, and summary using the form only.
Write the full blog post content below the template as normal wikitext.
</noinclude>
</noinclude>


<includeonly>
<includeonly>
<h1>{{PAGENAME}}</h1>
<p>
  <strong>Posted:</strong> {{#dateformat:{{{date}}}|mdy}}
  &nbsp;&nbsp;
  <strong>By:</strong> {{{author}}}
  &nbsp;&nbsp;
  <strong>Tags:</strong> {{{tags|None}}}
</p>
{{#if:{{{summary|}}}|
  <p><em>{{{summary}}}</em></p>
}}
<hr>
<!-- Full blog post content starts here (completely normal wikitext, not stored in Cargo) -->
{{#cargo_store:_table=BlogPosts
{{#cargo_store:_table=BlogPosts
|blog={{BASEPAGENAME}}     <!-- Automatically detects the parent blog -->
|blog={{BASEPAGENAME}}
|title={{PAGENAME}}
|title={{PAGENAME}}
|date={{{date}}}
|date={{{date}}}
|author={{{author}}}
|author={{{author}}}
|tags={{{tags}}}
|tags={{{tags}}}
|summary={{{summary|}}}
|summary={{{summary}}}
}}
 
{| class="wikitable" style="float:right; width:300px; margin-left:15px;"
|-
| colspan="2" style="text-align:center; background-color:#f0f8ff; font-size:120%; font-weight:bold;" | {{PAGENAME}}
|-
| style="background:#e6f3ff; text-align:right; font-weight:bold;" | Posted:
| {{#dateformat:{{{date}}}|mdy}}
|-
| style="background:#e6f3ff; text-align:right; font-weight:bold;" | Author:
| {{{author|Unknown}}}
|-
| style="background:#e6f3ff; text-align:right; font-weight:bold;" | Tags:
| {{#if: {{{tags|}}}
  | {{{tags}}}
  | None
}}
|-
| colspan="2" |
{{#if: {{{summary|}}}
  | <em>{{{summary}}}</em>
  | ''No summary provided.''
}}
}}
|}
<hr style="clear:both;" />
<!-- Full blog post content starts here (normal wikitext, not stored in Cargo) -->


[[Category:Blog posts]]
[[Category:Blog posts]]
</includeonly>
</includeonly>
<noinclude>
{{Doc}}
</noinclude>