Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5173 closed enhancement (fixed)

Allowing plugin to style group rows in directory & widget loops and in admin ui

Reported by: imath's profile imath Owned by: boonebgorges's profile boonebgorges
Milestone: 1.9 Priority: normal
Severity: normal Version: 1.8.1
Component: Groups Keywords: has-patch 2nd-opinion
Cc: math.viet@…

Description

Hi,

This request is relative to #2242 . I've built a plugin to stick groups in the groups directory. So far i'm filtering the bp_get_group_name tag to style the sticky groups. But that's definitely a very bad idea i had. The reason is that bp_get_group_name is used in select box options, in group edit field, and in link titles (i think another non filterable function should be used for these cases, i'll post a suggestion in a next ticket).

So to avoid breaking the html, i've temporarly encapsulated the filters between the 'bp_before_groups_loop' and 'bp_after_groups_loop', but as soon as a theme will for example use title="<?php bp_group_name();?>" in the link tag, that will break the html :( and will populate the support of the bp-sticky-groups plugin ;)

I've noticed that since 1.7, there was an interesting template tag : bp_group_class(). But it isn't use by default in bp-legacy or bp-default groups-loop.php templates. I imagine this tag is there to help theme designers to include it in their templates. Well, in the case of bp-sticky-groups, if this tag was used by "default", it would help me a lot !!

So, in the attached diff, i'm suggesting to use it and i also suggest to allow plugins to filter group admin ui row class as it will help in my case to also style the sticky groups in the admin listing.

Attachments (1)

5173.diff (2.8 KB) - added by imath 11 years ago.

Download all attachments as: .zip

Change History (7)

@imath
11 years ago

#1 @imath
11 years ago

  • Cc math.viet@… added

#2 @imath
11 years ago

  • Keywords has-patch 2nd-opinion added

#3 @boonebgorges
11 years ago

  • Milestone changed from Awaiting Review to 1.9

Looks good to me. Thanks, imath.

#4 @boonebgorges
11 years ago

In 7378:

Wrap row classes in a filter on the group admin screen

See #5173

Props imath

#5 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7379:

Use row classes in group templates

bp_group_class() provides valuable CSS classes for use in groups loops
(such as 'odd' and 'even'), and also provides a way for plugins to
style rows in various ways using the included filters.

Fixes #5173

Props imath

#6 @imath
11 years ago

Great !! Thanks a lot Boone, i'll upgrade the plugin as soon as 1.9 will be released to take benefit of these evolutions, it will be much cleaner than the method i'm using today ;)

Note: See TracTickets for help on using tickets.