lodex-widget
Web widget to enrich your resources with LODEX resources
Installation
Require the lodex-widget.js script from your HTML page:
Usage
research-article review-article article case-report
// example usagevar LodexWidget = ;var lw = '#article-types .facet';
Complete example
Lod Widget test Article Type research-article review-article article case-report
Parameters
items selector
Required parameter
CSS selector pointing to the items to enrich.
The pointed elements must have an about
attribute required.
Example: #articles-types .facet
JBJ stylesheet
Optional parameter
A JBJ stylesheet, which returns a string (possibly in HTML), to be displayed in the tooltip.
The stylesheet is applied to the JSON-LD returned by the
URL contained in the about
attribute of the items selected.
Example of JSON-LD:
Default stylesheet:
This stylesheet creates two new fields (label
and description
), using
getJsonLdField
to select the field in JSON-LD which id is given in parameter.
Then, it takes the content
field of what's returned, and select only label
and description
using the mask
action.
The template
action then creates the HTML which will be displayed within the tooltips.
The best way to see what will be produced by the stylesheet is to use the JBJ-Playground.