• Resolved justmigrating

    (@justmigrating)


    Is it possible to display a table with Data Publisher on the backend of WordPress instead of in a post or page? Something similar to the “test publication” table and have it displayed when a custom link on the Dashboard menu is clicked?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi,

    Welcome to the forum! ??

    Yes, that is possible. But shortcode wpdataaccess is not available in the backend.

    How do you want to use the table in the backend? Can you use an iframe? That would allow you to use the shortcode in your iframe and would be the simplest way I can think of. Otherwise you might want to have a look at the code in filer WPDA_Publisher_Form.php. That is where the table is added to the backend, a similar situation.

    I’m interested in how and where you want to add a table to the backend. That might be intering for other plugin users as well…

    Best regards,
    Peter

    Thread Starter justmigrating

    (@justmigrating)

    Hi Peter – thanks for responding.

    I am putting together a membership site for a non-profit organization. I created a custom table of their membership and am using your plugin to display the table. This information is only for the organization’s admin though, which is why I’d prefer it display on the backend rather than on a post or page. Then the organization’s admin will have everything they need on the backend (sortable member table, PayPal transactions, setting membership levels, etc).

    I will look into how to use an iframe on the backend (never done that before) and also at the WPDA_Publisher_Form.php file.

    Thread Starter justmigrating

    (@justmigrating)

    So, after spending several hours on this, I am admitting defeat. I can’t find any code snippets to help me create an iframe from the WP Dashboard menu so I can display my custom table from the backend. And the WPDA_Publisher_Form.php file is over my head.

    I want my custom table to be accessible from the WP Dashboard (and not simply linking to the page the table is on–I’ve done that) so that my client can access the custom table without having to switch between the backend and the front end of their site. If anyone knows how to create a popup or iframe from the WP Dashboard where I can embed my custom table, let me know! Thanks.

    Hi,

    Another way to this can be create a datapublisher table from the plugin. Using that Shortcode in your php backend page where ever you wanted to run the custom table. e.g. Goto function.php and target your hook for the page and paste this code.

    echo do_shortcode( '[wpdataaccess pub_id="8"]' );

    This will display your current data table you wanted to display in the backend of WP. Also you can do more of the settings in the plugin.

    Hope this helps.

    Thread Starter justmigrating

    (@justmigrating)

    Thinkun – Yes! This worked. Thank you so much.

    For anyone else who comes across this question, and wants their custom table from the WP Data Access plugin to be displayed on the backend of WordPress, put the following code in your theme’s functions.php file:

    // add custom link to WP Dashboard menu
    add_action( ‘admin_menu’, ‘register_custom_menu_link’ );

    // create admin page for custom link
    function register_custom_menu_link() {
    add_menu_page( ‘Custom Table Name’, ‘Custom Table Name’, ‘manage_options’, ‘custom_table_name’, ‘custom_table_name_function’, ‘dashicons-images-alt’, 70 );
    }

    // create function for admin page that displays custom table
    function custom_table_name_function() {
    echo ‘<h1>Title of Table</h1>’;
    echo do_shortcode( ‘[wpdataaccess pub_id=”1″]’ );
    }

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Great! ??

    Thank you for your help thinkun! And thank you for sharing your solution justmigrating!

    Have a great week,
    Peter

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display table on backend?’ is closed to new replies.