Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 4 years ago

#5051 closed enhancement (maybelater)

Ajax pagination should be less markup-dependent

Reported by: henrywright Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords: trac-tidy-2018
Cc:

Description

Is there any way the ajax pagination in the members loop can be less reliant on the page markup? It seems for the ajax pagination to remain working, the markup in members/index.php and members/members-loop.php needs to be left almost fully intact.

I have seen so many threads in the support forums from people who have customised their themes asking why their ajax search or pagination has broken. Even perhaps some comments at the top of these files to say "keep off the grass" will help them avoid making changes to the markup which, unknowingly to them, will cause problems.

Change History (4)

#1 @boonebgorges
8 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from Ajax pagination to Ajax pagination should be less markup-dependent

There are probably a few specific things we can do to make the AJAX a bit more independent of the markup - for instance, I see some places where we're doing parent().parent() etc to figure out the current content type. However, we can never really make it markup-independent. For one thing, we're fetching the entire template content, which means we have to have a reliable parent element whose .html() we can swap out. For another, we're forced to use event delegation for pagination (for a couple different reasons), which means that we have to specify CSS selectors both for the parent element ('#buddypress', in the case of bp-legacy) and the target elements (such as the pagination elements).

Making the situation even more complicated is that if we made some of the necessary changes (such as adding relevant selectors to the pagination links themselves, rather than doing .parent() traversal; see buddypress.js line 739), we're likely to break existing themes that are using our JS but overriding the directory templates with their own markup.

All that said, I have a couple ideas about how this might be done, but in the meantime patches are very welcome.

#2 @henrywright
8 years ago

Thanks for the feedback. I guess markup-dependency is the side-effect of AJAX and is necessary for it to be able to work effectively.

One very quick-win (apologies for the buzzword) that may help theme developers would be to add some comments to the top of relevant template files (perhaps in Turtleshell) which describe the markup being used by AJAX within that file and to proceed editing with caution.

#3 @DJPaul
4 years ago

  • Keywords trac-tidy-2018 added

We're closing this ticket because it has not received any contribution or comments for at least two years. We have decided that it is better to close tickets that are good ideas, which have not gotten (or are unlikely to get) contributions, rather than keep things open indefinitely. This will help us share a more realistic roadmap for BuddyPress with you.

Everyone very much appreciates the time and effort that you spent sharing your idea with us. On behalf of the entire BuddyPress team, thank you.

If you feel strongly that this enhancement should still be added to BuddyPress, and you are able to contribute effort towards it, we encourage you to re-open the ticket, or start a discussion about it in our Slack channel. Please consider that time has proven that good ideas without contributions do not get built.

For more information, see https://bpdevel.wordpress.com/2018/01/21/our-awaiting-contributions-milestone-contains/
or find us on Slack, in the #buddypress channel: https://make.wordpress.org/chat/

#4 @DJPaul
4 years ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.