Widgets

This page presents the meilleures-entreprises.com javascript widget.

All the widgets are responsive, which means that their content will adpat to the available space.
All the widgets are asynchronously loaded, which means that they will not slow your page loading.

For each of them, you will find display examples, the widget code and the possible configuration attributes.


Currenlty available widgets:

"ScoresBox" widget

This widget displays all the available scores (and stars) for the given company.

Examples :
<!-- Widget container. The content will adapt responsively to the available width. -->
<div class="mentreprises-scoresbox-container" data-company="Carrefour"></div>

<!-- Script to load the widget content. The containerClassName must point to the widget container(s). -->
<script>
  window.mentreprisesAsyncInit = function() {
    Mentreprises.init({
      scores: { containerClassName: 'mentreprises-scoresbox-container' }
    });
  };
  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id; js.charset = 'utf-8';
     js.src = ('https:' === document.location.protocol ? 'https:' : 'http:') + '//meilleures-entreprises.com/ext/api.js';
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'mentreprises-js'));
</script>
Container attributeDescription
data-companyName of the company

"StarsBox" widget

This widget displays the chosen score type ("employees", "trainees" ou "candidates") for the given company.

Examples :
<!-- Widget container. -->
<div class="mentreprises-starsbox-container" data-company="Carrefour" data-type="trainees"></div>

<!-- Script to load the widget content. The containerClassName must point to the widget container(s). -->
<script>
  window.mentreprisesAsyncInit = function() {
    Mentreprises.init({
      stars: { containerClassName: 'mentreprises-starsbox-container' }
    });
  };
  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id; js.charset = 'utf-8';
     js.src = ('https:' === document.location.protocol ? 'https:' : 'http:') + '//meilleures-entreprises.com/ext/api.js';
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'mentreprises-js'));
</script>
Container attributeDescription
data-companyName of the company
data-typeScore type: "employees", "trainees" or "candidates"
data-stars-sizeStars size: "big", "medium" or "small"

"Reviews" widget

This widget displays the chosen score ("employees", "trainees" or "candidates") for the given company.

Examples :
<!-- Widget container. The content will adapt responsively to the available width. You can set the height with data-height if needed. -->
<div class="mentreprises-widget-container" data-company="Carrefour" data-type="trainees" data-height="auto"></div>

<!-- Script to load the widget content. The containerClassName must point to the widget container(s). -->
<script>
  window.mentreprisesAsyncInit = function() {
    Mentreprises.init({
      widgets: { containerClassName: 'mentreprises-widget-container' }
    });
  };
  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id; js.charset = 'utf-8';
     js.src = ('https:' === document.location.protocol ? 'https:' : 'http:') + '//meilleures-entreprises.com/ext/api.js';
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'mentreprises-js'));
</script>
Container attributeValue
data-companyName of the company
data-typeDefault tab to display: "employees", "trainees" or "candidates"
data-heightWidget height. Can be a number of pixels or "auto" to make the widget self-adpat to its content

"Hover" widget

This widget is the easiest to integrate, as it does not require any page design.
The widget will appear in the bottom left corner of your site, hovering your actual content.

Examples :
<!-- Script to load the hover content. -->
<script>
  window.mentreprisesAsyncInit = function() {
    Mentreprises.init({
      hover: { companyName: 'Carrefour', types: [ 'employees', 'trainees', 'candidates' ] }
    });
  };
  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id; js.charset = 'utf-8';
     js.src = ('https:' === document.location.protocol ? 'https:' : 'http:') + '//meilleures-entreprises.com/ext/api.js';
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'mentreprises-js'));
</script>

About window.mentreprisesAsyncInit()

The window.mentreprisesAsyncInit() function is executed once the asynchronous javascript is loaded.

It lets you define what Mentreprises widgets / modules you want to activate in the current page (starsbox, scoresbox, widget, hover, ...).

You can add a "lang: 'fr'" parameter to force the language. By default, the language will be extracted from the html lang="" attribute of the page.

You can add a "doLog: true" parameter to print helpful logs in the window console.