How to add a custome item to person's profile (in profile page and card)
In my site, we created a custom field for members "members_country". Members choose countires form a list of countries. However, I want that value (the country) to be shown in the Person's profile page as well as in the card (see images). How to do that?
-
-
·
LeonidS
- ·
Hello @Tajrebatee !
1) If you need to show a new field in the header of the profile page, then enable this field in the View Person form which is shown in the View Info block. Then add the RAW block with the JS/JQuery script moving this field to the necessary place.
2) The adding the new fields to the profile could be done via the code's modification. You need to correct the unit or getSnippetMenuVars methods in the modules/boonex/persons/classes/BxPersonsTemplate.php file to add there processing of the user field's choice.
-
·
LeonidS
-
- · Peter
- ·
I use the Advanced Menu module from @AQB Soft. Perfect for any kind of Snippet Meta Menues... You can create your owen 'snippets' or ask for a custom one at the AQB Team.
^^ My Profile Card Setup (Testserver)
-
- · Peter
-
·
In reply to Peter
- ·
... and in my exp profile card members, views and followers are just disabled in the persons snippet meta menue ;)
-
- · Tajrebatee
-
·
In reply to Peter
- ·
Thank you so much. I purchased it and will try to use it. Looks like a bit complicated to use, but will try to learn how to use it. Where is the "contry/city" comes from? is it an option for your members to choose from when they register to your site?
-
- · Baloo
-
·
In reply to Tajrebatee
- ·
Hello, this is how I set it up.
Result
-
- · Chris Andre Buys
- ·
Can I come into this discussion... are there paid modules that make use of Country/State/City values?
-
- · Tajrebatee
-
·
In reply to Baloo
- ·
Thank you so much!! However, I don't see these options you outlined above in the "Advanced Menu" module pointe above by @Peter .
Can you elaborate on how to get to the menu shown above?
Your help is much appreciated.
-
@Chris Andre Buys ...Of course my friend. It looks like there is one (advanced Menu) shown above. We bought it yesterday but still trying to figure out how to use it (may be @Peter @AQB Soft can help us as well)
-
- · Baloo
-
·
In reply to Tajrebatee
- ·
Sorry, the module I use is Profile Cards, maybe it can be done with the module Peter mentioned too, but I don't have that one, I can't explain to you.
This one is pretty simple, under the "save" you have a list of all the profile fields, you just drag them to one of the two lines you have. It will then write the tags. Between the tags you can also write text if you want. You also have the choice between several card layouts. Like all AQB modules, it is very well done. I thought it was a simple way for you when it comes to cards.
-
- · Tajrebatee
-
·
In reply to Baloo
- ·
Thank you so much again, much appreciated. It looks like this is the module I should've got!
-
I wont be able to buy it at this stage, but truly I am glad since it holds the format of how our data is stored and indexed... I've raised my concerns on the SPACE module and hope unacms can liaise with @Peter @AQB Soft to incorporate the same feature there. Thanks for responding @Tajrebatee , much appreciated.
-
Thanks @LeonidS . Can you give us more clarification or guidance on how to do step 2 above (sorry, I don't have good coding skills!). We bought "advanced" module from @AQB Soft as recommended on this thread, but we didn't hear from them after we messaged them.
-
Well, it heavily depends on how that custom "members_country" filed is implemented on your site. Whether it is stored as a plain text, or a list item, and if it is a list item - what list is in use - a custom one or the default "Country" one. All of this is unclear.
If we assume that the exact field name is 'members_country' and it stores just an item ID from a "Country" list then the following handler should display a country in that case:
if (!isset($aContentData['members_country'])) return ' '; $sVal = $aContentData['members_country']; $aCountries = BxBaseFormView::getDataItems('Country'); if (!isset($aCountries[$sVal])) return ' '; return $oMenuObject->getUnitMetaItemText($aCountries[$sVal]); -
Thank you for replying. Here is how I added that field and what it has (see images below). I appreciate any more input based on this clarification.
-
Thanks. Can you clarify where the above code goes to?
is it to this file like @LeonidS suggested above (modules/boonex/persons/classes/BxPersonsTemplate.php)
or in your "advanced" module?
-
This is a code to use in the Advanced Menu module. You need to create a new custom menu item handler in the module, give it any name you wish (see examples in the module) and use the provided code as a "Handler's PHP code". Then follow the instructions given in the module (see the bottom of the page, the section "What to do next?")