Semantic Linkbacks

From IndieWeb
Jump to: navigation, search

Semantic Linkbacks is a WordPress plugin that upgrades the presentation of linkback notifications (like Trackback, Pingback, or Webmention*) from the ugly default pingback presentation of "[…] random text excerpt […]" to a much more meaningful and user-friendly display as comments, reposts, likes, and favorites, detected using microformats2 markup from the source of the linkback.

For explicit in-reply-to interactions, the plugin also changes the WordPress comment type from "webmention" to "comment". Otherwise, it creates human readable whole sentences like "Alice liked this article on alice.example.com." with hyperlinks to the source author and permalink.

Contents

Comment Type Indicator

For in-reply-to interactions, the plugin adds a "type" indicator in the comment metadata for the specific type of interaction:

This "type" indicator enables further interaction-specific presentation customization, such as showing likes/favorites and/or reposts as a facepile.

Configuration

No configurable options at this time.

Extensions

If you want to write your own parser for additional markup(such RDFa or Schema.org) you have to hook up the `semantic_linkbacks_commentdata` filter and update the array-fields.

The comment-array is a WordPress Comment with some extra-fields.

All fields beginning with _ like:

  • `$commentdata['_canonical']` for the canonical source url
  • `$commentdata['_type']` for the comment type. The plugin currently supports the following types: `mention`(default), `reply`, `repost`, `lik e`, `favorite`, 'tag', rsvp:yes, rsvp:no, rsvp:maybe, rsvp:invited, rsvp:tracking.
  • `$commentdata['_avatar']` for the author avatar

...are saved as comment metadata.

Semantic Comments

The Semantic Comments plugin was an attempt by David Shanske to use the type indicator of the Semantic Linkbacks plugin to display mentions as a facepile. It is not currently maintained.

Semantic Linkbacks has two functions which are wrappers for get_comments you can use in your theme. Both get_linkback() and get_linkback_number() need $type and $post_id passed to the function.

Example:

<?php 
// Get the global `$wp_query` object.
$id = get_the_ID();
	// Get the semantic_linkbacks_type 'like'.
$comments = get_linkbacks( 'like', $id );
?>

Then you can just loop through $comments however you want to markup your facepile.

A full comment template separating out likes and reposts from replies example.

Related Plugins

Webmention Plugin

*WordPress supports Pingback and Trackback by default; for Webmention support, you must install the separate Webmention Plugin which is very nicely complementary to the Semantic Linkbacks plugin.


WordPress
Topics Getting Started on WordPressAdvanced WordPress Set UpPluginsThemesExamplesWordPress with BridgyDevelopmentDataSecurityWordPress related wiki pages
Plugins Indieweb PluginWebmentionSemantic LinkbacksPost KindsOpenIDMicropubWordPress uf2Simple Location
Themes SemPressSemPress Lite (SemPress Child Theme)SenPress (SemPress Child Theme)Index (Sempress Child Theme)Independent Publishermf2_s
Assistance WordPress Outreach ClubJoin the #indieweb chatIRC and other chat options


See Also

Personal tools
Namespaces
Variants
Actions
Recent & Upcoming
Resources
Toolbox