A javascript plugin for anyone who wants to embed ALISS search on their own site.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
node_modules
src
.gitignore
LICENSE
README.md
package-lock.json
package.json
webpack.config.js

README.md

aliss.js

ALISS (A Local Information System for Scotland) is a service to help you find help and support close to you when you need it most.

aliss.js is a javascript plugin for anyone who wants to embed ALISS search on their own site.

Usage

  1. Download aliss.js

  2. Include the script on the header of the page where you want to use the plugin.

<script src="aliss.js"></script>
  1. Create an HTML element on the page where you want to see the plugin appear
<div id="aliss-target"></div>
  1. Put this at the bottom of the page with the new element
<script>
window.aliss = new ALISS('#aliss-target',{});
</script>

Options

ALISS(target,options) - takes two parameters, a target, and an options object.

Potential options are:

{
  "q": <string: a default keyword, defaults to blank>,
  "category": <string: category slug, defaults to blank>,
  "show_category_select": <boolean: whether to display the category selector, defaults to true>,
  "show_keyword_search": <boolean: whether to display the keyword input, defaults to true>,
  "page_size": <int: number of services returned per page, defaults to 10>,
}

You can find the full list of categories including slugs via the ALISS API.

Examples

Hide the category select and confine service results to the "money" category:

window.aliss = new ALISS('#aliss-target', { category: "money", show_category_select: false });

Demo

You can find example code, and a demo on glitch.com.

Plugin Development

PRs welcome!

Edit src/aliss.js, then build for production by running webpack cli:

npx webpack --config webpack.config.js

Links