Skip to Content Skip to Menu

SOLVED: I can't get substitute working in a CB Content Module.

  • NFA
  • NFA
  • OFFLINE
  • Posts: 84
  • Thanks: 15
  • Karma: 0
2 years 7 months ago - 2 years 7 months ago #329136 by NFA
Hi,

I have used Community Builder substitution for a while now. But it's my first try to get that work in a CB Content Module. The plugin execute the substitution but doesn't return a value. What am I missing here?

The same code, for example just
Code:
[user_id]
is working fine in a CB field. But when I put exactly the same code in a CB Content module, published on the same CB profile page, it doesn't get the right values. There [user_id] returns (the number) 0. Other existing fields returning nothing, but the code [user_id] is gone. So it looks like substitution plugin took place but could not find his way to the right value. When I use a non-existing field, like [nonexisting_field], it outputs [nonexisting_field], like expected.

I put the plugin on top of the plugin order (just in case) but can't get it to work. Any idea why I can't get CB Content Module to work with the same CB substitution?

Regards, Noa
Last edit: 2 years 7 months ago by NFA.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 7 months ago #329144 by krileon
Substitutions in CB Content Module are always against the viewing user (the user currently logged in and viewing the module). If you want them to be against the displayed profile user you need to use the user="#displayed" parameter. Example as follows.

Code:
[cb:userdata field="user_id" user="#displayed" /]

If you want it to work against both you can use #displayedOrMe as shown below.

Code:
[cb:userdata field="user_id" user="#displayedOrMe" /]


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum