Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi guys,

I am currently doing something for a local restaurant and would like to achieve this one thing:

The proprietor would like to provide his website visitors with a lunch menu for he week (which is published every Sunday evening) and also for the current day. Ideally, the visitor should be presented the current day menu AND links to "next day" and "the whole" week. Is this achIevable woth the (pretty amazing) Couch, please?

My suspition is that I need to use 7 pages cloned weekly from a single template (basically a simple a table), each with a date (or day) field...
...and then use the "custom_field" parameter and/or "k_day" and/or "k_date"...
...to either display the entire week OR to compare the day in the page with current day to display the "today`s menu page".

Also, if I want to show all 7 pages cloned from that template in a single page (for a weekly menu), it is basically the same logic as in the Aurelius blog example, correct?

Does that make sense, please - or can you kindly give me a hint?

Thanks a lot in advance!

Majkl

Edit:

Could it be something like this?

listing the entire week:

Code: Select all
<cms:embed 'seznam_novinek.php' />

...which contains
Code: Select all
<cms:pages masterpage='daily-lunch-menu.php'>
   <div>
      <h2><cms:show k_page_title />, <cms:date k_page_date format='d. m. Y'/></h2>
      <cms:show text1 />
   </div>
</cms:pages>

...while the daily-lunch-menu.php is the actual template containing basically a single 2x7 table

link to display the "today"

Code: Select all
<cms:set today="<cms:date format='Y-m-d' />" />
<cms:pages masterpage='daily-lunch-menu.php' orderyby='end_date' order='asc'>
<cms:if today = day-date > <!-- the day-date being a field input in proper format as custom_field in the cloned page -->
   <a href="<cms:show k_page_link />">click to see today`s menu</a>
   <cms:else />
   <p> We don't cook today</p>
   <p>Check out the <a href="weekly-menu.php">weekly menu</a>.</p> <!-- a page with embedded snipet containing all cloned pages of <cms:pages masterpage='daily-lunch-menu.php' orderyby='end_date' order='asc'> -->
</cms:if>

...or do I need to create a separate snipet for the "today" view too?
"Today" is a mere date, so can be handled via certain parameters of cms:pages like start_on and stop_before.
Admin on Sunday will create 7 new cloned pages (Mo-Su) with lunch text and set publish date of each page to corresponding date of the coming week. show_future_entries parameter will help to configure cms:pages to display those pages.
If you have more small questions, feel free to post them in skype group for a quick answer.
Thanks, trendoman ... so the show_future_entries and start_on / stop_before will actually let me display even pages with a publish date set to the future (i.e. not yet published)? [url]viewtopic.php?f=4&t=1552[/url] and [url]viewtopic.php?p=15310#p15310[/url] suggests so. Is there a documentation for this tag somewhere, please?

This project is not in my focal point at this very moment but may soon be and it is definitely interesting for such restaurant concepts. In every case, I would like to do as much on my own as I can ... only may need to get on the right track. Appreciated, anyway, will be back for more soon.
3 posts Page 1 of 1