Changing Field in Community Builder
- Eric
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
7 years 1 month ago #1
by Eric
Changing Field in Community Builder was created 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?
What I have to do?
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
7 years 1 month ago #2
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Changing Field in Community Builder
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 me@mavxr.com
Thanks again!
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 me@mavxr.com
Thanks again!
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
- Michael
-
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
5 years 2 days ago #3
by Michael
Replied by Michael on topic Changing Field in Community Builder
?>
<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??
<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.
- Christopher Mavros
-
- Offline
- Administrator
-
5 years 2 days ago #4
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Changing Field in Community Builder
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!
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
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
- Michael
-
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
4 years 11 months ago #5
by Michael
Replied by Michael on topic Changing Field in Community Builder
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.
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.
- Christopher Mavros
-
- Offline
- Administrator
-
4 years 11 months ago #6
by Christopher Mavros
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Replied by Christopher Mavros on topic Changing Field in Community Builder
Hi again Michael.
If I could gather some more information, I could possibly implement that.
Can you please mail me at me@mavxr.com with a temporary administrator account, so that I can see the Community Builder avatar field you mentioned?
Thanks again.
If I could gather some more information, I could possibly implement that.
Can you please mail me at me@mavxr.com with a temporary administrator account, so that I can see the Community Builder avatar field you mentioned?
Thanks again.
Christopher Mavros
me@mavxr.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