#6384 closed enhancement (fixed)
Create Members Loop markup class function
Reported by: | hnla | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | minor | Version: | |
Component: | Members | Keywords: | needs-patch |
Cc: |
Description
Currently BP has a bp_get_group_class()
function located in 'bp-groups-template.php' the purpose of which is to render class tokens to the groups loop 'li' element.
The members loop however does not have a similar function.
With the introduction of member_types this would be more of a relevant issue and useful, even without member types we ought to match major components and functions like for like? If groups template provides this for groups loop members template should also as should 'Blogs' for their respective loops.
I have a need to be able target 'me' for the companion styling I'm tackling so the first 'class' I would be adding (and likely only one short term) is a logged in user, displayed user check.
It looks to me that we could relatively simply copy over majority of the bp_get_group_class() to members-template and tweak to suit?
I would be willing to make an initial clumsy first pass at this in order that we could get it underway & squeezed into 2.3?
Attachments (2)
Change History (17)
#2
@
9 years ago
Darn it, maybe I do :( will check it out and why we aren't employing it on main loop as we do on groups loop.
#3
@
9 years ago
Soo.. lets re-phrase this ticket to:
'Lets actually use this bp_member_class()
And perhaps add a class to mark the current users list entry.
#4
@
9 years ago
Patch 6384.01 updates members-loop.php & bp-members-template.php
- Bring
bp_member_class()
into use on members loop 'li' elements - Update
bp_get_member_class()
for a comparison check between logged in user and member list entry to add a class 'my-entry' on matches.
We gain the use of the class 'is-online' which existed and marks each entry if user logged in and active and we have the addition of being able to identify the current users entry and style accordingly
Moving forward I would expect we'll need the class for 'member_type' classes as well.
This ticket was mentioned in Slack in #buddypress by hnla. View the logs.
9 years ago
#7
@
9 years ago
I'm okay with this patch, hnla.
Not a fan of the 'my-entry'
class name though. Perhaps 'is-me'
to match 'is-online'
?
#8
@
9 years ago
@r-a-y yes agree on the naming didn't like it either but hate choosing names :)
my only problem with 'is-me' is that it can tend to sound / read as a question whereas we are really stating a fact, this li entry is me; but I'm fine with whatever is thought best.
Only other concern I had was whether there was some reason this hadn't been included before.
#10
@
9 years ago
@r-a-y and I did throw some names back and forth on slack, can't see those entries though.
think the choice boils down to 'bp-is-me' or 'is-me'. In user accounts we use 'just-me', 'my-groups' so 'is-me' seems suitable even though I dislike the vague nature of the phrase as a possible question.
Do you mean like bp_member_class? :)