• Resolved bresciauc

    (@bresciauc)


    Hi — and thanks for this great modern plugin!

    We are experimenting with using Delightful Downloads to manage PDF files on our site, and would like the files to open directly in a new browser tab when the link is clicked.

    Is there an easy way we can modify or configure the plugin code to open files in the browser? (We understand that this would require turning off the deep-linking prevention, which in our case we do not need.)

    Thanks for any help you can give.

    https://www.ads-software.com/plugins/delightful-downloads/

Viewing 5 replies - 16 through 20 (of 20 total)
  • Plugin Author A5hleyRich

    (@a5hleyrich)

    A CDN wouldn’t make a difference in this situation. Did the above URL not work?

    Thread Starter bresciauc

    (@bresciauc)

    Plugin Author A5hleyRich

    (@a5hleyrich)

    Thats strange. Whats the site URL? You can email support[at]delightfulwp.com if you want to keep things private.

    Thread Starter bresciauc

    (@bresciauc)

    Just in case I introduced an error when copying code to the functions.php file, here is the current code.

    /**
    * Custom functions to allow Delightful Downloads (https://www.ads-software.com/plugins/delightful-downloads/) to open PDF files in a tab.
    * DD is used to managed PDF documents on the Brescia web sites. Hopefully these functions will go into the DD plugin some day...
    */
    function download_custom_redirect( $download_id ) {
    
        // Get path
        $download_url = get_post_meta( $download_id, '_dedo_file_url', true );
    
        // Send to file
        header( "Location: $download_url" );
        exit();
    
    }
    add_action( 'ddownload_download_before', 'download_custom_redirect', 20, 1 );
    
    function download_new_tab( $styles ) {
    
    	$styles['new_tab'] = array(
     		'name'		=> __( 'New Tab', 'ddownload' ),
     		'format'	=> '<a href="%url%" title="%text%" target="_blank" rel="nofollow">%text%</a>'
    	);
    
    	return $styles;
    }
    add_filter( 'dedo_get_styles', 'download_new_tab' );

    Plugin Author A5hleyRich

    (@a5hleyrich)

    Issue caused by .htaccess file.

    Ashley

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Changing behavior to 'Open in tab'’ is closed to new replies.