Best way to create a custom dashboard view

6 years 5 months ago #298872 by cpaschen
I need to create a rather customized dashboard view.
Ideally this would be a tab that I would just code all the contents externally (it is just to 'display' data from various tables, modules, etc).

What would be the best way to do this?

Is there a way to create a custom tab (possibly via a cb plugin) so that I can just put that into a tab location in the dashboard?

Or should I do that with a CODE field (and have that the only item on that tab)?

Ideally I'd prefer to have my code in an external php file that gets called.

What would you say is the 'best' method to make this happen (preventing any potential CB upgrade problems, etc.)?

Please Log in to join the conversation.

6 years 5 months ago #298877 by krileon
Replied by krileon on topic Best way to create a custom dashboard view
There is no dashboard view. We probably won't have such functionality until a later CB release like CB 3.0 when we add layout functionality. Basically you'd have the profile you see, the profile others see, and profile edit. Best way to have a dashboard now I guess is CB Conditional to show/hide various tabs based off who is looking at the profile. As for outputting your custom code yes you can use a CB Code Field and you can either add your code directly to it or just do an include of your code file (you can pass substitutions to your include using variables).


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.

6 years 5 months ago #298884 by cpaschen
Replied by cpaschen on topic Best way to create a custom dashboard view
Sorry, I should have said the user profile view (we're just calling it the 'dashboard' here because that's the common term these days :-) )

The code method should work fine; however, I've tried to use the include method, but I'm wondering if CB somehow does something with my include command or if there is some short-code to do an included within a code item.

I have:
include_once (JPATH_BASE.DS.'libraries'.DS.'books'.DS.'books_cb_dashboard_reviewstats.php');
$return = doUpdateDisplay($display);

But I'm getting an error "Call to undefined function doUpdateDisplay()"

Is there some 'trick' to doing an include_once within the code area? Or does my include file need to be located somewhere within the CB folder structure?

NOTE: I've tried also with JPATH_ROOT and JPATH_SITE with same results.

Please Log in to join the conversation.

6 years 5 months ago #298891 by krileon
Replied by krileon on topic Best way to create a custom dashboard view
It's generating PHP from a string. Your Joomla defines of JPATH_BASE and DS are probably not available for usage and you'll need to use actual API calls. I also don't suggest trying to run a function like that (as probably won't work), but just have your include directly return whatever you're wanting. For example the below should work fine.

global $_CB_framework;

return include_once ( $_CB_framework->getCfg( 'absolute_path' ) . '/libraries/books/books_cb_dashboard_reviewstats.php' );

In your PHP file you'd then do a return. Have to keep in mind this isn't like just adding PHP to a file. It's generating anonymous functions and executing them. Also keep in mind CB Code Field is template driven. You could have a template file that handles all your code for you and just set it as the template for that code field.


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.

Moderators: beatnantkrileon
Time to create page: 0.300 seconds

Facebook Twitter LinkedIn