Technology Tools for Ministry

Community

Web-Empowered Church User Community
Total Posts: 17 - Pages (2): [1] 2
Author: Adam Craig
Posted: Jan 29 2008 - 06:54 AM
Subject: Upcoming Events
I have installed the Calendar Base extension on my site and I am really impressed by its features. I am thinking of deploying this in place of the WEC Default extCalendar extension. However, my site concept requires that I have a sidebar display of upcoming events from the calendar on various pages of the site. ExtCalendar, though it is not free from flaws, seems to have the potential to do this quite impressively.

I have not seen how to accomplish this with Calendar Base, and was wondering if you might lend some enlightenment.

Thanks!
- Adam
Author: Jeff Segars
Posted: Jan 29 2008 - 11:22 PM
Subject: re: Upcoming Events
Adam,
When you place the Calendar Base plugin on a page, you define the different views that are allowed on that page (day, month, year, etc) and first item in the list of allowed view is the the one that will be displayed by default when a page is loaded. To get a list of upcoming events, you can just create a Calendar Base plugin where the list view is the only allowed view on that page. Within the list view tab, you can then configure how many events should show up and how far in advance events should be shown.

I think that should take care of what you're looking for, but let me know if you have more questions.

Thanks,
Jeff
Author: Adam Craig
Posted: Feb 04 2008 - 06:46 AM
Subject: re: Upcoming Events
Hey Jeff,

Thanks for the help! I have set the options you recommended for the http://chum.brooks-craig.com/news-and-events/ page. The right sidebar where I added the plugin shows the following error message: "calendar: no list template file found:" I imagine this is due to the fact that an html template file needs to be built and linked into the extension somehow. Any suggestions for where to begin?

Thanks again!
- Adam
Author: Adam Craig
Posted: Feb 04 2008 - 07:44 AM
Subject: re: Upcoming Events
Jeff,

I have successfully eliminated the error message! Previously, I only had a cal extension template on the Calendar page itself. I deleted the ext template there and applied it to the site's root page, and wala!, the upcoming events displayed in the column. Now, to tweak the tmpl file!

I'll let you know if I run into another wall.

Thanks!
- Adam
Author: Adam Craig
Posted: Feb 04 2008 - 09:05 AM
Subject: re: Upcoming Events
Jeff,

Sure didn't take me long to run into another wall! lol

Here is the present predicament:

I specified in the Constant Editor the location of a new list template file for both the list_w_teaser.tmpl and the list.tmpl, and renamed the original files in the typo3conf directory to ensure that the new template file was being used. I made a few modifications, which were reflected properly, until I got to modifying the actual list properties in the template file (ie. properties within the <!-- ###LIST### start --> and <!-- ###LIST### end --> tags). For instance, I attempted to remove the css class="even" for the even events in order to remove the gray background. After saving the modifications and clearing both Typo3 caches and my browser cache and refreshing the News & Events page, the modification was not reflected.

My list template file presently reads as follows, and the page of interest is http://chum.brooks-craig.com/news-and-events/

CODE:
<!--list.tmpl-->

<!-- ###LIST_TEMPLATE### begin -->

<!-- ###POST_LIST_TEMPLATE### begin -->
<!-- ###POST_LIST_TEMPLATE### end -->

<dl>
   <!-- ###LIST### start -->
   <!-- ###LIST_ODD### start -->
   <dt>
      ###IMAGE###
      <!-- ###EVENT_LINK### start-->###TITLE###<!-- ###EVENT_LINK### end--><br />
      ###STARTDATE### ###ENDDATE### <span class="V9G">###STARTTIME### ###ENDTIME###</span><br />
      <br /><span class="V9G">###CATEGORY_LINK###</span>
   </dt>
   <dd></dd>
   <!-- ###LIST_ODD### end -->
   <!-- ###LIST_EVEN### start -->
   <dt>
      ###IMAGE###
      <!-- ###EVENT_LINK### start-->###TITLE###<!-- ###EVENT_LINK### end--><br />
      ###STARTDATE### ###ENDDATE### <span class="V9G">###STARTTIME### ###ENDTIME###</span><br />
      <br /><span class="V9G">###CATEGORY_LINK###</span>
   </dt>
   <dd></dd>
   <!-- ###LIST_EVEN### end -->
   <!-- ###LIST### end -->
</dl>

###CREATE_EVENT_LINK###
<!-- ###LIST_TEMPLATE### end -->
<!--/list.tmpl-->


Thanks,
- Adam
Author: Jeff Segars
Posted: Feb 05 2008 - 01:02 AM
Subject: re: Upcoming Events
Adam,
Sorry about this, but I think you stumbled on some cruft left around from previous versions. list.tmpl still defines the overall wrapper around the event, but the details of individual events (list_odd and list_even) are defined in phpicalendar_event.tmpl.

Calendar Base has the ability to display news articles, sermons, and lots of different data as events on the calendar so this separation lets you define different styling for each event type. We'll get this old template HTML removed in the next version to prevent any confusion.

Thanks,
Jeff
Author: Adam Craig
Posted: Feb 05 2008 - 09:47 AM
Subject: re: Upcoming Events
Hey Jeff!

Thanks for the response. I need to finish up some college coursework here for the next few hours, but I should have some time this afternoon/evening to give this a shot. I'll let you know how it turns out.

Thanks again!
- Adam
Author: Adam Craig
Posted: Feb 06 2008 - 08:16 AM
Subject: re: Upcoming Events
Folks,

Wouldn't you know it, I have another question.

First off, a special thanks to Jeff for pointing me to the right .tmpl file. I have managed to customise the list view to work for what I need for the Upcoming Events sidebar item.

My new question is about date/time formatting.

Presently, with the code below, the date is rendered as follows:
[startdate] - [enddate] [starttime] - [endtime]
CODE:
###STARTDATE### ###ENDDATE### ###STARTTIME### ###ENDTIME###


...and [enddate], with its proceeding "-" does not display if it is the same value as [startdate].

This is what I would like to see:
[startdate (format: %b %d)] [starttime] - [enddate (format: %b %d)] [endtime]
(ex. Feb 06 12:00 pm - Feb 07 12:01 pm)
...and have the [enddate] not display if it is the same as [startdate], and the "-" show regardless.

Can this be done within the phpicalendar_event.tmpl file, or do I need to go somewhere else?

Also, something curious that I noticed, which leads to another question:
The Upcoming Events sidebar item that I have defined requires that the FE Cache be cleared to update (it is not removing past events or showing added events if the FE Cache is not cleared). This can be seen on the page http://chum.brooks-craig.com/news-and-events/ where the "Test Event" still shows, even though it should have been removed from the list 16 minutes ago, by my watch. Any suggestions?

Thanks,
- Adam
Author: Jeff Segars
Posted: Feb 06 2008 - 11:17 AM
Subject: re: Upcoming Events
This is what I would like to see:
[startdate (format: %b %d)] [starttime] - [enddate (format: %b %d)] [endtime]
(ex. Feb 06 12:00 pm - Feb 07 12:01 pm)
...and have the [enddate] not display if it is the same as [startdate], and the "-" show regardless.

Can this be done within the phpicalendar_event.tmpl file, or do I need to go somewhere else?

This is actually controlled through Typoscript.
CODE:
plugin.tx_cal_controller.view.list.event.enddate.noTrimWrap >
plugin.tx_cal_controller.view.list.event.startdate.noTrimWrap = || - |


The first line removes the dash from the end date. The second line adds the dash after the content of the of the startdate. The format looks funny but this should explain it a little better. noTrimWrap = | value before the start date | value after the start date |. The middle pipe symbol is where the start date actually gets substituted, so we just stick a dash after that.

The Upcoming Events sidebar item that I have defined requires that the FE Cache be cleared to update (it is not removing past events or showing added events if the FE Cache is not cleared). This can be seen on the page http://chum.brooks-craig.com/news-and-events/ where the "Test Event" still shows, even though it should have been removed from the list 16 minutes ago, by my watch. Any suggestions?


The frontend cache in TYPO3 doesn't have any intelligence built into it and isn't aware of what its displaying. This means that any settings for how often the cache should be cleared come in at a level higher than the Calendar Base extension. If you take a look at Page Properties, you'll see a field for "Cache Expires". This allows you to define on a per-page basis how long a cached page should stick around for. You'll get more accuracy on your calendar events as you decrease it, but of course there's a performance hit too.

Another feature worth pointing out is the ability to automatically clear the cache when event records are created. If you take a look at the TSconfig field within the Page Properties of the Storage Folder, you'll see the following Typoscript.

CODE:
TCEMAIN.clearCacheCmd = 76,34,40,70,37,53,54,55,56,65,66,67,68,69


This tells TYPO3 to automatically clear the cache for a bunch of page IDs when anything is saved inside the storage folder. This means that the cache for the news page is cleared when a news article is created and stuff like that.

Hope that helps!
jeff
Author: Adam Craig
Posted: Feb 06 2008 - 03:45 PM
Subject: re: Upcoming Events
Hi Jeff,

I persuaded it to work with the following:
CODE:
# Calendar Base List Format Modification
plugin.tx_cal_controller.view.list.event.enddate.noTrimWrap >
plugin.tx_cal_controller.view.list.event.endtime.noTrimWrap >
plugin.tx_cal_controller.view.list.event.starttime.noTrimWrap = || - |


Thanks also to your suggestions, I was able to work out the caching issue.

Thanks,
- Adam
Total Posts: 17 - Pages (2): [1] 2
You must login to post a message to this conference.