Template:Blog: Difference between revisions

no edit summary
(Created page with "<noinclude> {{#default_form:BlogPost}} <!-- Enables "Edit with form" button --> {{#cargo_declare:_table=BlogPosts |blog=Page <!-- Parent hub page, e.g., Catholic Online --> |title=String <!-- Page name --> |date=Date <!-- YYYY-MM-DD for sorting --> |author=String |tags=List (,) of String |summary=Wikitext <!-- Manual teaser or auto-generated --> }} == Usage == Simply place {{Blog}} at the very top of a blog pos...")
 
No edit summary
Line 1: Line 1:
<noinclude>
<noinclude>
{{#default_form:BlogPost}}  <!-- Enables "Edit with form" button -->
{{#default_form:BlogPost}}  <!-- Enables "Edit with form" tab -->


{{#cargo_declare:_table=BlogPosts
{{#cargo_declare:_table=BlogPosts
|blog=Page                  <!-- Parent hub page, e.g., Catholic Online -->
|blog=Page                  <!-- Parent blog hub page -->
|title=String              <!-- Page name -->
|title=String              <!-- Page name -->
|date=Date                  <!-- YYYY-MM-DD for sorting -->
|date=Date                  <!-- YYYY-MM-DD for sorting -->
|author=String
|author=String
|tags=List (,) of String
|tags=List (,) of String
|summary=Wikitext          <!-- Manual teaser or auto-generated -->
|summary=Wikitext          <!-- Optional teaser for listings -->
}}
}}


== Usage ==
== Usage ==
Simply place {{Blog}} at the very top of a blog post subpage.
Place {{Blog}} at the top of every blog post subpage.


All details (date, author, tags, summary) should be filled in using the form.
Fill in date, author, tags, and summary using the form only.
The full post content goes below the template.
Write the full blog post content below the template as normal wikitext.
</noinclude>
</noinclude>


Line 22: Line 22:


<p>
<p>
   <strong>Posted:</strong>  
   <strong>Posted:</strong> {{#dateformat:{{{date}}}|mdy}}
  {{#dateformat:{{{date|{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY2}}}}|mdy}}
   &nbsp;&nbsp;
   &nbsp;&nbsp;
   <strong>By:</strong> {{{author|{{REVISIONUSER}}}}}
   <strong>By:</strong> {{{author}}}
   &nbsp;&nbsp;
   &nbsp;&nbsp;
   <strong>Tags:</strong> {{{tags|None}}}
   <strong>Tags:</strong> {{{tags|None}}}
Line 34: Line 33:
}}
}}


<!-- Full blog post content starts here -->
<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 captures the parent blog -->
|blog={{BASEPAGENAME}}      <!-- Automatically detects the parent blog -->
|title={{PAGENAME}}
|title={{PAGENAME}}
|date={{{date|{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY2}}}}}
|date={{{date}}}
|author={{{author|{{REVISIONUSER}}}}}
|author={{{author}}}
|tags={{{tags|}}}
|tags={{{tags}}}
|summary={{{summary|{{#substr:|0|300}}...}}} <!-- Falls back to first 300 chars of post body -->
|summary={{{summary|}}}
}}
}}


[[Category:Blog posts]]
[[Category:Blog posts]]
</includeonly>
</includeonly>