IncludeUpcoming

The trick to combine Include with MonthCalendar for blogging is great. I was thinking in using the same combination for getting an "Upcoming events" section in the main page of a wiki. The idea was placing the events in a MonthCalendar and use the Include to make the next, say, 5 events appear in the main page. However I realized that this requires the notion of "today" to select the event from today on. I couldn't find a way to call Include and make it know about what day was today. So I just hacked in a really dirty fashion the Include macro to create

Syntax

For most arguments see HelpOnMacros/Include.

Unlike Include, avoid using regular expressions in the first entry. Just place there the name of a wiki page holding a MonthCalendar:

[[IncludeUpcoming(MeetingsCalendar,,items=5,titlesonly)]]

Try this for a short introduction for each event (until the first occurrence of "----" in the page describing the event):

[[IncludeUpcoming(MeetingsCalendar,,to="^----",items=5)]]

TO-DO

Bugs

Wrong HTML

The Macro does not close the  <dl>  HTML Tag and creating for every single page a new Definition List. On Windows Internet Explorer 7.0 the output looks quite stupid. Firefox on Windows or Linux does not get irritated about this wrong html:

<dl>
    <dt>2008-03-07</dt>
    <dd><a href="/Musik/Events/2008-03-07"> Vengeance, Uster </a></dd>

        <dl>
        <dt>2008-03-10</dt>
        <dd><a href="/Musik/Events/2008-03-10">HIM und Paradise Lost, Zürich</a></dd>

            <dl>
            <dt>2008-03-11</dt>
            <dd><a href="/Musik/Events/2008-03-11">Overkill, Zürich</a></dd>
         
                ....

Guess, the calls around line 180-208 on the macro  formatter.definition_list(0)  may has some problems. In my eyes only one  <dl>  is needed and not for every single included page titles! well, don't know yet how to fix it. -- MarcelHäfner 2008-03-07 16:44:49

Comments

A link to an example page would be nice. -- ThiloPfennig 2006-12-02 19:37:55

I am working on reorganizing the MacroMarket page to have subpages for each macro. Would you mind me moving this page to MacroMarket/IncludeUpcoming ? -- JordanCronin 2008-01-28 22:35:24

Wonderful Macro! Is an update to 1.6 planned? MelaEckenfels - 2008-03-05

MoinMoin: MacroMarket/IncludeUpcoming (last edited 2008-03-07 21:52:43 by 254-138)