Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.
julietteculver edited this page Jun 13, 2012 · 15 revisions

Introduction

The Pelagios widgets are widgets that you can embed on a web page.

There are currently two widgets the Pelagios Place Widget and the Pelagios Search Widget.

Pelagios Place Widget

This displays Pelagios information associated with a specified place. It takes the form of an icon, which when clicked pops up the information about a place. It could be used for example on a web page where a particular place is mentioned to allow users of the page to view the Pelagios information associated with a place.

Pelagios Search Widget

This allows you to search for a particular place. It displays all the matches in the Pleiades gazetteer on a map and as a list. You can then view with the Pelagios information associated with each of the places in these search results.

How to embed the Pelagios Place Widget

  1. Add the following javascript somewhere on your page. <script type="text/javascript" src="http://pelagios.github.com/pelagios-widgets/code/lib/require.js"></script> <script type="text/javascript" src="http://pelagios.github.com/pelagios-widgets/code/place.js"></script>

You only need to include the scripts once on each page even if you want to include multiple widgets. 2) Find the Pleiades ID of the place

Find the place on the Pleiades website and look at the URL of the page for the place to get the Pleiades ID of the place. e.g. if the URL is http://pleiades.stoa.org/places/579885/ or http://pleiades.stoa.org/places/579885/?searchterm=Athens* then the Pleiades ID is 579885.

  1. Choose a widget ID

Your widget needs an ID which can be any alphanumeric string you like, but it must not clash with the id of any other html element on your page and if you want to embed more than one widget on a page each widget must have a different ID.

  1. Add the following HTML to your page

Where you would like the widget to appear add the following HTML where PLEIADES_ID is your Pleiades ID and WIDGET_ID is your widget ID. <div id="WIDGET_ID" data-pleiades_id="PLEIADES_ID" class="pelagios pelagios-place"></div>

How to embed the Pelagios Search Widget

  1. Add the following javascript somewhere on your page. <script type="text/javascript" src="http://pelagios.github.com/pelagios-widgets/code/lib/require.js"></script> <script type="text/javascript" src="http://pelagios.github.com/pelagios-widgets/code/search.js"></script> You only need to include the scripts once on each page even if you want to include multiple widgets.
  2. Choose a widget ID

Your widget needs an ID which can be any alphanumeric string you like, but it must not clash with the id of any other html element on your page and if you want to embed more than one widget on a page each widget must have a different ID.

  1. Add the following HTML to your page

Where you would like the widget to appear add the following HTML where PLEIADES_ID is your Pleiades ID and WIDGET_ID is your widget ID. <div id="WIDGET_ID" class="pelagios pelagios-search"></div>

Clone this wiki locally