[SOLVED] Using GJ Group logo (of a given Group-id) on a CB website home-page?

1 year 8 months ago - 1 year 8 months ago #330252 by NFA
Hi,

The PHP code below (in a CB Content module using regularlabs.com/sourcerer, to add custom PHP code) is displaying the GJ logo of a given group-id (in this example 133) fine on every CB and GJ pages.
{source}
<?php
global $_CB_framework, $_PLUGINS;
$group = new \CB\Plugin\GroupJive\Table\GroupTable();
$group_id = '133';
$group->load( $group_id );
$logo = $group->logo( $thumbnail = true, $html = true, $linked = true, $classes = null );
echo $logo;
?>
{/source}

But it is not giving any output on my home-page.

So I read www.joomlapolis.com/documentation/279-community-builder/tutorials/18357-including-cb-api-for-usage-outside-of-cb and add those 5 extra lines of code on top, which results in this module PHP code:
{source}
<?php

if ( ( ! file_exists( JPATH_SITE . '/libraries/CBLib/CBLib/Core/CBLib.php' ) ) || ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) ) { echo 'CB not installed'; return; }
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
cbimport( 'cb.html' );
cbimport( 'language.front' );
outputCbTemplate();

global $_CB_framework, $_PLUGINS;
$group = new \CB\Plugin\GroupJive\Table\GroupTable();
$group_id = '133';
$group->load( $group_id );
$logo = $group->logo( $thumbnail = true, $html = true, $linked = true, $classes = null );
echo $logo;
?>
{/source}

But still there is no group logo or any other data displayed when using this module (with PHP-code) on the home-page.

Any idea how to show a GJ Group logo (of a given Group-id) on a CB website home-page?

Regards, Noa

Please Log in to join the conversation.

1 year 8 months ago #330255 by krileon
I cannot help you with custom coding, sorry. Ensure debug mode and maximum error reporting is enabled in Joomla global configuration then retry and see if any errors output. It's also possible the extension you're using is suppressing errors. The API usage itself looks correct and is the extent of which I can help you.


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

1 year 8 months ago #330256 by krileon
Easiest way to render a group is to probably just use the CB GroupJive module then set "Limit" to 1 and "Include Groups" to the ID of your group. You can then just use a module layout override from Joomla's template component and have it display however you like.


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.

1 year 8 months ago - 1 year 8 months ago #330259 by NFA
Thanks, but I think there must be an error in my usage of the CB API code.

Because, if I put "Prepare using Content Plugins" in the "CB Content" module on "Yes" I get the error:

0 Class 'CB\Plugin\GroupJive\Table\GroupTable' not found

So something have to be wrong in my CB API code or your documentation. Only after more than a day searching, I still didn't find it ;-)
 

Please Log in to join the conversation.

1 year 8 months ago - 1 year 8 months ago #330260 by krileon
You'll need to also call the following to load in plugins.
global $_PLUGINS;
$_PLUGINS->loadPluginGroup( 'user' );


Will add a note about this in the above tutorial.


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

1 year 8 months ago - 1 year 8 months ago #330267 by NFA
Thanks! Turned out that the biggest problem is that I used the PHP code inside that Sourcerer extension. This extension sometimes stripped all <tag>'s out of the HTML, before display. So that's why it showed nothing ;-)

So it isn't a CB issue, and we created a ticket on the supplier of that extension: regularlabs.com/forum/sourcerer/49621-how-to-deal-with-php-api-functions-giving-tag-instead-of-tag-in-their-return-output.

I really hope they can fix this. Or, even it isn't a CB issue, do you know how we can change the <tag>'s in [[]]'s at the API output?

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.970 seconds

Facebook Twitter LinkedIn