Skip to Content Skip to Menu

[SOLVED] CBSubs Substitutions inside Profile Custom HTML Field

3 years 2 months ago - 3 years 2 weeks ago #326150 by marriage_minded_man
I'm trying to display a bunch of data on a user's profile, that would include CBSubs expiry data. So I am creating a Custom HTML Field on a Profile tab and formatting it the way I need it.

I can't figure out how to display signup_date and expiry_date for CBSubs plans.

I've looked here:
www.joomlapolis.com/news/18550-cbsubs-gpl-4-1-with-timed-content-taxes-inclusive-price-display-and-plan-substitutions-usable-anywhere

and here: www.joomlapolis.com/forum/255-developer-members-support/242915-how-to-use-substitutions-for-cb-subs-fields-in-joomla-article

Where this is mentioned:

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

That seems to work on articles, but not inside a CB Profile Custom HTML field. What's the equivalent code for displaying on a profile (either inside a Custom HTML Field or as a standalone field if I need to create one)?

Thanks.
Last edit: 3 years 2 weeks ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • lousyfool
  • lousyfool
  • OFFLINE
  • Posts: 141
  • Thanks: 46
  • Karma: 5
3 years 2 months ago #326151 by lousyfool
Have you set "Prepare content using CMS Content plugins" to yes in the "Parameters" tab of the Custom HTML field?
The following user(s) said Thank You: krileon

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 2 months ago #326158 by krileon
CBSubs substitutions are Joomla content plugin substitutions. So for them to work in wherever you choose to use them that location needs to support Joomla content plugins.

In the case of Custom HTML fields above you need to enable "Prepare content using CMS Content plugins" under the "Parameters" tab of the field as said above.


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.

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
3 years 3 weeks ago - 3 years 3 weeks ago #326877 by galanopd
"Prepare content using CMS Content plugins" set to yes in the "Parameters" tab of the Custom HTML field, but refuses to display unless user is logged in.

Code:
<p>[cbsubs:if plan="20" status="A"]</p> <p>Subscription plan: [cbsubs:plans plan="20" output="name" /]</p> <p>Signup: [cbsubs:subscriptions plan="20" output="signup_date" /]</p> <p>Valid through: [cbsubs:subscriptions plan="20" output="expiry_date" /]</p> <p>[/cbsubs:if]</p>



EDIT: Also tried user="[action_user]" described in www.joomlapolis.com/forum/255-developer-members-support/243809-solved-print-contents-of-single-cb-profile-tab?start=0 but didn't work either.
Last edit: 3 years 3 weeks ago by galanopd.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 3 weeks ago #326881 by krileon

"Prepare content using CMS Content plugins" set to yes in the "Parameters" tab of the Custom HTML field, but refuses to display unless user is logged in.

That's working as intended. The default user for CBSubs substitutions is the viewing user not the displayed user. If you need the substitutions to check against the displayed user then you need to add user="#displayed" to your substitutions, which should work fine in your usage since you're displaying this through a profile field. Note "user" should always be first. Example as follows.

Code:
[cbsubs:if user="#displayed" plan="20" status="A"] <p>Subscription plan: [cbsubs:plans user="#displayed" plan="20" output="name" /]</p> <p>Signup: [cbsubs:subscriptions user="#displayed" plan="20" output="signup_date" /]</p> <p>Valid through: [cbsubs:subscriptions user="#displayed" plan="20" output="expiry_date" /]</p> [/cbsubs:if]

EDIT: Also tried user="[action_user]" described in www.joomlapolis.com/forum/255-developer-members-support/243809-solved-print-contents-of-single-cb-profile-tab?start=0 but didn't work either.

That topic is discussing using CB Auto Actions where [action_user] exists. That does not exist in Custom HTML fields.


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.

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
3 years 3 weeks ago #326886 by galanopd
I had tried user="#displayed" too and I didn't check the user profile but the list only.
So yes, you are correct it does appear on the user profile now.
How do I make it visible on the list too?

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

Moderators: beatnantkrileon
Powered by Kunena Forum