Skip to content

Commit

Permalink
Merge branch 'pikant-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
clemdesign committed Nov 23, 2018
2 parents f43802b + 31d27db commit 616eeec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,20 @@ This will clone this repository into the _language-selector_ folder.

# Usage

The `Language Selector` plugin doesn't require any configuration. You do however need to add the included Twig partials template into your own theme somewhere you want the available languages to be displayed.
## 1. Define the supported languages

In `system.yaml`, add the supported languages in `languages.supported` parameter.

Example:

languages:
supported:
- fr
- en

## 2. Integration

You do need to add the included Twig partials template into your own theme somewhere you want the available languages to be displayed.

```
{% include 'partials/language-selector.html.twig' %}
Expand All @@ -54,7 +67,7 @@ You can now edit the override and tweak it however you prefer.

`language-selector` need jQuery to display dropdown language menu.

## Usage of the `hreflang` partial
## 3. Usage of the `hreflang` partial

A second template is available for `hreflang` annotations in the header of the page. In order to emit language annotations for the available languages of a page you need to add the corrsponding Twig partial template into the `<head>` section of your page, which can typically be found in `base.html.twig`:

Expand Down
2 changes: 1 addition & 1 deletion js/language-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var dropdownmenu={
if (this.builtdropdownids.length === 0){ //only bind click event to document once
$(document).bind("click", function(e){
if (e.button === 0){ //hide all dropdown (and their sub ULs) when left mouse button is clicked
$('.jqdropdown').find('ul').andSelf().hide()
$('.jqdropdown').find('ul').addBack().hide()
}
})
}
Expand Down

0 comments on commit 616eeec

Please sign in to comment.