The Movable Type User Manual

NOTE: This documentation is for Movable Type 3.2. If you are using a newer version, please see the documentation for Movable type 3.3x or Movable Type Enterprise.

« Enabling Auto-Discovery of TrackBack Resources | Up | Viewing the Pings Sent From an Entry »

Chapter 8: TrackBack

Displaying TrackBack Pings

Problem

You want to lay out TrackBack ping data.

Solution

Use the template tags that are prefixed with MTPing or MTEntryTrackBack.

Discussion

We've already mentioned MTEntryTrackBackData, which inserts the bits of data that a TrackBack client will need to ping the entry using auto-discovery. This tag must be used in the context of an entry to work properly.

It is not recommended that you use this tag in a template where multiple entries/resources exist. Having multiple instances of TrackBack data confuses matters and adds an additional manual step to the auto-discovery processes: selecting which resource to ping. Avoid it if you can.

This simple example should be used in an entry context:

 <MTEntryIfPingsAccepted>
   <h2 id="trackbacks">TrackBack Pings</h2>
   <MTPings>
     <p id="p<$MTPingID$>">
     <a href="<$MTPingURL$>"><$MTPingTitle$></a> from  <$MTPingBlogName$><br />
     <$MTPingExcerpt$> <a href="<$MTPingURL$>">[Read More]</a>
     </p>
     <p class="posted">Tracked on <$MTPingDate$></p>
   </MTPings>
 </MTEntryIfPingsAccepted>
 

MTPings creates the necessary context and (presumably) loops through a collection of pings to be inserted. When used in the context of an entry, pings are automatically filtered to only include those pertaining to that entry.

Next, use MTPingID to create an anchor, insert a hyperlinked title using MTPingURL and MTPingTitle, and insert the name of the weblog (MTPingBlogName) that is making the ping. We add the supplied excerpt with MTPingExcerpt and create another hyperlink that will take the user to the resource that made the ping. Finally, we insert the date of the ping and close out the ping's context. The entire block is wrapped in a EntryIfAllowPings tag which only outputs the ping data if the entry permits pings.

In addition to pings received, MT also allows us to create a list of pings that have been sent out, although the information is more limited.

 <MTPingsSent>
 URL: <$MTPingsSentURL$><br/>
 </MTPingsSent>
 

MTPingsSentURL inserts the URL that was pinged. MTPingSent creates the context around it and loops through the list.

Displaying outbound and inbound TrackBack pings for categories are generally the same as entries other then their context.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or question. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.