Skip to Content Skip to Menu

Display a tab only if joining a specific group - created in groupjive

  • Berilac
  • Berilac
  • OFFLINE
  • Posts: 28
  • Thanks: 4
  • Karma: 0
10 years 8 months ago #241621 by Berilac
I am trying to set up tab conditional to display a tab only if you join that specific group, created within groupjive.

After reading several of the documents here, I think I have confused the hell out of myself, which isn't very difficult.

Basically I have created a group for golfers, and have enabled the golf stats plugin. Then go into the settings for that tab. But cant seem to find a setting to enable display only if you join that group, in conditional?

It is probably extremely simple but I cant seem to find it.

I have tried setting this in Groupjive and in the Tab management in CB

If someone can point me in the right direction, it would be much appreciated.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 8 months ago #241654 by krileon
This is doable, but it takes chaining 2 plugins together. The first is CB Query Field. We need to first query that the user is an active member of your golf group using a CB Query Field. To do this you'd setup the CB Query Field as follows.

Query:
Code:
SELECT COUNT(*) FROM `#__groupjive_users` WHERE `user_id` = '[user_id]' AND `status` IN ( 1, 2, 3, 4 ) AND `group` = GROUP_ID_HERE
Mode: Internal
Output: Single Row
Columns: Single Column

Be sure to replace GROUP_ID_HERE with the actual ID of your Golf group. You can find this within GroupJive > Groups in the backend (far right ID column).

Next you'll need to add the below conditional to your tab.

Display: Tab conditional
Field: Value (under Custom at the bottom of the select)
Value: [cb:userfield field="QUERY_FIELD_NAME_HERE" /]
Translate Value: Disable
Operator: Greater Than or Equal To
Value: 1
Translate Value: Disable
Mode: Show

With the above be sure to replace QUERY_FIELD_NAME_HERE with the name of your query field (e.g. cb_myfield).

This should give what you're wanting or at the least require minimal adjustments. Please see the below tutorial for further usage information for CB Conditional.

www.joomlapolis.com/support/tutorials/107-use-cases/18336-using-cb-conditionals-to-hide-or-show-fields-or-tabs


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.

  • Berilac
  • Berilac
  • OFFLINE
  • Posts: 28
  • Thanks: 4
  • Karma: 0
10 years 7 months ago #242675 by Berilac
Krileon

Thankyou for your prompt response, sorry for the delay in replying.

When creating the query field there is no option to select the tab I require. Which is golf scores. The Tab drop down box only displays: Contact Info, Portrait, User Status etc, no option than to select what looks like default CB tabs?

Am I needing to to something else before this tab is available to query in Field Management.

Many thanks
sorry to sound stupid.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago #242698 by krileon
You can only place fields on tabs that permit tab placement. Most plugin tabs will not allow you to place fields on them, which I am assuming your golf scores tab is a plugin tab.


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.

  • Berilac
  • Berilac
  • OFFLINE
  • Posts: 28
  • Thanks: 4
  • Karma: 0
10 years 7 months ago #242710 by Berilac
Yes unfortunately it dont allow a query field, so I guess I will need to come up with a different solution.

Not to worry, in the great scheme of things its not top of my list.

Many thanks Krileon

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago #242733 by krileon
Why does it need to be on that specific tab? You should be able to place it on any other tab and the query will work fine. You don't need the query field for display, but only need it for the conditional. So you can actually place it on a tab that's in a not shown on profile position so it has no purpose except to be used in the conditional.


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