Events Made Easy Forums How do I … Define CLASS

Tagged: , , ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #42205
    Anonymous
    Inactive

    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!

    #45257
    Franky
    Keymaster

    Don’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.

    #45258
    Franky
    Keymaster

    I committed my suggested code to the trunk, so you might want to try out my second suggestion (it will be in the next release)

    #45259
    Anonymous
    Inactive

    Thanks 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

    #45260
    Franky
    Keymaster

    So 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.

    #45261
    Anonymous
    Inactive

    I 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!

    #45262
    Franky
    Keymaster

    For 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.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top