https://github.com/asmeikal/grav-plugin-bibserverqueries
Grav plugin to query a Bibserver.
https://github.com/asmeikal/grav-plugin-bibserverqueries
grav-plugin
Last synced: 2 months ago
JSON representation
Grav plugin to query a Bibserver.
- Host: GitHub
- URL: https://github.com/asmeikal/grav-plugin-bibserverqueries
- Owner: asmeikal
- License: mit
- Created: 2017-04-17T16:58:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T11:27:41.000Z (about 8 years ago)
- Last Synced: 2025-01-20T21:23:58.199Z (4 months ago)
- Topics: grav-plugin
- Language: PHP
- Size: 18.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Bibserver Queries Plugin
The **Bibserver Queries** Plugin is for [Grav CMS](http://github.com/getgrav/grav). Its intended usage is to make queries to the MCLab Bibserver from Grav pages, and to make available the result of the queries inside the template.
## Installation
To install this plugin, just download the zip version of this repository and unzip it under `/your/site/grav/user/plugins`. Then, rename the folder to `bibserverqueries`.
You should now have all the plugin files under
/your/site/grav/user/plugins/bibserverqueries
> NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav) to operate.## Configuration
Before configuring this plugin, you should copy the `user/plugins/bibserverqueries/bibserverqueries.yaml` to `user/config/plugins/bibserverqueries.yaml` and only edit that copy.
To configure the plugin, edit the `bibserverqueries.yaml` file and set the base `url` of the Bibserver you will be querying, and the OAuth `token` for said Bibserver.
```yaml
enabled: true
token: [OAuth token]
url: [Bibserver base url]
```## Usage
To query the Bibserver, use the Twig function `bibserver_query(query, url='query')`.
The `query` parameter specifies the query to be sent to the Bibserver, _e.g_, a list of keys if `url` is `key-list`, or a standard MongoDB query (as an associative array) if `url` is the default `query`.
The `url` parameter specifies to which `url` the query will be sent.