Skip to:

Opened 4 years ago

Last modified 4 years ago

#5338 new defect (bug)

Loading of more activity items by the activity stream's 'Load More' button

Reported by: henry.wright Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 1.9.1
Component: Activity Keywords: needs-codex


This may not be a bug but I wanted to ask a question regarding the functionality of the activity stream's load more button.

I'm using the advanced template hierarchy so have all of my page markup in file buddypress/activity/index-directory.php. Now, when the load more button is clicked on page I'm getting activity items loaded on the page as expected. However, the markup used to display these items is coming from bp-templates/bp-legacy/buddypress/activity/activity-loop.php

Is this expected behaviour?

Change History (7)

#1 @imath
4 years ago

Hi @henry.wright,

I don't know how you built your index-directory template, but the load more action is buffering the 'activity/activity-loop', so if in your theme you have this template part in your buddypress/activity folder it should be used instead of the one in bp-legacy. Same logic for the entry template part.

#2 follow-up: @henry.wright
4 years ago

Hi imath,

Thanks for explaining - I built a monolithic index-directory file and didn't think any template parts were needed since the template hierarchy went live. I can see now how some template parts are needed - such in the case here of the load more functionality.

Is it worth mentioning something in the documentation? It wasn't super obvious to me.

#3 in reply to: ↑ 2 @imath
4 years ago

  • Keywords needs-codex added

Replying to henry.wright:

Is it worth mentioning something in the documentation? It wasn't super obvious to me.

I see what you mean : a more detailed codex article to explain how to organize your templates using bp_get_template_part(). Asking @hnla & @mercime for their advices about it.

#4 @hnla
4 years ago

Yes although creating a index page override would essentially mean one had control over the file from top to bottom i.e get_header() to get_footer() we would still be breaking out the inner parts to bp_get_template_part() and if necessary creating a revised template file to include if requiring specific changes on templates that worked on a component or slug, name etc etc.

I agree a little more explicit detail is required on that article as well as a guide outlining all the means one can approach theming BP.

#5 @henry.wright
4 years ago

Using bp_get_template_part() isn't mandatory of course - you can in theory have everything inside index-directory.php. But, as the case of 'load more' shows us, markup from outside of your theme may be called upon and used. One big index-directory.php probably isn't good practice either.

#6 @hnla
4 years ago

Yes general principles of any templating system and indeed the original reason for PHP is to break up code sections that are re-usable so - and although starting to go overboard with too many includes is step in wrong direction - keeping to includes makes sense and makes for neater files to deal with. But yes you're right you can build one monolithic file with thousands of lines in :)but as we can see doing that has issues and includes are nice so best to overload all templates to your theme in my opinion for anything like serious work.

#7 @DJPaul
4 years ago

  • Milestone changed from Awaiting Review to Future Release
Note: See TracTickets for help on using tickets.