Events Made Easy › Forums › How do I … › Define CLASS
- This topic has 6 replies, 2 voices, and was last updated 14 years ago by Franky.
-
AuthorPosts
-
Wed 3 Nov 2010 at 20:42 #42205AnonymousInactive
I need to give color to each particular event.
For this it occurs to me give a different style to each table, calling the “class =” a category for the event, so I did this:
eme_calendar.php (Line 396)
$calendar=str_replace("<td class='eventless'>".$cell['day']."</td>","<td class='".$event['event_category_ids']." eventful'>".$cell['cell']."</td>",$calendar);
I returned:
<td class="3 eventful">...</td>
But when I have more than one event, I only get the id of the first event.
Any suggestions?
Thanks!
Wed 3 Nov 2010 at 20:53 #45257FrankyKeymasterDon’t use the event category for unique class css-keys, use eg. $cell:
$calendar=str_replace("<td class='eventless'>".$cell['day']."</td>","<td class='".$cell['day']." eventful'>".$cell['cell']."</td>",$calendar);
or better:
$calendar=str_replace("<td class='eventless'>".$cell['day']."</td>","<td class='eventful event-day-".$cell['day']."'>".$cell['cell']."</td>",$calendar);
That will give you class “eventful event-day-” followed by the number of the day. Maybe interesting to add in general … it won’t affect other things and so allows again more CSS freedom.
$event is not initialized again in that loop, so it won’t work.
Wed 3 Nov 2010 at 21:00 #45258FrankyKeymasterI committed my suggested code to the trunk, so you might want to try out my second suggestion (it will be in the next release)
Wed 3 Nov 2010 at 21:28 #45259AnonymousInactiveThanks for responding so soon!
This code is much better, but if events change daily, according to the month, would have to my.css changed through the color of the day ….
Successful way to list the categories in class?
I’m trying to use as tags, this I can differentiate colors manrea categories …
Thanks again
Wed 3 Nov 2010 at 21:54 #45260FrankyKeymasterSo what color would be used if you had 2 events from different categories on the same day?
The day is not dependant on the events in that day, and you only have a max. of 31 days in a month, so once you define if for 31 days, you’re done.
Wed 3 Nov 2010 at 22:22 #45261AnonymousInactiveI understand, I will use it this way ….
I also wanted to ask about event_notes, he understood that I have are the details that add to an event. Not shown on the website of the event.
For example, in “xx/?event_id=4” I see the booking form, title, town, time … but does not show the details …
As I can show them?
Thank you!
Wed 3 Nov 2010 at 22:46 #45262FrankyKeymasterFor this I would refer to read the doc, in your case you’ll need to change the setting “Default single event format” to include the #_NOTES placeholder, so it shows the event details.
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.