SOLVED: CB ContentModule, different content depending or it is CB, GJ or other

2 years 2 weeks ago - 2 years 2 weeks ago #329157 by NFA
Hi,

Using CB Content Module in a sidebar-right position of my template, I want to show different content depending on the page-type:
  • CB User profile page
  • GroupJive Group page
  • or any other CB (registration, list etc), GroupJive (groups category etc.) or Joomla page

I think it's difficult (or a hell to maintain) to use the Menu Assignment (tab) for it, as CB profile pages and GJ group pages doesn't have their own menu item.

What would be the best way to do that?

Something like:
[cb:if page-type="CB-UserProfile"]This is a CB user profile page.[cb:elseif page-type="GJ_GroupProfile"]This is a GroupJive group profile page.[cb:else]This is not a User profile or a Group page[/cb:else][/cb:elseif][/cb:if]

How can you test the kind of JoomlaPolis page-type? I think I can't use [cb:url location for it as I am using a sh404sef extension which rewrites the URL's.

What would be a good way to get this job done?

Noa

Please Log in to join the conversation.

2 years 2 weeks ago #329161 by krileon
It has no substitutions for that, but that's a really good feature to have. I believe best way to support this is to just parse current URL and turn that into a substitution that you can then condition against. Have added a feature ticket to review implementing this. Should be relatively simple, but don't have time today and will take a look tomorrow.

forge.joomlapolis.com/issues/8926

I think it's difficult (or a hell to maintain) to use the Menu Assignment (tab) for it, as CB profile pages and GJ group pages doesn't have their own menu item.

They do, but it's work to maintain them. You'd need to create a menu item per user profile. Not really a limitation of CB, but just an annoyance of Joomla with menu assignment not supporting dynamic conditions (maybe one day!).


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 to join the conversation.

2 years 2 weeks ago - 2 years 2 weeks ago #329168 by NFA

I believe best way to support this is to just parse current URL and turn that into a substitution that you can then condition against


I think using the current URL wouldn't work in most cases, as a SEF extension like my sh404sef will totally rewrite the URL

If that wasn't the case, I could just use my Advanced Module Manager - Assignments (tab) - URL (docs3.regularlabs.com/advancedmodulemanager/getting-started/introduction) for that and test or it has something like "&task=userprofile" for CB or "&plugin=cbgroupjive" for GJ in it.

The last(resort) option of Advanced Module Manager is a custom created PHP code to decide, or a module will be displayed. Maybe you know a (light) PHP query to test (all website) pages or it is a, CB-profile, GJ-group or any other page?

Or, does somebody know how I can add a Joomla Tag (as used in articles) to my custom CB-profile en GJ-group template files? Advanced Module Manager has a Tag option, but I have no clue how to add a Joomla Tag (like CB_profile or CB_group) to my template files.

Please Log in to join the conversation.

2 years 2 weeks ago #329169 by NFA
Hi Krileon,

I (finally) found my solution in docs4.regularlabs.com/advancedmodulemanager/going-further/using-custom-php-conditions. So for me, this ticket is solved ;-).

With kind regards, Noa
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.217 seconds

Facebook Twitter LinkedIn