Skip to content

Installation and Configuration

Marcin Werla edited this page Sep 13, 2013 · 8 revisions

Installation

WordPress managed installation

The plugin is available via the Wordpress.org Plugins website, so it is enough to use the administrator's plugin menu to install our plugin. Just go to "Plugins|Add new" subsection in your WordPress admin panel and find our plugin by searching for wp-chcontext. Then install it.

After such automated installation you have to do the following:

  1. Activate the CHContext Widget plugin through the 'Plugins' menu in WordPress.
  2. Insert an instance of CHContext Widget using the Widgets option in the Appearence menu of your WordPress administrator panel.

Manual installation

The plugin can be downloaded here: https://github.com/psnc-dl/wp-chcontext/tree/master/distributions

To install the plugin manually please do the following steps:

  1. Deactivate any previous version of CHContext Widget plugin through the 'Plugins' menu in your WordPress.
  2. Delete any previous version of CHContext Widget in the /wp-content/plugins/ directory (save custom.css and custom.js files if you modified them).
  3. Upload the entire wp-chcontext folder to the /wp-content/plugins/ directory (and add your custom.css and custom.js files if you modified them previously).
  4. Activate the CHContext Widget plugin through the 'Plugins' menu in WordPress.
  5. Insert an instance of CHContext Widget using the Widgets option in the Appearence menu of your WordPress administrator panel.

Configuration

Plugin config panel

For each instance of the widget you will be asked to provide the following information:

  • Title - The title of the widget.
  • Number of results - Choose how many results you would like to have displayed.
  • Show thumbnails - Check this if you want to have not only text links but also thumbnails of proposed items. Makes sense if for example you have wide space for the widget.
  • Query selector - By default, when this field is empty, the widget will use tags associated with the currently displayed posts to propose some interesting items. If you want to use some other piece of text from you website, you can provide a custom jQuery selector in this field. Leave empty to use post's tags. For simple tutorial on jQuery selectors check this w3schools.com site.
  • Query template - By default this is empty. When used, it allows you to narrow the scope of query which is being sent to the data provider. For example if the query provider allows to narrow the search scope by persons and you are using the widget on a site which has mostly person names in tags, it should improve your results if you use this option to narrow this query. This template is filled in with your post's tags or with information extracted via given jQuery selector (see option above). To specify where the query content should be placed in the template us $$ mark (see the screenshot above). Europeana for example allows you to narrows search with who:, what:, where: and when: fields. For more details check the Europeana search documentation.
  • Data provider - Choose the data provider among one of available: Europeana, Digital Public Library of America (DPLA) and Polish Digital Libraries Federation (FBC+). If you want to add your own data source, please choose "Custom" and provide name of the JavaScript function for custom data provider - a special field for that will appear. For more details on custom data providers please go to the main CHContext JS library documentation.
  • API Key - Europeana and DPLA require API key to get data via their API, so when you will choose one of these two data providers, you will be asked for the API key. It's free, but you need to apply. More details: Europeana and DPLA.

Customization

Additionally in the plugin folder you will find two files for further customisation:

  • custom.css - to make styling of the plugin easier we provided a CSS file in which you can put a plugin specific CSS styles. This file contains example piece of HTML to help you choose which classes to style.
  • custom.js - the plugin by default comes with English and Polish version of the UI (it's displayed basing on the user web browser settings). If you need more translations, please check this file. In this file you can also provide JavaScript code responsible for you custom data provider for the widget. This file contains examples both for custom data provider and for translations.