The <!--System:StartNextEvent--> Command is just the beginning of a larger part to allow fully customized presentation of the next X events.
It works similarly to the <!--System:StartEmbedMenu--> commands, which allow you to embed a customized menu into your layout.
We'll start with an example, and proceed to explaining the commands in more detail.
In the "Wrath of the Lich King" drop-in template, is the following code:
<div class="events">
<!--System:StartNextEvents:4-->
<!--Event:IfNone--><span id="blue-header">Nothing Scheduled</span><!--Event:EndIfNone-->
<!--Event:StartEventList-->
<span id="blue-header">Upcoming Events:</span>
<ul>
<!--Event:StartEvent-->
<li><!--Event:Date--> <!--Event:Time-->: <span class="event"><!--Event:Link--></span></li>
<!--Event:EndEvent-->
</ul>
<!--Event:EndEventList-->
<!--System:EndNextEvents-->
</div>
Which, when processed turns into something like this:
<div class="events">
<span id="blue-header">Upcoming Events:</span>
<ul>
<li>Wed, Apr 2nd 12:30pm: <span class="event"><a href='javascript:eventdetails_by_id(1101)' onMouseover="tt('...')" OnMouseout='ctt()'>AQ20</a></span></li>
<li>Thu, Apr 3rd 12:30pm: <span class="event"><a href='javascript:eventdetails_by_id(1102)' onMouseover="tt('...')" OnMouseout='ctt()'>Blackwing Lair</a></span></li>
<li>Mon, Apr 7th 12:30pm: <span class="event"><a href='javascript:eventdetails_by_id(1103)' onMouseover="tt('..')" OnMouseout='ctt()'>Zul'Gurub</a></span></li>
<li>Wed, Apr 9th 12:30pm: <span class="event"><a href='javascript:eventdetails_by_id(1104)' onMouseover="tt('...')" OnMouseout='ctt()'>Karazhan</a></span></li>
</ul>
</div>
So you can see what it does.
If there are no events, then it simply turns into this
<div class="events">
<span id="blue-header">Nothing Scheduled</span> </div>
Now, for the explanation of the various commands.
<!--System:StartNextEvents:X:Category--> - The command that begins the process. X is the number of next events to display. The
Category argument is optional, and if present, will only display events from the Event Category
Category. If you wish to omit, the Category argument, make sure to omit the Colon ( : ) before the category as well.
So for example,
<!--System:StartNextEvents:5--> will display the next 5 events, while
<!--System:StartNextEvents:3:Karazhan--> will display the next 3 events with the Event Category "Karazhan"
<!--System:EndNextEvents--> - This is the end of the Next event code. This is required, or the entire Next Event block will simply be ignored.
All of the code for the Next events must be enclosed between the
<!--System:StartNextEvents--> and
<!--System:EndNextEvents--> commands.
Within that block, are a series of specialized commands for displaying the next event information. Notice that ALL of the Next Event commands inside this block are of the format
<!--Event:XYZ--> (This is opposed to the
<!--System:XYZ--> format)
<!--Event:IfNone--> and <!--Event:EndIfNone--> - If there are no events scheduled, then the system will display the information between
<!--Event:IfNone--> and
<!--Event:EndIfNone-->. In the above example, from the Wrath template, notice that we had
<!--Event:IfNone--><span id="blue-header">Nothing Scheduled</span><!--Event:EndIfNone-->
Which, when nothing was scheduled rendered as
<span id="blue-header">Nothing Scheduled</span>
<!--Event:StartEventList--> and <!--Event:EndEventList--> - This is the opposite of the IfNone command. The contents between these two commands will display if there are events scheduled.
The following commands must all be between
<!--Event:StartEventList--> and
<!--Event:EndEventList--><!--Event:StartEvent--> and <!--Event:EndEvent--> - This is the definition for each individual event. For each event, it will display everything between these two commands. If you'll notice in the above example from the Wrath template, we were showing 4 events, and it showed the formatted copy of this code 4 times.
<!--Event:Date--> - This will display the Date in semi-long format: Apr 1, 2007
<!--Event:ShortDate--> - This will display the date in short format: 12/31/2007
<!--Event:Time--> - This will display the time of the event: 12:35pm
<!--Event:Link--> - This displays the name of the event in a formatted hyperlink, complete with the hover-over text. For example:
<a href='javascript:eventdetails_by_id(1102)' onMouseover="tt('...')" OnMouseout='ctt()'>Blackwing Lair</a>
Be sure to read over this a few times for it to truly sink in.
Last Modified: 4/1/2008 11:42pm
Contributors:
Chops
Easy Link
BBCode Link: [guide=--SystemStartNextEvents--][/guide]
URL: http://dkpsystem.com/guide/--SystemStartNextEvents--
|