Hey there, I love the simple core profile / activity integration, and I was wondering if it would be possible to have a way to insert a simple empty text when there is no activity to display for a user, on it's profile??

Either that, or maybe hide the Activity section if there is no activity to show yet, this would be great, but the empty text would be better cause we could then pass a message to the user to ask him to start actually doing stuff on the site, etc.

Thanks a lot,
Patchak

Comments

sirkitree’s picture

Sure, just edit the default view and insert whatever you like in the 'Empty text'.
Only local images are allowed.

Please mark the issue as fixed if this satisfies your request.

patchak’s picture

Hey there, I think we misunderstood each other, I'm really talking about that view that is created from within the module and that displays the latest activity for a user on it's profile page! Not sure at all this would be handled by views, cause I noticed in the code there is a section to add this info to the user's profile page!!

Thanks,
Patchak

jaydub’s picture

The current release of Activity 6.1 doesn't include Views support although there experimental Views support for the 6.1 branch has been added and is available in the snapshot.

For your particular question, there is a fairly easy way to add what you want as long as you know how to work with Drupal theming and the theme override functions.

The theme function that displays the Activity for a user on their profile page is theme_activity_user_profile_activity().

/**
 * Theme function for displaying an activity block on a user profile.
 */
function theme_activity_user_profile_activity($activities) {
  if ($content = theme('item_list', $activities, NULL, 'ul', array('class' => 'activity-list'))) {
    return $content;
  }
}

If you wanted to add in text if there are no activities for the user you could do something like:

  if (!$activities) {
    return t('This user has no activity yet');
  }
  elseif ($content = theme('item_list', $activities, NULL, 'ul', array('class' => 'activity-list'))) {
    return $content;
  }
sirkitree’s picture

Status: Active » Closed (won't fix)

closing. 1.x no longer supported.