Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Can group avatar size be changed? (11 posts)

Started 2 years, 9 months ago by: wpmubp.org

  • Profile picture of wpmubp.org wpmubp.org said 2 years, 9 months ago:

    Do we also have functions to cutomize group avatar output size?
    <?php bp_group_avatar() ?>

    I’ve found the function to customize user avatars, but can’t find for the group avatar.

  • Profile picture of Paul Gibbs Paul Gibbs said 2 years, 9 months ago:

    No way of doing this via code. It probably ought to go on Trac as an enhancement suggestion.
    In the interim you can probably use CSS to “resize” the image after the page’s loaded, though, not knowing exactly what/where you want the image to appear different, I’m reluctant to suggest the CSS.

  • Profile picture of byandreas byandreas said 1 year, 12 months ago:

    did you figure this out?

  • Profile picture of rich! @ etiviti rich! @ etiviti said 1 year, 12 months ago:

    bp_group_avatar accepts the following args

    $defaults = array(
    ‘type’ => ‘full’,
    ‘width’ => false,
    ‘height’ => false,
    ‘class’ => ‘avatar’,
    ‘id’ => false,
    ‘alt’ => __( ‘Group avatar’, ‘buddypress’ )
    );

  • Profile picture of byandreas byandreas said 1 year, 12 months ago:

    Sorry, but… Could you explain that so a newbie could get it too? :) Where, What and How are questions that often pop into my head reading the forums…

  • Profile picture of nathan12343 nathan12343 said 1 year, 7 months ago:

    I’m not sure why this still isn’t possible – in the default theme the image seems to be hard coded to read 150×150 but there is plenty of space all around it. It would be great if anyone could tell me where I could change the dimensions. Stretching the image through css would probably look bad.

    Thanks

  • Profile picture of modemlooper modemlooper said 1 year, 7 months ago:

    bp_group_avatar(‘type=full&width=75&height=75′)

    Change height and width.

  • Profile picture of still giving still giving said 1 year, 5 months ago:

    Hi. Which page are you guys actually doing this editing … groups/single/group-header.php?

    It would be better to have a separate long thin image rather than a square creating lots of white space around it.

    I tried changing it but it makes no difference. Removing the section at least removed the avatar.

    How does one change the size of, or even remove, the group avatar image?

    There is too much wasted space causing too much unnecessary scrolling down for users in default styles.

  • Profile picture of Virtuali Virtuali said 1 year, 5 months ago:

    @modemlooper, I do not think that CSS is defined in any of the CSS stylesheets.

    To edit avatar size, unfortunately, it will edit the size of avatars on all headers on your site with the avatar (members)

    go into your buddypress default.css and you will be able to edit it from there.

  • Profile picture of simon simon said 5 months, 1 week ago:

    I’m coming across the same barrier… Pulling the group image at different sizes is fine, however when you try and modify the group avatar size from the group admin perspective, it get’s a bit tricky. Try and upload and small icon for a group and you will notice it puts the little logo on a black background and resizes it akwardly.

    Looking for something to hook onto to modify this setting and I can’t see anything pertaining to size in the BP template set

    <?php if ( bp_is_group_admin_screen( 'group-avatar' ) ) : ?>
    
    	<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
    
    			<p><?php _e("Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'buddypress') ?></p>
    
    			<p>
    				<input type="file" name="file" id="file" />
    				<input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
    				<input type="hidden" name="action" id="action" value="bp_avatar_upload" />
    			</p>
    
    			<?php if ( bp_get_group_has_avatar() ) : ?>
    
    				<p><?php _e( "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ) ?></p>
    
    				<?php bp_button( array( 'id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __( 'Delete Avatar', 'buddypress' ), 'link_text' => __( 'Delete Avatar', 'buddypress' ) ) ); ?>
    
    			<?php endif; ?>
    
    			<?php wp_nonce_field( 'bp_avatar_upload' ) ?>
    
    	<?php endif; ?>
    
    	<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
    
    		<h3><?php _e( 'Crop Avatar', 'buddypress' ) ?></h3>
    
    		<img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
    
    		<div id="avatar-crop-pane">
    			<img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
    		</div>
    
    		<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
    
    		<input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
    		<input type="hidden" id="x" name="x" />
    		<input type="hidden" id="y" name="y" />
    		<input type="hidden" id="w" name="w" />
    		<input type="hidden" id="h" name="h" />
    
    		<?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
    
    	<?php endif; ?>
    
    <?php endif; ?>

    Any thoughts on how to modify size, right from the upload process?

  • Profile picture of simon simon said 5 months, 1 week ago:

    how bout these little dudes?… no idea what they do

    <input type="hidden" id="w" name="w" />
    <input type="hidden" id="h" name="h" />

    Really you could just resize the original thumbnails to 100px X 100px and allow BP to resize them, however you don’t also get the crispness you need when designing nice little icons.