Event Calendar - weekly view

81 posts by 2 authors in: Forums > CMS Builder
Last Post: Thursday at 1:15am   (RSS)

Instead of a 'color' field can I have a category dropdown, so the user selects a category for the event then I can set a style for each category. I can't get this to work as a class in the functions document.

By Djulia - October 30 - edited: October 30

It's an excellent suggestion.

I have made changes to both files. You need to add an additional list field named "category."

<label for="category">Category:</label>
<select id="category" name="category">
  <option value="meeting">Meeting</option>
  <option value="holiday">Holiday</option>
  <option value="workshop">Workshop</option>
  <option value="conference">Conference</option>
</select>

The value should correspond to a CSS class.

/* Category Styles */
.event.meeting { background-color: #3498db; color: #fff; }
.event.holiday { background-color: #2ecc71; color: #000; }
.event.workshop { background-color: #e74c3c; color: #fff; }
.event.conference { background-color: #f1c40f; color: #000; }

You can find an example of a rule in the view file.

Please note that you may need to update the CSS, as it has changed significantly since the first file.

Thanks, Djulia

Attachments:

calendar.zip 11K

You're a star. Thank you

Thanks! You can remove all the JavaScript (cf.applyTextColor()).

By Djulia - October 31 - edited: October 31

Hi MercerDesign,

Could you try this version? It adds Ajax navigation.

Thanks again,
Djulia

Attachments:

calendar.zip 12K

Thank you. I've tried that but it didn't work on the site, I've reverted to the previous version which is working really nicely.

Hi, I need some events to just be 10 minutes long but when I change the end time the event disappears, can you help please?

By Djulia - November 12 - edited: November 12

Hi MercerDesign,

I updated the renderWeekView function in calendar_functions.php. Could you try testing this new version?

Thanks,
Djulia

Attachments:

calendar.zip 12K

By MercerDesign - November 12 - edited: November 12

The calendar just doesn't work now: https://rodneys46.sg-host.com/calendar/

I've reverted to the working version, but not using the updated AJAX navigation as that didn't work for me.