Hi,

Heartbeat provides default file styles, but their use is hard-coded. I would like to set custom styles myself.
Of course I could override the theme functions, which works fine for theme_heartbeat_comment(). But it doesn't work for heartbeat_heartbeat_activity_view() (which is a hook, not a theme function).

Comments

Stalski’s picture

Jup It's meant to happen through theme function as the defaults should be good in the majority of the cases (and I chose to have as much ready-to-use-on-install as possible).
Your point on "heartbeat_heartbeat_activity_view" is correct. The thing there is that they are not fields, but extra fields.

I am now looking on how I could use the formatters (and thus theme functions) on the fields and display overview pages, as it should be.

Stalski’s picture

As extra fields can not have formatters, I did choose for a separate image style (for activity AND for comments) so you guys would have a bit of flexibility.
Can you explain me why this does not fit your needs? It seems to me the worst thing that happens is duplicate image styles (meaning two imagestyles doing the same thing)

Stalski’s picture

Status: Active » Fixed

I wrapped the problem in a theme function called "theme_heartbeat_activity_avatar" where you have the heartbeatActivity object and the uri in the variables.

Anonymous’s picture

Thanks, this really great.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Status: Closed (fixed) » Active

I noticed the style is also hardcoded in

function heartbeat_plugins_modal_flagging_users($js = NULL, $heartbeatActivity) {

Where you can change

$list[] = l(theme('image_style', array('style_name' => 'activity_avatar', 'path' => $account->uri, 'attributes' => array('class' => 'avatar'))), 'user/' . $account->uid, array('html' => TRUE));

to

$list[] = l(theme('heartbeat_activity_avatar', array('heartbeatactivity' => $heartbeatActivity, 'uri' => $account->uri)), 'user/' . $account->uid, array('html' => TRUE));
Anonymous’s picture

I also suggest to move the entire heartbeat_heartbeat_activity_view() into a theme function, so you can change all the individual parts, not just the avatar image.

And instead of default image style, we could have an admin options under heartbeat settings: choose image styles.

Stalski’s picture

Status: Active » Fixed

That function entirely is not possible as it is the function that creates the built of elements. I did check that function and refactored heartbeat so the theme('time_ago' function is now the one that's being called, so we can take on that one as well.).
So everything is separately delegated to theme functions.

- EDIT - the fix from previous comment is implemented as well. Thx.

Pushed to git.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.