Plugin: Share Template Tags
- Overview
- Compare Share and Share Lite
- Install and Configure
- Template Tags
- Required Templates
- Monitor Share Statistics
- Changelog
- Looking for support? Use the Helpdesk.
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_byargument has two valid options:countanddate.countwill return a list sorted by the number of shares, whiledatewill return a list sorted by the most-recent share.dateis the default sort method. - The
sort_orderargument has two valid options:descendandascend.descendis the default option and will return the most shares first (ifsort_by="count") or the most recent share first (ifsort_by="date"). - The
limitattribute 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">