BuddyDev

Search

Why does bp members directory reload every time – revisited

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #27960

    Hi Brajesh, I’m taking up this old topic again as it seems like it is not working anymore.

    I copied members-loop-php from bp-templates/bp-legacy/buddypress/members/ to my child theme/buddypress/members, and replaced
    pagination with pagination no-ajax, as suggested.

    The directory does not go to the top, but apparently it reloads again, after visiting a profile, the wheel is spinning and it takes a moment, before you can access the directory again.

    Any idea why the directory is reloaded, when ajax has been deactivated?

    Regards
    Carsten

    This was the code suggested:

    `<div id=”pag-top” class=”pagination”>
    with this

    <div id=”pag-top” class=”pagination no-ajax”>
    same for the bottom of the file

    Replace this

    <div id=”pag-bottom” class=”pagination”>
    with

    <div id=”pag-bottom” class=”pagination no-ajax”>

    https://buddydev.com/support/forums/topic/why-does-bp-members-directory-reload-every-time/

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #27961

    Hi, I noticed that the no ajax reload is working if I return to the directory, by using a back button.

    If I swipe back on the phone screen, the directory reloads.

    Any solution to this would be much appreciated as the reload time is a nuisance for users.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #27962

    Update – It looks like the members directory updating is also taking place when using the back button, the timing is just different, meaning that the directory has updated on page opening, different behavior when swiping back.

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #27966

    Hi Carsten,
    Thank you for the question.

    This is a normal behaviour for web pages using ajax. What you are looking for is an app like back button(or single page app behaviour). In order to do that, the state needs to be saved between various page visits.

    None of the theme supports it. It can be achieved but it is beyond the scope we can help you here.

    You may want to look at https://web.dev/progressive-web-apps/ specification as it aims to bring app like experience for web.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #27975

    Hi Brajesh, I’m aware that this is a normal behaviour for web pages using ajax.

    But the hole purpose of adding the class=”pagination no-ajax”, was not to use ajax?

    So it is not possible to turn off ajax anyway on webpages or how should I understand this?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #27978

    Hi Carsten,
    Thank you for clarifying.

    Please check. is there any chance you have switched to Nouveau template pack? That seems the case to me.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #27979

    Hi Brajesh, thanks, I’m still running Legacy, I know the code does not work with Nouveau.

    Strangely that the code is not working anymore, I have to check the path again, as the code has been deleted and the written in again

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #27980

    Hi Brajesh, just to clarify, where is the right place for adding the pagination no-ajax, as there are two members-loop.php files, one in

    bp-templates>bp-legacy>buddypress>members>members-loop.php

    and one in

    bp-themes>bp-default>members>members-loop.php.

    I have so far added the pagination no-ajax to the members-loop.php file in bp-templates, but should I create a copy of the bp-themes as well to make it work?
    Thanks in advance
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #27985

    Hi Carsten,
    Thank you.

    1. The correct file is bp-templates>bp-legacy>buddypress>members>members-loop.php

    2. I assumed BP Nouveau as the legacy template does not load the first screen via ajax(It loads subsequent pages via ajax).
    If you are seeing the loading text/icon on the very first screen(loading directory), There might be something else doing it.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #28236

    Hi Brajesh, yes there must be something else going on, the directory defiantly gets updated, the activity updates as well, despite the pagination no-ajax has been added.

    What happens in relation to future updates of BP, when members-loop.php has been added to my child theme, I guess updates could involve changes to the members-loop.php file as well?

    Should I then update the file in my child theme manually, or how does that work?

    Regards
    Carsten

You must be logged in to reply to this topic.

This topic is: not resolved