Skip to Content Skip to Menu

Message icon in the Module CB Activity ?

  • Toulouzing
  • Toulouzing
  • ONLINE
  • Posts: 180
  • Thanks: 18
  • Karma: 2
2 days 12 hours ago #343550 by Toulouzing
Message icon in the Module CB Activity ? was created by Toulouzing
As far I know, the icon for messages ans the one for notifications  are displayed only on the profile page.  Thanks to module CB Activity, the notification icon can be displayed on all pages. It seems that i cannot do that for the messages. Is there any possibility to display this icon (with number of pending message of course) ?

 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50270
  • Thanks: 8603
  • Karma: 1470
2 days 10 hours ago #343553 by krileon
Replied by krileon on topic Message icon in the Module CB Activity ?
There isn't a way out of the box, but it's doable with CB Code Field. Create a Code fieldtype then provide it with the following code.
Code:
global $_CB_PMS; return ( $_CB_PMS->getPMSicon( USER_ID_HERE )[0] ?? null );

I recommend putting it on a tab that's in a not shown on profile tab position so you can use it for external display purposes only. Next substitute that field into a CB Content Module using the following.
Code:
[cb:userfield field="FIELD_NAME_HERE" /]

That should then display the PMS icon same as on profile anywhere you like.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • Toulouzing
  • Toulouzing
  • ONLINE
  • Posts: 180
  • Thanks: 18
  • Karma: 2
7 hours 53 minutes ago #343571 by Toulouzing
Replied by Toulouzing on topic Message icon in the Module CB Activity ?
Thank you for the code

I created the CB Code fieldtype named cb_pms but i do not understand which value to set as USER_ID_HERE. The need to display pm icon is not specific to an user.

On other hand, i see a field 'pm'' in the CB fields list. Is it the field to display pm icon in the user's profile page ? Cannot reuse this field in a CB Content module ?

 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50270
  • Thanks: 8603
  • Karma: 1470
7 hours 41 minutes ago #343573 by krileon
Replied by krileon on topic Message icon in the Module CB Activity ?
Completely forgot I added that functionality to the PM field, lol. Yes, it will work. Edit the pm field then under Parameters > Display set "Profile Display Mode" to "Icon with Popover" or "Icon Only" (whichever you prefer). Next substitute that field into a CB Content Module so you can display it anywhere on your site using the following.

[cb:userfield field="pm" /]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum