Skip to content

aliss/aliss.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Install

  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 footer of the page with the new element
<script>
window.aliss = new ALISS('#aliss-target',{});
</script>

Install with Wordpress

  1. Install the "Insert Headers and Footers" wordpress plugin, or similar plugin which allows you to insert HTML <script> tags.

  2. Upon activation, visit the Settings » Insert Headers and Footers page. You will see two boxes, one for the header and the other for the footer section.

  3. Follow the install instructions above.

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

About

A javascript plugin for anyone who wants to embed ALISS search on their own site.

Resources

License

Stars

Watchers

Forks

Packages

No packages published