Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#7091 closed enhancement (wontfix)

Template Enhancement: On templates with loops (ie. groups/single/members) provide more context with messages on empty

Reported by: garrett-eclipse's profile garrett-eclipse Owned by:
Milestone: Priority: low
Severity: trivial Version: 2.5.0
Component: Templates Keywords:
Cc:

Description

Hello,

Within most templates that have a loop such as the groups/single/members.php the conditional (if bp_group_has_members) has an else which provides a message in this case 'No members were found'.

I'd like to request the else portion of these type of conditionals to check if we're dealing with a search request which is turning up empty or if there are simply no items (ie. members).

So currently the else holds;

<?php else: ?>

        <div id="message" class="info">
                <p><?php _e( 'No members were found.', 'buddypress' ); ?></p>
        </div>

<?php endif; ?>

I would like this to have a check for if search and provide alternate messaging depending upon this so the user knows if there are actually no items (members) or if there were simply none found.

<?php else: ?>

        <?php if ( isset( $_REQUEST['members_search'] ) ) : ?>

                <div id="message" class="info">
                        <p><?php _e( 'No members were found.', 'buddypress' ); ?></p>
                </div>
                
        <?php else: ?>

                <div id="message" class="info">
                        <p><?php _e( 'This group has no members.', 'buddypress' ); ?></p>
                </div>

        <?php endif; ?>

<?php endif; ?>

Thank you

Change History (8)

#1 follow-up: @hnla
9 years ago

  • Priority changed from normal to low
  • Severity changed from normal to trivial

I agree, improvements like this would be a good thing. Anything that takes a more considered view and then returns more helpful user info is a good thing.

I'll add a note to the new templates project to reference this ticket with a view to looking at this aspect for those templates where we are also able to extend this in more detail, on existing templates i.e bp-legacy templates we would be limited to simple string changes, like for like in case additional elements upset layouts.

A few observations:

  • Can we maybe extend this a bit further, maybe returning the failed search string for reference or similar detail
  • To some extent aspects like this are ones that developers can and do extend via overloaded and modified template files.
  • On a very speedy check I get quite inconsistent and erroneous results running checks on members names existing and non-existant so there needs to be some detailed checking here.

#2 in reply to: ↑ 1 @garrett-eclipse
9 years ago

Thanks @hnla, I greatly appreciate your input and am with you 100%.

More granularity with the messaging would be very informative to the user. I've already made this change on one of my instances and tried to keep it to simply adding an alternate message without additional markup/elements introduced.

As a developer that has modified template files keeping them up to date can be a headache and introducing consistent functionality over and over on new projects isn't worth it in most cases. If the default templates support these types of changes by default I'd be able to avoid requiring the modification making my life easier.

Again thank you, and I fully agree with the priority and severity downgrade, this is definitely more of a nice to have than a need.

Cheers

Replying to hnla:

I agree, improvements like this would be a good thing. Anything that takes a more considered view and then returns more helpful user info is a good thing.

I'll add a note to the new templates project to reference this ticket with a view to looking at this aspect for those templates where we are also able to extend this in more detail, on existing templates i.e bp-legacy templates we would be limited to simple string changes, like for like in case additional elements upset layouts.

A few observations:

  • Can we maybe extend this a bit further, maybe returning the failed search string for reference or similar detail
  • To some extent aspects like this are ones that developers can and do extend via overloaded and modified template files.
  • On a very speedy check I get quite inconsistent and erroneous results running checks on members names existing and non-existant so there needs to be some detailed checking here.

#3 follow-up: @hnla
9 years ago

keeping them up to date can be a headache and introducing consistent functionality over and over on new projects isn't worth it in most cases. If the default templates support these types of changes default I'd be able to avoid requiring the modification making my life easier

I'm only too aware of this type of issue, however there does come a point where changes simply can't be added to templates that have been released out into the wild for fear of crashing layouts, it's a difficult balancing act. We do have another proposed solution that is all but ready to roll out that will check overloaded templates and inform devs in the backend under BP settings if they are out of date and what updates have been released so this ought to help enormously in this area.

#4 in reply to: ↑ 3 @garrett-eclipse
9 years ago

Thanks @hnla

That sounds amazing, can't wait ;)

So that'll be kind of like how WooCommerce informs of outdated templates, etc. Would love that functionality.

Appreciated

Replying to hnla:

keeping them up to date can be a headache and introducing consistent functionality over and over on new projects isn't worth it in most cases. If the default templates support these types of changes default I'd be able to avoid requiring the modification making my life easier

I'm only too aware of this type of issue, however there does come a point where changes simply can't be added to templates that have been released out into the wild for fear of crashing layouts, it's a difficult balancing act. We do have another proposed solution that is all but ready to roll out that will check overloaded templates and inform devs in the backend under BP settings if they are out of date and what updates have been released so this ought to help enormously in this area.

#5 @DJPaul
9 years ago

  • Component changed from Appearance - Template Parts to Templates

#6 @DJPaul
9 years ago

  • Milestone changed from Awaiting Review to Future Release

#7 @DJPaul
8 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Closing most tickets related to BP-Default and BP-Legacy, since the upcoming BP-Nouveau template pack (planned for 3.0) will make these redundant.

#8 @DJPaul
8 years ago

Closing most tickets related to BP-Default and BP-Legacy, since the upcoming BP-Nouveau template pack (planned for 3.0) will make these redundant.

Note: See TracTickets for help on using tickets.