[Galdget] Restaurant menu

Please note that the pictures, used in the gallery examples on this page, come from pixabay site.

Imagine you are the proud owner of a restaurant, and you want to publish your weekly menu on your blog. But not all days at once, that would not be convenient. The guests want to see today’s menu – if they are planning to visit the restaurant today, or the menu for the next day or two.

So you set up a small gallery for each day, and then put the current day’s gallery on the page or post, with a shortcode. The result: when your guests visit the page – they see today’s menu. Like the one below:

Today we offer:

Galdget plus+ gallery image

When they hover over the picture, the slide show stops and a popup box is shown with the name of the item they are seeing.

Galdget Restaurant menu

When they come back to the same page the next day, they see the next day’s menu, and so forth. Of course, you also want to show them what’s on the menu in the next couple of days, maybe they are planning to visit you tomorrow. So you use the same daily menus, only shifted for one and for two days, and put something like the below on your page/post or in a couple of widgets:

Menu for Tomorrow
Galdget plus+ gallery image
Menu for the day after Tomorrow
Galdget plus+ gallery image

And this is it. You can also see the two widgets in the widget area on the left.

Now let’s see how we did it. A friendly advice when doing a bit more complex setups: establish your local installation of WordPress and use it to set the thing up. It goes a lot faster when you do it locally. Once finished – upload the files to your blog and set it up as you did on your local machine.

A folder for each day – dir://

For each day we will have a separate folder, which we will enlist in the URL setup as, e.g. dir://DailyMenu/1 and so forth. You can use the folder names at your choice, but the simplest ones will also work. I use numbers 1 to 7 as folder names. In each folder we put the pictures of the meals for that day. Please note that the pictures in the dir:// are displayed in alphabetical order, so we simply put numbers in front of the image name and get the order right.

Galdget Restaurant menu setup

In dir:// there is a possibility to provide two additional details for each image: URL and the image description. To do this – we create a .txt file with the same name as image file. The first line in such file holds the URL that we want to be opened then the visitor clicks on the image. If we leave the first line empty, the image URL will be used, so we don’t have to type it if it points to the image itself. All other lines are the image description which, as already mentioned above, will be displayed in a popup box when the visitor hovers the mouse over the image.

Up to now, we should have seven folders, one for each day, with the images and corresponding .txt files, and seven items in the URL setup, like this:

Galdget Restaurant menu setup weekly

As can be seen in the picture above, we use the “slug” modifier to designate which dir:// is displayed at which day of the week. dow.1 means that this item will be displayed only at Mondays, and so forth, up to dow.7 at Sundays.

One last detail is important for “today’s” menu setup: we must dedicate a group in the URL setup, which we did not use for other galleries on our blog. In this example, we have chosen group 15, and already put it in the URL setup. This is all we need to be able to display a menu on a page, using shortcode.

[galdget width=600 height=400 group=15 buttons=none
  images=fill animation=rnd]

And this is all we need if we want to display the menu for the current day on a blog page or post.

It takes a couple more details to do it in a widget, and to do it for the next day and not the current one. Please bear with me.

Tomorrow and the day after

We know what to do to display the menu for the current day,

  • dir://DailyMenu/1 with slug dow.1
  • dir://DailyMenu/2 with slug dow.2
  • dir://DailyMenu/6 with slug dow.6
  • dir://DailyMenu/7 with slug dow.7

put it all in a separate group and that’s it.

To display the menu for tomorrow, we need another setup similar to this one, only skewed by one day:

  • dir://DailyMenu/1 with slug dow.7
  • dir://DailyMenu/2 with slug dow.1
  • dir://DailyMenu/6 with slug dow.5
  • dir://DailyMenu/7 with slug dow.6

We simply say “display the menu for Monday at Sunday” down to “display the menu for Sunday at Saturday”. Of course, we set these seven items in another group, say 16, and it is ready to be displayed on a page or post. We use the same folders, pictures and .txt files, of course, we only need seven new items in the URL setup list.

It goes the same way for the day after tomorrow, only skewed by two days:

  • dir://DailyMenu/1 with slug dow.6
  • dir://DailyMenu/2 with slug dow.7
  • dir://DailyMenu/6 with slug dow.4
  • dir://DailyMenu/7 with slug dow.5

We set it to group 17 and we are done. The shortcode for “the day after tomorrow” would be:

[galdget width=300 height=200 group=17 buttons=nonstop
  images=fill animation=rnd]

Remember, it was smaller than the menu for the current day, so it has width=300.

One final remark for this section: in order to introduce two new groups, you don’t have to edit the URL list on the URL list setup page, this would mean that you would have to enter each item manually. Better way to do it would be to export the list, edit it in some text editor or spreadsheet application, save it and import it back. For example, a freeware text editor Notepad++ can be very handy for this job, since it has a block edit feature.

Widgets displayed on one page only

All we learned so far on this page is good to be used in shortcodes, because a shortcode lives in a page or in a post, and it is only displayed when this particular page or post is displayed.

Widgets in WordPress are displayed on all blog pages or posts. So if we set up a widget to display the group 16 (tomorrow) – it will be displayed on all blog pages, posts, etc.

But [Galdget p+] widgets do not obey that rule. Actually they do, but they are not displayed if their URL list is empty. Each URL list item can have “slug” modifiers that allow them to be displayed only on some pages/posts/categories, and not on others.

If we put the page slug after the dow.1, it would allow the corresponding link to be displayed only on one page. For example, the slug of the page you are now reading is galdget_restaurant-menu and the combination dow.1,galdget_restaurant-menu means that the link will be displayed only on this page and only at Mondays. All we need to do is put the page slug after the dow slug for all links in groups 16 and 17, and widgets that display the groups 16 and 17 will be present only in this page.

If we want to display the widgets on a number of pages, the best option would be to use a category or tag slugs and assign the pages to a single category, or a single tag.

The complete setup

Now let’s recap the whole story, but in short form.

To create a daily menu with the “Today”, “Tomorrow” and “The day after Tomorrow” galleries, the last two also to be used in widgets, we need the following:

URL lists for three groups

URL Group Slugs
dir://Galleries/DailyMenu/1 15 dow.1
dir://Galleries/DailyMenu/2 15 dow.2
dir://Galleries/DailyMenu/3 15 dow.3
dir://Galleries/DailyMenu/4 15 dow.4
dir://Galleries/DailyMenu/5 15 dow.5
dir://Galleries/DailyMenu/6 15 dow.6
dir://Galleries/DailyMenu/7 15 dow.7
dir://Galleries/DailyMenu/1 16 dow.7,galdget_restaurant-menu
dir://Galleries/DailyMenu/2 16 dow.1,galdget_restaurant-menu
dir://Galleries/DailyMenu/3 16 dow.2,galdget_restaurant-menu
dir://Galleries/DailyMenu/4 16 dow.3,galdget_restaurant-menu
dir://Galleries/DailyMenu/5 16 dow.4,galdget_restaurant-menu
dir://Galleries/DailyMenu/6 16 dow.5,galdget_restaurant-menu
dir://Galleries/DailyMenu/7 16 dow.6,galdget_restaurant-menu
dir://Galleries/DailyMenu/1 17 dow.6,galdget_restaurant-menu
dir://Galleries/DailyMenu/2 17 dow.7,galdget_restaurant-menu
dir://Galleries/DailyMenu/3 17 dow.1,galdget_restaurant-menu
dir://Galleries/DailyMenu/4 17 dow.2,galdget_restaurant-menu
dir://Galleries/DailyMenu/5 17 dow.3,galdget_restaurant-menu
dir://Galleries/DailyMenu/6 17 dow.4,galdget_restaurant-menu
dir://Galleries/DailyMenu/7 17 dow.5,galdget_restaurant-menu

Shortcode for the main gallery

[galdget width=600 height=400 group=15 buttons=none
  images=fill animation=rnd]

Shortcodes for the small galleries “Tomorrow” and “The day after Tomorrow”, together with the table markup that is used up above in this page

<table><tr><td>Menu for Tomorrow
[galdget width=300 height=200 group=16 buttons=nonstop
  images=fill animation=rnd]
</td>
<td>Menu for the day after Tomorrow
[galdget width=300 height=200 group=17 buttons=nonstop
  images=fill animation=rnd]
</td></tr></table>