Putting a CB field in a content page so it can be edited outside of profile

1 week 4 days ago #313169 by Matt2012
I have a normal page where I want to display a dropdown list where users can select a profile option (say favourite colour) so that will be saved to their profile.
This option can exist in profile as well - it won't appear during registration.

Is this possible?
1 week 4 days ago #313173 by krileon
Yes, that's possible using CB Core Fields Ajax then by rendering the formatted HTML output of a field via a substitution. Example substitution as follows.

[cb:userfield field="FIELD_NAME" formatting="span" /]

For it to be properly styled with CBs CSS you'll need to surround it with CBs CSS namespace. Example as follows.

<span class="cb_template">[cb:userfield field="FIELD_NAME" formatting="span" /]</span>

There's nothing more to it beyond ensuring the field has ajax editing enabled in CB Core Fields Ajax. This can be used anywhere CB substitutions are supported. So for example in a Joomla article using CB Content Bot or in CB Content Module.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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: Matt2012
1 week 4 days ago #313176 by Matt2012
Great thanks got it working.
The following user(s) said Thank You: krileon
1 week 2 days ago #313207 by Matt2012
OK Im running into another problem.

In my situation members will not yet have a value for this new field. This means that what you see is just empty space.
One of the options of the single select dropdown is None with value empty but it is still showing blank rather than None.

d.pr/v/Q1dqRO
1 week 2 days ago - 1 week 2 days ago #313218 by krileon
The blank value label doesn't display on profile. It's just a means of changing the empty value label to something other than nothing. Empty fields on profile will always display "Empty Field Text" as configured in CB > Configuration > User Profile. CB Core Fields Ajax extends this a little further and lets you specify a per-field placeholder using the "Placeholder" parameter under Integrations > CB Core Fields Ajax. So for example if you want it to say None instead of the dash set the placeholder to "None".


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
Moderators: beatnantkrileon
Time to create page: 0.385 seconds
Facebook Twitter Google LinkedIn