2017 © Pedro Peláez
 

library ezplatform-website-switcher

Adds option to suggest to the user to visit your website in another language. This bundle uses the main language of the browser in order to redirect to the correct site.

image

clash82/ezplatform-website-switcher

Adds option to suggest to the user to visit your website in another language. This bundle uses the main language of the browser in order to redirect to the correct site.

  • Monday, January 2, 2017
  • by clash82
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

eZ Platform Website Switcher

SensioLabsInsight, (*1)

With this bundle, you can suggest to the user to visit your website in another language. This bundle uses the main language of the browser in order to redirect to the correct site., (*2)

screenshot, (*3)

Requirements

  • Symfony v2.6 or later
  • eZ Publish 5.4 / eZ Platform 1.x or later

Installation

This package is available via Composer, so the instructions below are similar to how you install any other open source Symfony Bundle., (*4)

Run the following command in a terminal, from your Symfony installation root (pick most recent release):, (*5)

composer require clash82/ezplatform-website-switcher

Enable the bundle in app/AppKernel.php file:, (*6)

$bundles = array(
    // existing bundles
    new Clash82\EzPlatformWebsiteSwitcherBundle\Clash82EzPlatformWebsiteSwitcherBundle()
);

Add external assets to your bundle:, (*7)

  • CSS:
bundles/clash82ezplatformwebsiteswitcher/css/website_switcher.css
components/flag-icon-css/css/flag-icon.min.css
  • JS:
bundles/clash82ezplatformwebsiteswitcher/js/website_switcher.js

If you are installing bundle via composer require you must also copy assets to your project web directory. You can do this by calling Symfony built-in command from the project root directory:, (*8)

php app/console assets:install --symlink

Configuration

This is an example of required settings (config.yml):, (*9)

ez_website_switcher:
    # name to be used to store banner status
    cookie_name: websiteSwitcherStatus

    # how many days banner should be hidden when user disables the banner?
    days: 365

Supported languages are detected from your eZ Publish / eZ Platform installation., (*10)

Usage

Insert the following {{ show_website_switcher_banner() }} helper somewhere in your header template close after body opening tag., (*11)

The following optional parameters can be set as an argument in an array format (overrides default settings and parameters from config.yml file):, (*12)

Parameter Default value Description
cookieName websiteSwitcherStatus Sets your own status cookie name
days 365 Says how many days website switcher banner should be hidden when user disables the banner

Example of usage in standard eZ Publish / eZ Platform application:, (*13)

{{ show_website_switcher_banner() }}

or, (*14)

{{ show_website_switcher_banner({
   cookieName: 'myCookie',
   days: 7
}) }}

The Versions

02/01 2017

dev-master

9999999-dev https://github.com/clash82/ezplatform-website-switcher

Adds option to suggest to the user to visit your website in another language. This bundle uses the main language of the browser in order to redirect to the correct site.

  Sources   Download

MIT

The Requires

 

translations languages ezpublish ezplatform localisation ezsystems clash82 siteaccess

02/01 2017

v1.0.0

1.0.0.0 https://github.com/clash82/ezplatform-website-switcher

Adds option to suggest to the user to visit your website in another language. This bundle uses the main language of the browser in order to redirect to the correct site.

  Sources   Download

MIT

The Requires

 

translations languages ezpublish ezplatform localisation ezsystems clash82 siteaccess