Skip to Content Skip to Menu

Possible to fetch a field value to be inserted elsewhere?

  • Hammur
  • Hammur
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
6 years 1 month ago #307860 by Hammur
Hi,
Is it possible with a php code to fetch the value from a created CB Field to show elsewhere on the side like you can fetch Joomla core profile info's?

Joomla core profile info's can be fetched pretty simple, for example showing a users Email can be done with:
Code:
<?php $user = JFactory::getUser(); return "$user->email"; ?>
Wondering if a similar php code can be used to fetch a created CB Field?
In my case it is a CB Text Field with name "cb_fyritka" located in the "Contact info" tab which value I would like to fetch and show other places as well, if possible.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48495
  • Thanks: 8284
  • Karma: 1443
6 years 1 month ago #307871 by krileon
Yes, you can access the database stored values similarly using CB user object, but it's best to use getFields API. See the below tutorials.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18359-establishing-a-cb-user-object

www.joomlapolis.com/documentation/279-community-builder/tutorials/18361-obtaining-field-values-through-getfields-api

You can also just use substitutions using CB Content Bot if you're trying to do this in a place that parses its content through Joomlas content prepare. See below substitution tutorial for usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


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: nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum