Tagged: buddypress, link, Notifications, title, widget
hi Brajesh,
I’m using your excellent little BuddyPress Notifications Widget plugin, *but* the only item I want to show is the title, (not the entire list of notifications). The issue is that when I list every notification, then each one is a link to the correct notification on the user profile. However, if I only show the title (with or without count), then the title is simply plain text, (not a link).
To be clear, the TITLE text “You have 7 new notifications” or “Notifications (7)” needs to be a link to the user profile notifications tab.
Am I missing the obvious way to fix this, or can you assist here?
R.
hi Brajesh,
update: I fixed this by modifying the file directly
core/class-bp-notification-widget.php
.if ( ! empty( $instance['show_count'] ) && ( $count> 0 || empty( $instance['show_list'] ) ) ) { + $link = trailingslashit( bp_loggedin_user_domain( ) . bp_get_notifications_slug() ); + echo '<a href="' . $link . '">'; printf( __( 'You have %d new notifications', 'buddypress-notifications-widget' ), $count ); + echo "</a>"; }
Obviously this is a fudge for my case and it would be better integrated at your end. I also think it would be better if this was an “option” in the settings page, *or* default behaviour. The option would be best, if a little more work for you, of course 🙂
Cheers
R.
and while I’m at it, I’d like to suggest that you provide a shortcode option, or similar, so that it’s easy to place anywhere on the site, rather than just in the widget areas. Not sure how easy/practical that is, but it would certainly be useful.
R.
HI Richard,
Thank you.I will add it as an option in the widget settings. About shortcode, I will consider it. We may not need it once wp 5.0 comes as you can embed widgets anywhere.
Regards
BrajshHi Richard,
Please give a shot to the current version. It includes the shortcode for showing notification.
@ravisharma posted a about it on our blog last week.https://buddydev.com/buddypress-notification-widget-shortcode-integration/
hi Brajesh,
oh, yes, interesting, I hadn’t seen the update. That’s *nearly* perfect.
When I place the widget in my header, and in my footer both, I get:
link(“Notifications (3)”)
text(“You have 3 notifications”);and in the footer, I get:
text(“You have 3 notifications”);What I’m after is:
link(“You have 3 notifications”);If that makes sense?
R.
Thank you for the feedback. We will update it again.
Regards
Brajeshhi Brajesh,
did anything come of this, did you get to updating the notifications title/URL?
R.
Hi Richard,
Thank you for the patience.Please upgrade to 1.3.2
I have added the linking support in the notification widget.Regards
Brajesh
You must be logged in to reply to this topic.