This is a Javascript widget that makes it easy to show the menu for any distributor on a HTML page.


The widget consists of two HTML tags - one div and one script. It calls the Open Meal API to get the menu from a distributor and displays it in a table. It can be configured in several ways (se Configuration below) and it is possible to include several widgets showing the menu for different distributors on one page.


<div id="openMealWidget" class="openMealWidget" data-openmealurl=""></div>
<script src="" id="openMealWidgetScript" data-widgets="openMealWidget"></script>

The code above results in this table:


With the following wizard you can get the HTML tags needed to be included on your site to show the menu for a specific distributor.

This wizard is built on the Open Meal API, just as the wiget itself is. Unfourtunatly we are having some problems with Mashies implementation of the Open Meal API at the moment, which we are working on.


The wizard above produces the bare minimum code needed to display the menu widget. It is possible to add several different attributes to the div tag...

  • id - the id of the div, must be listed in the data-widgets comma separated list of the script tag so that the widgets javascript can find this div
  • data-ical - true/false (defaults to false if not included), if the widget should include a button with a link to the menus iCalendar feed
  • data-language - en/sv (defaults to en), the language to be used in the table headers
  • data-days - integer (defaults to 5), the number of days to show the menu for. Note that the maximum is the number of days returned for that distributors menu.
  • data-openmealurl - the URL to the Open Meal API for the distributor in question. The easiest way to find this is using the wizard above.

The script tag also have some attributes...

  • id - the id of the script tag must be set to openMealWidgetScript for the widgets javascript to be able to find it.
  • data-widgets - a comma separated list of the id's of the widget divs on the page

Example: Two widgets on the same page

<div id="openMealWidget1" class="openMealWidget" data-language="en" data-openmealurl=""></div>

<div id="openMealWidget2" class="openMealWidget" data-ical="true" data-days="3" data-language="sv" data-openmealurl=""></div>

<script src="" id="openMealWidgetScript" data-widgets="openMealWidget1, openMealWidget2"></script>


The styling of the widget is based on Bootstrap classes, but it is easy to style even if you are not using Bootstrap. The widget is just a table within a div with the class openMealWidget and can be styled in any way needed using CSS.

License and customization

This widget and it's code is available under Creative Commons Zero license and has no guarantees. Use it, copy it and customize it as needed.

The widgets code is available here.