Skip to:
Content
Pages
Categories
Search
Top
Bottom

BuddyPress Profile Data as Print / Save as PDF Option for Users


  • harpodjc
    Participant

    @harpodjc

    Hi Guys. Any possible help or info on this topic would be greatly appreciated.

    WordPress version – Latest Updated Version
    BuddyPress version – Latest Updated Verion

    Here is the what I am trying to achieve with the BuddyPress Plugin for my Users.

    To create a ‘Print Profile Data as PDF” as an option within the BP User Nav section. Please see images –

    I want the user’s Profile Data and custom fields to display as a Print / Save as PDF option when the user clicks and selects it.

    It will generate this dynamic data in a presentable layout.

    Any advice or alternative PHP options for this option creation would be most greatly welcome. My print.css style-sheet is currently blank. I’ve no idea of the coding that needs to go into it to finish this idea below and make it work.

    Please Help!!!

    =============================================================================================
    The Modification’s I have completed to date to get it this far!!!
    =============================================================================================

    Creating Profile Print Navigation

    Created a print.css file in the WP Theme Folder.

    > WP Theme Folder folder / functions.php file.
    Added this custom code:
    wp_enqueue_style( 'thrive-print', get_template_directory_uri() . '/print.css', array(), 'print' );

    > Next – Theme > inc folder and opened up extras.php & added this code below:

    function theme_print_nav() {
        global $bp;
        $args = array(
                'name' => __('Print PDF', 'buddypress'),
                'slug' => '#',
                'default_subnav_slug' => '#',
                'position' => 30,
                'show_for_displayed_user' => false,
                'item_css_id' => 'print-pdf'
        );
        bp_core_new_nav_item( $args );
    }
    add_action( 'bp_setup_nav', 'theme_print_nav', 99 );
    

    It added a Print PDF navigation in the Profile Menu.

    Lastly I went to Theme > js folder and open theme.js file.
    Added this line of code.

    $("#user-print-pdf").attr("href", "javascript:window.print()");

    The Print Feature was then added to site.

    =======================================================================================

    This is as far as I have got. Any suggestions guys on how to sync / finish this would be amazing 🙂

    Thanks a mill,

    David.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar