Hey there,

let me first thank you for the great module and work !! It's really fun using it :)

Now my issue: I am trying to apply custom css classes to events on the timeline based on the data in the row of the view result for the given event.

Grouping is not a solution for me because I am trying to apply multiple classes for one event.

The hook timeline_data_alter hook doesn't work for me, because the actual row data is not there anymore (just the rendered result). I guess I could use that, "hide" the information in there and with some parsing extract and remove it from the 'description' field but that just doesn't really feel good.

Maybe I am also missing something here?

If not, my proposal would be to introduce another alter hook (e.g. timeline_event_alter) and pass the event raw row data to allow modules make changes based on it. This way I can hide the field in views but still access the data in my module / theme. I attached a simple and hopefully correct patch with that solution. I am not sure if this the correct or even best way to accomplish this but for me it would work perferctly.

Any comments and / or help on that are very apreciated!

Thanks in advance! Cheers,

cossme

CommentFileSizeAuthor
#1 timeline_hook_event_data_alter.patch725 bytescossme
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cossme’s picture

and here is the patch ;-)

xamanu’s picture

Title: Alter event css class based on sql row data » Alter hook for raw data
Version: 6.x-2.1 » 7.x-3.x-dev
Status: Active » Needs review

Generally I think it is a good idea. But I'd have to have a better look on it. Anyway this would go into the 3.x version.