Skip to content
WXP Plugins

Plugins

WXP Restaurant Menu

WXP Opening Times

WXP Local Events

WXP Restaurant Reservations

Demo

Pricing

Support

Docs

FAQ

Buy

Menu

Plugins

- WXP Restaurant Menu

- WXP Opening Times

- WXP Local Events

- WXP Restaurant Reservations

Demo

Pricing

Support

- Docs

- FAQ

Buy

WXP Opening Times

8
  • Installation
    • Installing WXP Opening Times
  • Basic operations
    • Creating your (first) schedule
    • Setting exceptions
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Opening Times shortcodes
  • Jewish and Islamic holidays
    • Installation
      • Installing WXP Opening Times: Jewish and Islamic holidays
    • For developers
      • Jewish and Islamic holidays: for developers

WXP Restaurant Menu

11
  • Installation
    • Installing WXP Restaurant Menu
  • Basic operations
    • Understanding the concept
    • The Settings for the WXP Restaurant Menu Plugin
    • The Icon menu
    • The Sets Menu
    • The Tags Menu
    • The Groups Menu
    • The Categories menu
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Restaurant Menu shortcodes

WXP Local Events

8
  • Installation
    • Installing WXP Local Events
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Local Events shortcodes
  • Local Events for WooCommerce
    • Installation
      • Installing WXP Local Events for WooCommerce
    • For developers
      • Local Events for WooCommerce: for developers
  • Events Feed
    • Installation
      • Installing WXP Events Feed
    • For developers
      • Events Feed: for developers

WXP Restaurant Reservations

6
  • Installation
    • Installing WXP Restaurant Reservations
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Restaurant Reservations shortcodes
  • Rooms
    • Installation
      • Installing WXP Restaurant Bookings: Rooms
    • For developers
      • Rooms: for developers

General Developer Information

1
  • Twig
    • Twig templates in the WXP plugins

WXP Agency Kit

1
  • WXP Agency Kit: demo content from the command line
View Categories
  • Home
  • Documentation
  • WXP Restaurant Menu
  • For developers
  • Twig templates

Twig templates

4 min read

0:00 / 4:16
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)

The layouts of WXP Restaurant Menu are Twig templates. This guide lists the templates, the values they receive and how to make your own. For an introduction to Twig and the lookup order, see General Developer Information → Twig.

Menu templates #

For the shortcode [wxp_menu], the block and the widget.

File Name What it shows
default.html.twig Default Categories as headings, items as rows with a small image, the title, the price and the description.
cards.html.twig Cards Items as cards in a grid, with a large image on top.
compact.html.twig Compact A price list in columns, without images.
elegant.html.twig Elegant Centred, like a printed menu, with ornamental lines between the categories.
side-by-side.html.twig Side by side The category title on the left and the items on the right.

Selection templates #

For the shortcode [wxp_menu_selection], the block and the widget. The file names start with selection-; in the template parameter you leave that part out, so template="cards" uses selection-cards.html.twig.

File Name What it shows
selection-default.html.twig Default Each dish with a large photo on top, then the title, the description and the price.
selection-cards.html.twig Cards Each dish as a card, with the title and the price on one line.
selection-text.html.twig Text only One line per dish: the title on the left and the price on the right.

Partials #

File Used for
_sections.html.twig The category sections of a menu, or of one tab.
_tabs.html.twig The tabs, when the tabs option is on.
_category.html.twig The title and description of a category.
_filters.html.twig The filter buttons for visitors.
_item.html.twig, _card.html.twig One item as a row, or as a card.
_meta.html.twig The line with the number of persons, groups and tags.
_macros.html.twig Shared macros for the data attributes, colours and icons.

You can override a partial in the same way as a template: put a file with the same name in your child theme.

Your own template #

{# Template Name: My menu
 # Image Size: thumbnail #}
<div class="wxp-menu wxp-menu--mine">
	{% include '_filters.html.twig' %}
	{% include (tabs ? '_tabs.html.twig' : '_sections.html.twig') with { item_partial: '_item.html.twig' } %}
</div>
  • Save it as my-menu.html.twig in wxp-restaurant-menu/ in your child theme and use [wxp_menu template="my-menu"]. A selection template is called selection-my-name.html.twig and used with template="my-name".
  • The header lines in the comment are optional: Template Name is the name in the template list of the widget, and Image Size is the image size used when the shortcode asks for “automatic”.
  • Markup contract: keep one root element with the class wxp-menu, each category in an element with wxp-menu__section and the attributes data-category and data-depth, and each item in an element with wxp-menu__item and the data-groups and data-tags attributes (the macro item_data prints them). The visitor filters depend on this. For a selection, print one list with the class wxp-selection__items of li elements with the class wxp-selection__item.
  • Only the fields that end in _html are safe to print with |raw. Everything else is escaped.

Values in the menu templates #

Name Contents
sections A list of category (id, name, slug, description, colors), depth and items.
tabs With the tabs option: one tab per top level category. Empty without tabs.
filters The filter buttons: categories, groups and tags.
options show_images, show_descriptions, show_groups, show_tags, show_category_titles, heading_level, image_size, show_icons, term_colors, tabs and the filter options.
menu_id, labels, template A unique id of the menu on the page, translated texts and the name of the template.
item id, title, secondary_title, price, price_formatted, description_html, image_html, image_url, persons, persons_label, groups, tags and acf (extra fields, see the filter wxp_restaurant_menu_item_data).

Values in the selection templates #

Name Contents
items The dishes: the fields of an item, plus category (name and slug or nothing) and link (the category on the menu page, empty without a menu page).
options show_images, show_descriptions, show_prices, heading_level, image_size, mode and count.
labels Translated texts.

For the carousel and the random mode the plugin makes the element around the list; the template only prints the list. Add your own values with the filters wxp_restaurant_menu_template_context and wxp_restaurant_menu_selection_context.

Updated on October 30, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Filter- and action hooksWXP Restaurant Menu shortcodes
Table of Contents
  • Menu templates
  • Selection templates
  • Partials
  • Your own template
  • Values in the menu templates
  • Values in the selection templates
WXP Plugins

Demo

Pricing

© 2026 WXP Plugins. All prices are in euro, excluding VAT.

WXPPlugins is a brand of WP Digital Marketing - The Netherlands - Chamber of Commerce (KvK) 75580152