Open files in a new tab

in Download Manager Free

Viewing 11 posts - 1 through 11 (of 11 total)
Aug 13, 2021 at 6:28 pm
#159771
Participant
Hudi Webcart
OP

Hi,
Can not open file in a new tab as before.
I changed /wp-content/themes/astra/footer.php

<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Astra
 * @since 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

?>
<?php astra_content_bottom(); ?>
	</div> <!-- ast-container -->
	</div><!-- #content -->
<?php 
	astra_content_after();
		
	astra_footer_before();
		
	astra_footer();
		
	astra_footer_after(); 
?>
	</div><!-- #page -->
<?php 
	astra_body_bottom();    
	wp_footer(); 
?>
<script>
jQuery(function($){
    $('.wpdm-download-link').each(function(){
         $(this).attr('target','_blank');
    });
});
</script>

	</body>
</html>

I changed /wp-content/plugins/download-manager/src/Package/views/link-templates/link-template-default.php

<!-- WPDM Link Template: Default Template -->

<div class="link-template-default card mb-2">
    <div class="card-body">
        <div class="media">
            <div class="mr-3 img-48">[icon]</div>
            <div class="media-body">
                <h3 class="package-title">[page_link]</h3>
                <div class="text-muted text-small"><i class="fas fa-copy"></i> [file_count] [txt=file(s)] <i class="fas fa-hdd ml-3"></i> [file_size]</div>
            </div>
            <div class="ml-3">
                <a href="[download_url]" class="btn btn-primary" target="_blank">[link_label]</a>
            </div>
        </div>
    </div>
</div>

And I changed /wp-content/plugins/download-manager/src/Package/views/page-templates/page-template-default.php

<!-- WPDM Template: Default Template -->
<div class="row">
    <div class="col-md-12">
        <div class="card mb-3 p-3 hide_empty [hide_empty:featured_image]">[featured_image]</div>
    </div>
    <div class="col-md-5">
        <div class="wpdm-button-area mb-3 p-3 card">
         <a href="[download_url]" class="btn btn-primary" target="_blank">[link_label]</a>
            <div class="alert alert-warning mt-2 [hide_empty:expire_date]">
                Download is available until [expire_date]
            </div>
        </div>
        <ul class="list-group ml-0 mb-2">
            <li class="list-group-item d-flex justify-content-between align-items-center [hide_empty:version]">
                [txt=Version]
                <span class="badge">[version]</span>
            </li>
            <li class="list-group-item d-flex justify-content-between align-items-center [hide_empty:download_count]">
                [txt=Download]
                <span class="badge">[download_count]</span>
            </li>
            <li class="list-group-item d-flex justify-content-between align-items-center [hide_empty:file_size]">
                [txt=File Size]
                <span class="badge">[file_size]</span>
            </li>
            <li class="list-group-item d-flex justify-content-between align-items-center [hide_empty:file_count]">
                [txt=File Count]
                <span class="badge">[file_count]</span>
            </li>
            <li class="list-group-item d-flex justify-content-between align-items-center [hide_empty:create_date]">
                [txt=Create Date]
                <span class="badge">[create_date]</span>
            </li>
            <li class="list-group-item  d-flex justify-content-between align-items-center [hide_empty:update_date]">
                [txt=Last Updated]
                <span class="badge">[update_date]</span>
            </li>

        </ul>
    </div>

    <div class="col-md-7">
        <h1 class="mt-0">[title]</h1>
        [description]

        <div class="wel">
            [tags]
        </div>

    </div>

</div>

But it still opens files on the same tab and not in a new tab.

  • This topic was modified 4 years, 6 months ago by Shahjada. Reason: creds removed
Aug 14, 2021 at 7:14 am
#159783
Spectator
Tanvir

Hello @hudi-webcart,
You just need to follow this:

1. Copy page-templates directory from /plugins/download-manager/src/package/views directory to your active theme directory.
2. Make a new directory as download-manager on your active theme directory.
3. Now remove all files from {active-theme}/download-mamager/page-templates except the template files you need to update.
4. Update template file(s) in {active-theme}/download-manager/page-templates directory as per your need. As you need to add open in a new tab you have to add this <a href="[download_url]" target="_blank">[link_label]</a>

Let me know please if you still find any issues.

Thanks

Aug 16, 2021 at 5:22 am
#159844
Participant
Hudi Webcart
OP

Hi,
Many thanks for the instructions.
Unfortunately the files still being opened in the same tab.
I did NOT add the JS mentioned here in footer.php – if needed, pls let me know.

Aug 16, 2021 at 6:20 am
#159846
Keymaster
Shahjada
Staff
This reply has been marked as private.
Aug 16, 2021 at 3:09 pm
#159883
Participant
Hudi Webcart
OP

OK. Thanks for adding.
But still files open in same tab.

Aug 16, 2021 at 3:11 pm
#159884
Keymaster
Shahjada
Staff

Please give me an URL where the download link opens on the same tab for you. In my test ( https://flowersoapscoil.ipage.com/aitech/test/?search=p ), it is opening in a new tab.

Aug 16, 2021 at 3:19 pm
#159885
Participant
Hudi Webcart
OP
This reply has been marked as private.
Aug 16, 2021 at 3:28 pm
#159887
Keymaster
Shahjada
Staff

LOL, you meant tree view shortcode, we already documented it on https://www.wpdownloadmanager.com/download/wpdm-extended-short-codes/. Simply adding newwin=1 with shortcode shall open the link in a new window/tab.

Aug 16, 2021 at 3:41 pm
#159888
Participant
Hudi Webcart
OP

Amazing!
I see you already add it and now it works well!!!
Thanks a lot for the patience and help!
Such a wonderful support. Great job!

By the way, can you mark private post ##159771 with the cred.

Aug 17, 2021 at 4:38 am
#159920
Spectator
Humayon

Hi @hudi-webcart,
I see the post with cred is already marked as private.
However, If you found our support helpful, could you leave your valuable review here?
Your rating keeps us inspired.
Thank You

Aug 17, 2021 at 4:42 am
#159921
Participant
Hudi Webcart
OP

Thanks and sure I will give my 5 stars.

Viewing 11 posts - 1 through 11 (of 11 total)

The topic "Open files in a new tab" is closed to new replies.