| View previous topic :: View next topic |
| Author |
Message |
HexAngel
Joined: 22 Feb 2006 Posts: 90
|
Posted: Sun Mar 05, 2006 2:37 am Post subject: Primary Category when multiple categories selected |
|
|
Hi all,
Currently, when the calendar is set to display event colours by category, and multiple categories are selected for an event, then the event is displayed with the default event colours defined for the current theme.
A mouthful.
Perhaps this is slated for 1.3, but the conflict could be alleviated if one of the multiple categories could be identified as "primary" and the colour for this category used in the display.
btw: is there a date planned for releasing 1.3?
Cheers,
p. |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Sun Mar 05, 2006 5:54 am Post subject: |
|
|
Hi HexAngel,
1.3 will display all the icons configured for each category it is in but I'm not sure that I want to do the primary category thing. I was thinking that one could configure colors for events that have multiple categories. What do you think? The constraint on 1.x is that I do not want to add any more database fields. Primary category would require another field. This would complicate the installation and we'd have to deal with upgrade sql scripts.. blah blah blah...
I'd give 1.3 another 4 weeks or so. |
|
| Back to top |
|
 |
HexAngel
Joined: 22 Feb 2006 Posts: 90
|
Posted: Sun Mar 05, 2006 4:10 pm Post subject: |
|
|
Hey Ian,
That would work, essentially performing the same function. It would work best if Thyme provided the colour schemes of the selected categories to choose from. I take it that events already have display colour fields?
p. |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Sun Mar 05, 2006 7:40 pm Post subject: |
|
|
| Events do not have display color fields. They get all their color info either from the theme or category (or owner, or calendar) etc.. |
|
| Back to top |
|
 |
HexAngel
Joined: 22 Feb 2006 Posts: 90
|
Posted: Sun Mar 05, 2006 8:03 pm Post subject: |
|
|
Ah, I misunderstood.
You mean that events with multiple categories would all have the same colour, correct?
For my purposes, not so good -- and I imagine for some others as well.
As you know, I'm integrating Thyme with a CafePress.com application and using it to display t-shirts, buttons, stickers, etc., appropriate for particular events. For displaying events I'll use icons to denote availability of buttons, stickers, etc., and hoped to allow colour to display the event category (eg: birthdays, historical events, holidays...)
I can see that this implementation will be somewhat unusual. Perhaps a hack?
p. _________________ Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs; |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Sun Mar 05, 2006 8:09 pm Post subject: |
|
|
Right, that's what I meant. They would all have the same color.
For 1.x, if you want "primary category", it would have to be a hack. I could tell you what to add where to make this happen if you'd like. |
|
| Back to top |
|
 |
HexAngel
Joined: 22 Feb 2006 Posts: 90
|
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Wed Mar 08, 2006 3:18 am Post subject: |
|
|
Ok, add a bigint unsigned field (the same type as etype) to Thyme's events table called pcat.
In include/templates/event_edit_tpl.php add
| Code: |
| $_cal_tmpl->section_row("Primary category:", $_cal_form->select('pcat', $_cal_etypes)); |
This will allow people to select a primary category.
In include/classes/class.event_minimal.php, find:
| Code: |
$this->type_css_class = "cal_event_type_". $this->type ."_". $this->calendar;
|
Change that to:
| Code: |
$this->type_css_class = "cal_event_type_". ($this->pcat ? $this->pcat : $this->type) ."_". $this->calendar;
|
Let me know which encoded version of Thyme you are using and I'll have to send you the file that will get pcat into event_minimal.
Don't hesitate to ask if you have any questions. |
|
| Back to top |
|
 |
HexAngel
Joined: 22 Feb 2006 Posts: 90
|
Posted: Sat Mar 11, 2006 6:22 am Post subject: |
|
|
Took me a while to get to it, but I've implemented the changes you suggested.
Added pcat to db.
Added code to event_edit_tpl.php
Thyme now successfully records and saves a primary category.
event_minimal is encoded so didn't touch it.
Instead, I uploaded the copy of class.event_matrix.php that you sent me in email.
Thyme does not display the colour of the event's primary category. It still displays the default category colors.
see: http://www.tshirtcalendar.com/index.php and look for Karl Marx dies, on March 14 for an example. I've set 'Anarchist' as the primary category.
Thanks,
Patrick. _________________ Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs; |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
|
| Back to top |
|
 |
HexAngel
Joined: 22 Feb 2006 Posts: 90
|
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Tue Mar 14, 2006 2:02 pm Post subject: |
|
|
Looks good Hex. One thing you may want to do is this:
$_cal_tmpl->section_row("","T-Shirts, Stickers, Buttons, Magnets, Posters, Coffee Mugs and More:");
$_cal_tmpl->section_row("", $content);
Rather than putting it all on the same row. Just a thought. |
|
| Back to top |
|
 |
HexAngel
Joined: 22 Feb 2006 Posts: 90
|
Posted: Tue Mar 14, 2006 3:01 pm Post subject: |
|
|
Thanks. I've been considering that. Kinda of two minds on the issue. Does it bother you much?
On 1024X768 the caption works out fairly well as is: each category on its own line. It becomes a list rather than a sentence and perhaps not the most readable. Much smaller than 1024, though, and it gets somewhat scrunched and decidedly less readable.
Running the caption horizontally across the top does improve readability. On the other hand, it breaks the format for the page and I'm not so keen on the way it looks visually for that reason. After a user reads it the caption a couple times it becomes a design element (and search engine tag) and less an informative caption
Also, I'm planning on placing a header at the top of the section, with more text, Just waiting for the right inspiration. I think a horizontal caption will visually conflict.
Cheers,
p. _________________ Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs; |
|
| Back to top |
|
 |
HexAngel
Joined: 22 Feb 2006 Posts: 90
|
Posted: Tue Mar 14, 2006 3:14 pm Post subject: |
|
|
Oh, one thing to watch out for if/when you implement this in 2.x
When initially editing an event the primary category defaults to the first category in the drop-list. If you save it that way, then the event is thenceforth displayed with that primary category's colour. However, listing events in that primary category will, of course, fail to list the event.
I think that's a clear explanation... Anyway, a small issue of inconvenience and an occasional "Whoops!".
Perhaps there's an easy way to initialise the list so that the default is NULL?
p. _________________ Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs; |
|
| Back to top |
|
 |
HexAngel
Joined: 22 Feb 2006 Posts: 90
|
|
| Back to top |
|
 |
|