Changing Field in Community Builder

2 years 3 months ago #1 by Eric
I want to change the username in the favorite list into another cb_field, so that I can add favorite profiles of community builder with another field name of the profile and have that names in the favorite list.
What I have to do?

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

2 years 3 months ago #2 by Christopher Mavros
Hello Eric and thank you for posting!

MyShortlist allows the creation of template overrides for every item type. To create a template override for Community Builder, you would need to copy the file /modules/mod_myshortlist/tmpl/default_item.php to /templates/your_template/html/mod_myshortlist/cb_item.php

In that file, you can write some PHP and load the desired cb_field from the database, using the $item->object->id (to get the id of the saved profile).
The new value can be placed in $item->object->title to be shown as the saved item title.

If you need help writing PHP, we could possibly implement it for you. In that case, please send me an email at mavrosxristoforos@gmail.com
Thanks again!

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

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

2 months 1 week ago #3 by Michael
?>
<div class="myshortlist_item">
<?php if ($item->image != '') { ?>
<div class="myshortlist_item_image">
<?php if ($item->link != '') { ?>
<a href="<?php print $item->link; ?>" class="myshortlist_img_link">
<?php } ?>

Before I go and mess everything up beyond repair, Is this the field that would need to be changed so that the community builder avatar is used in the list along with their name field??

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

2 months 1 week ago #4 by Christopher Mavros
Hi Michael and thank you for posting!

Yes, that would be it.
If you load the Community Builder avatar image, you can simply assign it to $item->image, above the code that you mentioned, so that it automatically captures it and uses it.

Let me know if you need any further help!

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

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

1 month 3 weeks ago #5 by Michael
Just a thought here.

I am having a great deal of difficulty getting the right coding and where to put it (which override file) How difficult would it be to just program into the module, so we don't have to rewrite anything a box that would enable us to set the value of $item to a select field name?

Community Builder for example has the field [avatar] for using the profile image but the correct php to do this is something that end users would have to have a knowledge of php to write. Same circumstances apply to the other social components that are commonly used.

Being I'm not all that proficient with php it would make my life so much easier.

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

1 month 3 weeks ago #6 by Christopher Mavros
Hi again Michael.
If I could gather some more information, I could possibly implement that.
Can you please mail me at mavrosxristoforos@gmail.com with a temporary administrator account, so that I can see the Community Builder avatar field you mentioned?
Thanks again.

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

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

Moderators: Christopher Mavros