Topic: Wordpress dashboard widget

Hey guys!

Well i'm thinking of buy Juicebox Pro but first i need to resolve some issues with lite. I've created a wordpress dashboard widget in wich i wanted to show the gallery that has the same id as user id. The dashboard widget is written in functions.php in the theme folder.

The point is... when the gallery doesn't exist it shows me the message "Juicebox Gallery Id # has been deleted." and that's ok. But when the gallery exists it outputs nothing, nothing appear on the widget. If someone can help me i would apreciate it a lot.

Thanks in advance

2 (edited by monofasico 2013-07-21 20:36:51)

Re: Wordpress dashboard widget

Well now that i called juicebox.js it enlarges the widget to the gallery size but still no content

function galeria_dashboard_widget_function() { // gallery widget ?>
<script src="https://dl.dropboxusercontent.com/u/43242438/juicebox.js"></script>
<?php
    $current_user = wp_get_current_user();
    echo do_shortcode('[juicebox gallery_id="'. $current_user->ID .'"]');
} 
function galeria_add_dashboard_widgets() {
    wp_add_dashboard_widget('galeria_dashboard_widget', 'Galeria', 'galeria_dashboard_widget_function');    
}
add_action('wp_dashboard_setup', 'galeria_add_dashboard_widgets' );

Probably other files missing... :/

Re: Wordpress dashboard widget

All the Juicebox gallery files must be on the same domain/subdomain as the JavaScript embedding code due to the same-origin policy. Please see this web page for further information.

If you are load the 'juicebox.js' file from a Dropbox server but all your other gallery files are on a different server (where your WordPress installation is hosted), then the gallery will likely not display.
Also, the complete 'jbcore' folder should be kept intact. Loading the 'juicebox.js' file in isolation will not work.

Upload the complete 'jbcore' folder to your own web server and load the 'jbcore/juicebox.js' file from within it.

Re: Wordpress dashboard widget

I'm using Wordpress plugin to generate the gallery.

function galeria_dashboard_widget_function() { // gallery widget
    $current_user = wp_get_current_user();
    echo do_shortcode('[juicebox gallery_id="'. $current_user->ID .'"]');
} 
function galeria_add_dashboard_widgets() {
    wp_add_dashboard_widget('galeria_dashboard_widget', 'Galeria', 'galeria_dashboard_widget_function');    
}
add_action('wp_dashboard_setup', 'galeria_add_dashboard_widgets' );

If the code is like this it gives me the message if the gallery doesn't exist but it doesn't outputs anything if the gallery exists...

Thanks

Re: Wordpress dashboard widget

Forget it... already working!
I did what you've said and now it's working fine!

Thanks

Re: Wordpress dashboard widget

I'm glad you've got it working. Thank you for posting back to let me know.