Skip to Content Skip to Menu

[SOLVED] Using CB Data on a Joomla Article or K2 Item

9 years 11 months ago - 9 years 11 months ago #253241 by Smooth2SITF
I was trying to experiment with adding some user profile data onto a K2 Article.

What I was trying to accomplish was, I wanted to put a specific users Profile Photo (avatar), along with their "formatname" and some other fields, onto a K2 item (article) page kind of like a featured member on a specific page.

I used the format located in the tutorials "Using substitutions throughout CB" however, I am assuming that K2 doesn't use the same coding format since the tutorial is for use inside CB.

Is there something I can use to display database info for CB for a specific user onto a K2 item / Joomla article page? I looked through the tutorials and through the forum but I haven't found something that talks about this. Maybe I am not locating it with the search feature... IDK. Anyone have any thoughts or ideas or can lead me the right direction?
Last edit: 9 years 11 months ago by nant.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48501
  • Thanks: 8284
  • Karma: 1443
9 years 11 months ago #253342 by krileon
Replied by krileon on topic Using CB Data on a Joomla Article or K2 Item
You need to have CB Content Bot installed for substitutions to work in Joomla articles. I've no idea if it works with K2, but I would assume it does. CB substitutions do not just function anywhere on your site. There is a specific API function that the string must be passed through for it to be parsed for substitutions. For CB Content Bot substitution usage it needs to be formatted as follows.

{cb}Content here will be parsed for substitutions.{/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.

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

9 years 11 months ago #253394 by Smooth2SITF
Replied by Smooth2SITF on topic Using CB Data on a Joomla Article or K2 Item
Ok,

That seems to work awesome. But it doesn't work for profile images. didn't see a parameter in the substitutions area. Is there a code for that in which is not listed? Is there something I didn't do right? Also I remember seeing something like a avatar thumbnail.... But I cant find where I saw that.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48501
  • Thanks: 8284
  • Karma: 1443
9 years 11 months ago #253431 by krileon
Replied by krileon on topic Using CB Data on a Joomla Article or K2 Item
You need to use the correct substitution format to render the HTML of an image field. All [FIELD_NAME] substitutions are raw values. For formatted values you need to use [cb:userfield field="FIELD_NAME" /]. Please see the below tutorial for further substitution usage information.

www.joomlapolis.com/support/tutorials/107-use-cases/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.

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

9 years 11 months ago #253456 by Smooth2SITF
Replied by Smooth2SITF on topic Using CB Data on a Joomla Article or K2 Item
I did do that, I have been reading the tutorials and am familiar. This is what I did:

I added the following as indicated and by the Substitutions & Content Bot settings:

{cb}[cb:userdata field="avatar" user="846" /]{/cb}

{cb}[cb:userdata field="formatname" user="846" /]{/cb}



The format name comes up great. For the avatar image, it give you the path. This is what its returning on the page:

www.mcllonghorn.org/images/comprofiler/846_533edd37be95f.jpg

I have a separate cloned field that closes the view from the avatar field for another view I am using, its format is:

{cb}[cb:userdata field="cb_currentphotoclone" user="846" /]{/cb}

{cb}[cb:userdata field="formatname" user="846" /]{/cb}


That field is a Custom HTML field that reads and clones the avatar field for it to show up on another tab for me. The result I am getting back with that on the page is blank. Nothing shows up. That user's avatar is active and there is one on their profile.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48501
  • Thanks: 8284
  • Karma: 1443
9 years 11 months ago #253490 by krileon
Replied by krileon on topic Using CB Data on a Joomla Article or K2 Item
You're using "userdata", that's raw display as the tutorial describes. You need to use "userfield". Please review your substitution usage and the tutorial carefully.


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum