[SOLVED] Preferred address switch

12 years 9 months ago - 12 years 8 months ago #173289 by richbrundage
[SOLVED] Preferred address switch was created by richbrundage
I am working with an organization whose member database has both home and work address information and a field denoting which is preferred. I use an php import script to create users, and in the past used the preference field to determine which address to import. Instead I would like to use the preference field to control which address is displayed on the member profile, while keeping both addresses available for member update. Something like a logical switch that could be applied to the profile fields to determine which is displayed. Thanks in advance for your help.

Richard Brundage

Please Log in to join the conversation.

12 years 9 months ago #173296 by krileon
Replied by krileon on topic Re: Preferred address switch
This could easily be done with an IF substitution statement and delimiter fields. I recommend creating a tab and placing all your address fields plus the toggle checkbox field on it. Then set that tab to be in a not shown on profile position. Once done create a delimiter field with the below substitution (change as necessary) for each address field "City, State, etc..."; this would allow for toggled display.

[cb:if cb_showaddr="1"][cb_country1][/cb:if]
[cb:if cb_showaddr="0"][cb_country2][/cb:if]

You can find further information regarding substitution usage at the below tutorial.

www.allmysocials.com/directory/tutorials/item/233-substitution-usage


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.
The following user(s) said Thank You: richbrundage

Please Log in to join the conversation.

12 years 8 months ago #173867 by richbrundage
Replied by richbrundage on topic Re: Preferred address switch
This works great - the idea is to put the delimiter field on the tab you want the info displayed on, and then the source fields on a hidden tab, along with the selection checkbox. I had looked at delimiter fields but hadn't realized you could use IF statements, thanks for pointing me to your page on this.

Richard Brundage

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.317 seconds

Facebook Twitter LinkedIn