Skip to content

Adds HTML meta tags to Islandora objects via MODS XPaths to enable Twitter and Facebook image previews.

Notifications You must be signed in to change notification settings

Islandora-Labs/islandora_social_metatags

Repository files navigation

Islandora Social Metatags

Add social media sharing meta tags without hacking the theme. Enables Twitter Cards and Facebook previews, generating attractive images with descriptions when someone links to your objects.

Introduction

Islandora Social Metatags adds Twitter- and Facebook-recognized meta tags to the HTML headers on Islandora objects based on MODS metadata. This makes your objects more attractive when they're linked to on social media.

Before:

After:

Requirements

This module requires the following modules/libraries:

Installation

Install as usual, see this for further information.

Configuration

Configuration path is admin/islandora/tools/twitter_cards (Administration > Islandora > Islandora Utility Modules > Islandora Twitter Cards Configuration).

There are ten fields to configure. Defaults should work for most sites, except for Site Twitter User.

  • Title XPath
    • The XPath to your MODS Title field. Feeds the twitter:title meta tag.
    • Default should work for most sites.
  • Abstract XPath
    • The XPath to the MODS Abstract field. Feeds the twitter:description meta tag.
    • Default should work for most sites.
  • Site Twitter User
    • Your site's Twitter handle, or your site administrator's twitter handle.
    • Required.

Activation and Testing

Once the module is installed, enabled, and configure, test your objects at the Twitter Cards Validator. Successfully testing a tweet gets your site whitelisted for the cards.

Limitations

Currently configured to work on five content models: Basic Image, Large Image, Citation, Thesis, and Video. The twitter:image tag is populated with a datastream view URL which depends on the content model.

Troubleshooting/Issues

Having problems or solved a problem? Check out the Islandora google groups for a solution.

Maintainers

Current maintainers:

Development

If you would like to contribute to this module, please check out CONTRIBUTING.md. In addition, we have helpful Documentation for Developers info, as well as our Developers section on the Islandora.ca site.

License

GPLv3

About

Adds HTML meta tags to Islandora objects via MODS XPaths to enable Twitter and Facebook image previews.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages