tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/267-recurring-eventsCascade CMS: Discussion 2014-09-25T13:22:30Ztag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-03T18:19:23Z2010-12-03T18:19:23Zrecurring events<div><p>I have done this before. It is kind of tedious in a looping
sense.</p>
<p>I gave the user a Recurring radio button option
(Recurring/Single), Start and End Dates, How often it Recurred
(Daily/Weekly), (in case Weekly was chosen) Days of the Week
checkboxes for what day of the week it recurred on (b/c it could
recur on more than one day).</p>
<p>I then using Velocity looped through every day and for every day
got all events that start date and end date were around the date,
marked as recurring Daily, or marked as recurring Weekly that had
the same Day of the Week as the date.</p>
<p>I have included a screen shot of my fields.</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-05T19:00:08Z2010-12-05T19:00:08Zrecurring events<div><p>Penny,<br>
Thanks for this. I had the days of the week button, but not the
recurring or how often options.</p>
<p>Any change you could send me the velocity script you used?</p></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-06T22:55:03Z2010-12-06T22:55:03Zrecurring events<div><p>Penny,<br>
I'm looking at our current calendar and it looks like we have some
events that recur on odd intervals (like on three weeks, off one
week).</p>
<p>Any thoughts on a way to let users choose a series of dates in
the data definition? If I allowed multiples on the start and end
date, would I be able to use a similar looping velocity script?</p></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-07T00:26:05Z2010-12-07T00:26:05Zrecurring events<div><p>Here is what I'm thinking now.</p>
<p>I copied the data definition and changed the way users enter
dates and start/end times.</p>
<p>For the dates, I added a calendar and allowed multiples.<br>
For start time - I used a group of three drop down menus (Hour,
Minute, AM/PM)<br>
For end time - I used a group of three drop down menus (Hour,
Minute, AM/PM)</p>
<p>Now I can use Velocity #if, #then statements to display the
multiple days on the page.</p>
<p>But I'm stumped for the "index" of events or the upcoming events
page. I assume I could still loop through every day and get the
events that start on that day for a daily view.<br></p></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-07T20:13:13Z2010-12-07T20:13:13Zrecurring events<div><p>Hey Lauren,</p>
<p>I have attached the Velocity that goes with what I originally
sent you. It utilizes an index block of my Event Content Type with
Append Calling Page selected as well.</p>
<p>It relies on your current page being named the month number (in
two digit format, so January should be 01 not 1). It will then make
a calendar grid for that month in the upcoming/current year.</p>
<p>This script could be modified to also pull in the year if you
wanted to make a folder for each month and year.</p>
<p>I would generally stick with using the Cascade Calendar items
rather than making my own because the value returned is actually a
unix timestamp that seems to mean more in Java and Velocity. I
would suggest maybe considering making a Group in your Data
Definition, allow this to be multiple and then within that have a
Start and End Date options. I have attached a screenshot of what I
think you may be going for, it allows for users to add multiple
start and end dates.</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-07T21:47:14Z2010-12-07T21:47:14Zrecurring events<div><p>Penny,<br>
Thanks for this. I'll take a look at it today.</p></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-07T23:18:32Z2010-12-07T23:18:32Zrecurring events<div><p>Penny,<br>
I'm a little confused on how to set up the folder/page structure.
Is my description below along the right lines?</p>
<p>I would create my events (page for each type of class. with
recurrence set using multiple start/end dates as needed). I could
hold all of these in the classes-events folder. For these, I could
write a velocity script to display the class data (CPR, Dates,
Times, Description, Fees, Location, Contact, etc).</p>
<p>Then I would create the calendar folder that has 12 pages, 01 -
12. For these pages, would I use an index block of the class-events
content type?</p>
<p>On these pages, I would use the velocity format you attached and
it would create a monthly calendar. The script would loop through
the "entries" on this monthly calendar listing would link back to
the class pages I've created.</p>
<p>Perhaps you could send me a link to an existing site using a
similar method, to help me wrap my head around it.</p></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-08T15:42:52Z2010-12-08T15:42:52Zrecurring events<div><p>Hey Lauren,</p>
<p>What you describe above seems pretty accurate. Clarification
though: for the calendar that I implemented, the calendar only went
forward and did not keep a list of past events. I always had 12
months, but those 12 months were related to the current month or
the future month. So my December was for 2010 but my November was
for 2011. You can modify the script so that you keep your years and
months and store your events per starting month. You will need to
change the Velocity to pull the year from the path of your current
page. In that case your folder structure would be like:<br></p>
<ul>
<li>2011
<ul>
<li>01</li>
<li>02</li>
</ul>
</li>
</ul>
<p>I am including screen shots of how everything is currently setup
with how the Velocity format that I sent you should work.<br></p>
<p>I have included a screen shot of my block, my file structure,
and the calendar display.</p>
<p>I am sorry but I do not currently have a site live viewable
outside our office.</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-08T15:49:36Z2010-12-08T15:49:36Zrecurring events<div><p>Penny, Thanks for these. It will be a big help.</p></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-22T02:16:56Z2010-12-22T02:16:56Zrecurring events<div><p>We used a small service pack to get our calendar up and running.
I now have two related questions.</p>
<ol>
<li>
<p>Is there a way to link to the current month in the calendar? For
example on our main Class/Events page we have a link that says
“Visit the calendar” – is there a way to have
that link to the current month without having to update the link
every month.</p>
</li>
<li>
<p>We'd like to add some navigation to our calendar pages. For
example on each Month's page there would be an icon that would
allow you to go to the previous or next month. A drop down menu
where you could choose the month and year would also be a nice
feature.</p>
</li>
</ol></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-22T15:04:31Z2010-12-22T15:04:31Zrecurring events<div><p>I have attached a txt file with the corresponding Formats.</p>
<ol>
<li>
<p>Attach a current page block. The following Velocity will work if
your folder structure is events -> yyyy -> mm. If not you may
have to slightly modify the path and date formatting.</p>
</li>
<li>
<p>The following should work for previous/next buttons assuming the
folder structure events -> yyyy -> mm and that your month
pages are in the correct folder order. This Format should be used
in combination with an Index Block of your events folder, going two
levels deep, rendering pages, xml does not need to be inline.</p>
</li>
</ol></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-22T15:25:36Z2010-12-22T15:25:36Zrecurring events<div><p>Penny,<br>
A few quick questions.</p>
<ol>
<li>I already have a block attached to my default area, so I
applied the current page block to my rightside bar area.</li>
</ol>
<p>I've attached the format, but it's not showing the link, just
the text. If I look at the format, it looks like it's just setting
the current date and month. What path do I need to use for the
link?</p>
<ol>
<li>
<p>For the next/previous month buttons, do I need to add this to
the existing format that displays our calendar pages in a
table?</p>
</li>
</ol></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-22T15:41:12Z2010-12-22T15:41:12Zrecurring events<div><ol>
<li>
<p>Adjust the path before the ${currentMonth} part of the path. I
think you may have calendar instead of events. $currentMonth should
currently output 2010/12 so I think you need /calendar/2010/12.</p>
</li>
<li>
<p>No, that format will use a different block than the one for the
table. You will need to make additional region(s) for the provided
formats.</p>
</li>
</ol></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-27T13:45:54Z2010-12-27T13:45:54Zrecurring events<div><p>Penny,<br></p>
<h1>1 is working, it as the path.</h1>
<ol>
<li>I created an additional region and applied the current-page
block and attached the format from above. I'm not getting any
errors, but I'm also no seeing any content. Not sure what I need to
do different to get it to display correctly.</li>
</ol></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-27T14:50:08Z2010-12-27T14:50:08Zrecurring events<div><p>Hey Lauren,</p>
<p>The block that you will need to use for the second script will
be an Index Block of the folder containing the calendar years. It
will need to be set to a depth of two levels.</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-28T16:44:01Z2010-12-28T16:44:01Zrecurring events<div><p>Penny, That fixed it. Thanks for the quick reply.</p>
<p>If I wanted to add drop down/jump menus, could I just add that
code into the existing format?</p></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712010-12-29T16:17:16Z2010-12-29T16:17:16Zrecurring events<div><p>Hey Lauren,</p>
<p>You could use the same block and format as the second format
(the one that indexes your calendar folder).</p>
<p>I would just be careful to make sure that there is no conflict
with variables being used.<br></p>
<p>The way I would approach this would be to write the html and
possible javascript for the dropdown/menu that would work without
using Cascade blocks or formats. You could then take that 2nd
format and write the script necessary to generate the items in the
dropdown in the html that you would have created previous.</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/40859712011-01-03T19:37:32Z2011-01-03T19:37:32Zrecurring events<div><p>Penny,<br>
Thanks for the direction, it worked for me.</p>
<p>Another request came up from our ed services department.<br>
They would like to display the next 3 dates for a particular class.
I know that I can set the current date.</p>
<p>Would there be a way to use the current date to "filter" the
dates for each class and use a count to display the next three
classes?</p></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/40859712011-01-06T20:47:03Z2011-01-06T20:47:03Zrecurring events<div><p>Hey Lauren,</p>
<p>Are you talking about on the actual Event? If so, this can be
done but the logic for it isn't the simplest b/c you're going to
need to make some logic to check if the current date has passed the
event end date. Then you're going to need to check to make sure
that you only output up until the end date and not past it, meaning
you may only be able to output 2 even if you set it for outputting
3.</p>
<p>The Daily ones will be much easier than the Weekly ones as
well.</p>
<p>If you are talking about only outputting events that are entered
for specific dates (so not recurring), this would also be easier,
you can set an if in the for loop with that limit.</p>
<p>I hope this helps.</p></div>Penny