The trackbacks loop is used to display the trackbacks for a blog entry.
The basic syntax of the loop is:
The loop does one iteration for each trackback for the blog entry.
The trackbacks loop can also be tested like a boolean variable. It is true if there is at least one trackback for the article.
Variables
Within the trackbacks loop, you can use these variables, whose contents change with each iteration:
| A string variable containing the name of the blog containing the referring article.
|
| A string variable containing an excerpt from the referring article.
|
| The length of this excerpt varies with the blogging software used by the referring blog as well as that blogger's particular settings.
|
| A string variable containing the date and time when the referring article was published.
|
| The format of publish_time is yyyy.mm.dd hh:mm ampm timezone
|
| · | mm is the month, in two-digit format
|
| · | dd is the day, in two-digit format
|
| · | hh is the hour, in 12-hour 2-digit format
|
| · | timezone is the standard abbreviation for the timezone
|
| A string variable containing the title of the referring article.
|
| A string variable containing the URL of the permanent link to the referring article.
|
Example
The example code shown below is a simplified and commented version of the default trackbacks template:
| <strong>TrackBack URL:</strong><br> {{trackback_url}}
|
| <!-- List trackbacks if there are any -->
|
| <p>Weblogs that reference this article:</p>
|
| <!-- Display the title of the referring article
|
| <h3><a href="{{url}}">{{title}}</a></h3>
|
| <!-- Display the name of the referring weblog, if known -->
|
| <strong>Weblog:</strong>
|
| <!-- Display an excerpt of the referring article, if there is one -->
|
| <strong>Excerpt:</strong>
|
| <!-- Display trackback publishing time, if known -->
|
| <strong>Posted:</strong>
|
| {{/loop}} <!-- trackbacks -->
|
| <!-- If there are no trackbacks, display a simple message -->
|
| {{/if}} <!-- trackbacks -->
|
Here's what the template code above looks like when applied:
Trackbacks
TrackBack URL:
http://demo.blogharbor.com/blog/_trackback/82710
No trackbacks found.