Skip to Content Skip to Menu

How to use substitutions for CB Subs fields in Joomla article

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
4 years 2 months ago - 4 years 2 months ago #320517 by boyjahq
I am creating a certificate for my users that incorporates data from Community Builder, CB Subs and an other form building add-on. I am able to populate information using substitutions from Community Builder and my form builder add-on, but I can't figure out how to include data from the user's CB Subs data. Specifically, I need to show start date and expiration data for their subscription in the Joomla article. Is it possible? If so, what is the syntax to use?
Last edit: 4 years 2 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
4 years 2 months ago #320524 by krileon
CBSubs also has substitutions as well. Review the description of the cbpaidsubsbot plugin within Extensions > Plugins for full usage information. Few examples provided below.

Start Date: [cbsubs:subscriptions plan="PLAN_ID" output="signup_date" /]
Expiration Date: [cbsubs:subscriptions plan="PLAN_ID" output="expiry_date" /]

You can even condition content to show/hide based off their subscription state. Example shown below.

[cbsubs:if plan="PLAN_ID" and status="A"]CONTENT[/cbsubs:if]


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

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

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
4 years 2 months ago #320537 by boyjahq
It works perfectly. Thank you!
The following user(s) said Thank You: krileon

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

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
3 years 11 months ago #322075 by boyjahq
Using these examples,

Start Date: [cbsubs:subscriptions plan="PLAN_ID" output="signup_date" /]
Expiration Date: [cbsubs:subscriptions plan="PLAN_ID" output="expiry_date" /]

it is possible to show the Start Date and Expiration if the user themselves is viewing the article. But if a different user is viewing it, the information is blank. How can I specify the user field to be referenced in these examples? With Community Builder fields I can include user="#displayed" in the code (for example: [cb:userdata field="lastname" user="#displayed"/]. But this does not seem to work with the CBSubs substitutions.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 10 months ago #322077 by krileon
#displayed only works when directly viewing a profile as it's meant to substituted in the displayed user. In your case you need to use user="#me" so it always shows the information of the user viewing the article. This will work fine with CBSubs substitutions as well. The order however is important. For CBSubs substitutions user should come first. Example as follows.

[cbsubs:subscriptions user="#me" plan="PLAN_ID" output="signup_date" /]


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

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

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
3 years 10 months ago #322083 by boyjahq
Actually, I wanted to show the plan begin and end dates for the profile being viewed. Changing the order fixed the problem.

Membership Term:
From [cbsubs:subscriptions user="#displayed" plan="2" output="signup_date"/] To [cbsubs:subscriptions user="#displayed" plan="2" output="expiry_date" /]

Worked as needed.

It would probably save you some answering questions time if the order was the same for cbsubs:subscriptions as it is for cb:, i.e.,
cbsubs:subscriptions should be the same order as cb:userdata. Meaning, if "user=" were the first or last item for both substitution types.

Please consider.

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

Moderators: beatnantkrileon
Powered by Kunena Forum