Plugin: Share Template Tags


Examples of the use of these tags can be found in the default_templates/ folder.

ShareFrom

The ShareFrom tag returns the “from” email address collected from the submitted Share form.

ShareTo

The ShareTo tag returns the “to” email address collected from the submitted Share form.

ShareMessage

The ShareMessage tag returns the message collected from the submitted Share form.

ShareResult

The ShareResult tag returns feedback to the user. This tag will return error messages for invalid email address formatting or oversized messages, for example, or upon successfully sending email to the specified address.

ShareSelectedID

The ShareSelectedID tag returns the entry ID collected from the submitted Share form. This tag can be used to get back into the entry context on the Share Email Body or Share Email Result templates, as below:

<mt:SetVarBlock name="id"><mt:ShareSelectedID></mt:SetVarBlock>
<mt:Entries id="$id">
    <h2><a href="<mt:EntryPermalink>"><mt:EntryTitle></a>, on <mt:BlogName></h2>
    <mt:EntryExcerpt>
    <p>URL: <a href="<mt:EntryPermalink"><mt:EntryPermalink></a></p>
</mt:Entries>

SharedEntries

The SharedEntries block tag will generate a list of the most-shared or most-recently shared entries — valuable for creating a “top 10” style list. This tag has several valid arguments:

  • The sort_by argument has two valid options: count and date. count will return a list sorted by the number of shares, while date will return a list sorted by the most-recent share. date is the default sort method.
  • The sort_order argument has two valid options: descend and ascend. descend is the default option and will return the most shares first (if sort_by="count") or the most recent share first (if sort_by="date").
  • The limit attribute lets you specify how many results to return. The default is 10.

Use any tags in the Entry context, along with the ShareCount and LastSharedOn tags, to generate your results — as in this example:

<mt:SharedEntries sort_by="count" limit="5">
    <p><mt:EntryTitle> was shared <mt:ShareCount> times, most recently on <mt:LastSharedOn format="%x">.</p>
</mt:SharedEntries>

SharedCount

The SharedCount tag will return the total number of shares for the current entry.

LastSharedOn

The LastSharedOn tag will return the date the current entry was most-recently shared. Note that any of Movable Type’s date format modifiers can be used with this tag, as below:

<mt:LastSharedOn format="%A, %B %e">