00759: Daily Message

Summary: Daily Message
Created: 2006-06-19 07:03
Status: Closed
Category: Cookbook
From: Kersti
Assigned:
Priority: 5
Version:
OS:

Description: I need to be able to implement a daily message based on the date - something that would let me put in messages to my team like these on a particular date.

  • Only 5 days until sales close
  • Bob's birthday
  • CEO visit today

I tried using the javascript markup to include a script that would do this, but couldn't get it working - any ideas?

The Random quote and rotate markup functions are no good as they change with every load.


Did you take a look at the date option of conditional markup? For example, one can do:

(:if date 20060620:)(:include SomePage:)(:if:)

which will display SomePage only on June 20, 2006. There are also options available to say things like "after date", "before date", and "between date1 and date2".

--Pm


It's close, but not quite - to use conditional markup I'd need to have if statements for every day - that's 365 lines in the file, which is quite a load. Was wondering if there's a more elegant way to achieve this.

Essentially what I want is something like

(:include PageCalledDate:)

Well, maybe someone else has a similar problem...

Both methods assume that the pages to be included are named in the form yyyy-mm-dd

Since the introduction of Markup Expressions, this would do the trick: (:include {(ftime fmt="%F")}:)

Another method would be $FmtPV['$Today'] = 'date("Y-m-d")'; in a config file and (:include {$Today}:) in the wiki page where you want it included.

Anke January 15, 2008, at 09:46 AM


See also Cookbook:Reminder for a slightly different approach. --Petko