Log in | Register | Lost password

Bottom
pgcalendar with colour by category
  • Posted: 04.02.2006, 09:05
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    I'm playing around with pgcalendar in hopes that I can replace PostCalendar. Since my calendar has quite a few events, I like to colour code events by category. This should be a simple task to create a Category list and populate it with the event categories that I want with the hex colour code as the value of the category item.

    For the life of me though, I can't get it to show up in the calendar. I'm keeping it simple and just trying to display the category title, or id, or value and nothing is displayed at all.

    Do the pgcalendar templates work differently?
  • Posted: 05.02.2006, 00:44
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0

    Quote

    Since my calendar has quite a few events, I like to colour code events by category. This should be a simple task to create a Category list and populate it with the event categories that I want with the hex colour code as the value of the category item.

    That's a great idea, indeed. And you are correct - it is a simple task. I just did it and it works like a charm.

    How do you reference the category value (color code) in your template?

    TIP: Insert a pndebug statement at the end of your template in order to see the events passed to you by pgcalendar.

    Code

    <!--[pndebug]-->
  • Posted: 06.02.2006, 20:31
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Knowing that it actually works was a great help, thanks.

    I was using $eventcat.value
    "eventcat" was the publication variable that I assigned my category list to.

    I *should* have been using $event.eventcat.value

    Now all we need is recurring event support, like the third wednesday of every month. :)



    edited by: dks, Feb 06, 2006 - 09:32 PM
  • Posted: 07.02.2006, 15:02
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    In pgcalendar every variable from the article in question needs and $event. in front of it: $event.date, $event.field

    Took me about a week to figure this out...

Template courtesy of Designs By Darren.