Skip to main content
  Thursday, June 28, 2018
  1 Replies
  5.1K Visits
  Subscribe
Update "Download" button to "View Page / Visit Site / ect" for external resources that lead to valid URLs.

For example, an external resource is entered into WPFD with the following:

Title: Zapier API Documentation
Type: External Resources
URL: https://zapier.com/learn/apis/

When displayed on the site, the button says "Download". When clicked, the user is expecting to download something... not be taken to another website.

----
Something along the lines of this would be added to the tpl.php :


<?php if ((int) WpfdBase::loadValue($this->params, 'showdownload', 1) === 1) : ?>
    <?php
    $bg_download = WpfdBase::loadValue($this->params, 'bgdownloadlink', '');
    $color_download = WpfdBase::loadValue(
        $this->params,
        'colordownloadlink',
        ''
    );
    $download_style = '';
    if ($bg_download !== '') {
        $download_style .= 'background-color:' . $bg_download . ';';
    }
    if ($color_download !== '') {
        $download_style .= 'color:' . $color_download . ';';
    }
    ?>
    <!-- DETECT FORMAT -->
    $format = '';
    if ($format == 'html') {
        $format .= 'Open Page';';
    } else {
    	$format .= 'Download';';
	}
    <a class="downloadlink wpfd_downloadlink"
       href="/<?php echo esc_url($file->linkdownload) ?>" style="<?php echo esc_html($download_style); ?>">
       	<!-- BUTTON TEXT DEPENDENT ON FORMAT -->
        <?php esc_html_e('$format', 'wpfd'); ?>
        <i class="zmdi zmdi-cloud-download wpfd-download"></i>
    </a>
<?php endif; ?>
A
7 years ago
Hi,

Thanks for contacting us here about this extension.
Update "Download" button to "View Page / Visit Site / ect" for external resources that lead to valid URLs

This feature is impossible now. You can custom your own theme.
For more information: https://www.joomunited.com/documentation/wp-file-download-documentation#toc-3-3-create-your-own-theme

Cheers,
  • Page :
  • 1
There are no replies made for this post yet.